From a29a3c47478779fa650f12e4b1fe75441c395375 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期三, 22 一月 2025 11:35:37 +0800
Subject: [PATCH] 租户房屋接口对接

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/THouseController.java     |    2 ++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java  |    1 +
 ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml                  |    2 +-
 ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java                   |   18 ++++--------------
 ruoyi-system/src/main/java/com/ruoyi/system/query/TTenantQuery.java              |    2 +-
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java |   15 +++++++++++++++
 ruoyi-system/src/main/resources/mapper/system/TTenantMapper.xml                  |   13 +++++--------
 ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java                    |    4 +++-
 8 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
index 4ae6b2b..fc28438 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
@@ -12,6 +12,7 @@
 import com.ruoyi.system.service.TContractService;
 import com.ruoyi.system.service.THouseService;
 import com.ruoyi.system.vo.HouseVO;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/THouseController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/THouseController.java
index aaab61a..f4a20f6 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/THouseController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/THouseController.java
@@ -14,6 +14,7 @@
 import com.ruoyi.system.query.TUserHistoryQuery;
 import com.ruoyi.system.service.THouseService;
 import com.ruoyi.system.vo.HouseVO;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -27,6 +28,7 @@
  * @author xiaochen
  * @since 2025-01-17
  */
+@Api(tags = "房屋基础信息管理")
 @RestController
 @RequestMapping("/t-house")
 public class THouseController {
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
index 310a24a..3475998 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -194,6 +194,21 @@
         return AjaxResult.success(sysUser);
     }
 
+    /**
+     * 获取用户详情
+     */
+    @ApiOperation(value = "获取用户详情")
+    @GetMapping("/queryDetail")
+    public AjaxResult queryDetail()
+    {
+        Long userId = tokenService.getLoginUser().getUserId();
+        SysUser sysUser = userService.selectUserById(userId);
+        SysUserVO sysUserVO = new SysUserVO();
+        BeanUtils.copyProperties(sysUser,sysUserVO);
+
+        return AjaxResult.success(sysUser);
+    }
+
 
     /**
      * 获取用户数量统计
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java b/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java
index ba521cd..9655c8e 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/model/THouse.java
@@ -87,5 +87,7 @@
     @ApiModelProperty(value = "房号")
     @TableField("room_number")
     private String roomNumber;
-
+    @ApiModelProperty(value = "租户类型 1月付 2季付 3年付")
+    @TableField(exist = false)
+    private String tenantType;
 }
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java b/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java
index 7ec52d0..1c9af7b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/model/TTenant.java
@@ -3,6 +3,8 @@
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
@@ -43,9 +45,9 @@
 
     @ApiModelProperty(value = "入住时间")
     @NotNull(message = "入住时间不能为空")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @TableField("checkIn_time")
-    private LocalDateTime checkinTime;
+    private LocalDate checkinTime;
 
     @ApiModelProperty(value = "租户属性")
     @TableField("tenant_attributes")
@@ -54,18 +56,6 @@
     @ApiModelProperty(value = "租户类型")
     @TableField("tenant_type")
     private Integer tenantType;
-
-    @ApiModelProperty(value = "租户楼栋")
-    @TableField("tenant_building")
-    private String tenantBuilding;
-
-    @ApiModelProperty(value = "房号")
-    @TableField("room_number")
-    private String roomNumber;
-
-    @ApiModelProperty(value = "建筑面积")
-    @TableField("building_area")
-    private Integer buildingArea;
 
     @ApiModelProperty(value = "联系电话")
     @NotBlank(message = "联系电话不能为空")
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/query/TTenantQuery.java b/ruoyi-system/src/main/java/com/ruoyi/system/query/TTenantQuery.java
index 28652a0..83e1748 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/query/TTenantQuery.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/query/TTenantQuery.java
@@ -11,7 +11,7 @@
 public class TTenantQuery extends BasePage {
 
     @ApiModelProperty(value = "租户姓名")
-    private String tenantName;
+    private String residentName;
 
     @ApiModelProperty(value = "联系电话")
     private String phone;
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index c0b58fa..7336905 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -137,7 +137,7 @@
 		left join sys_user_role ur on u.user_id = ur.user_id
 		left join sys_role sr on ur.role_id = sr.role_id
 		left join sys_dept sd on u.dept_id = sd.dept_id
-		where u.user_id = #{userId} and u.del_flag = 0 group by u.user_id
+		where u.user_id = #{userId} and u.del_flag = 0
 	</select>
 	
 	<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/TTenantMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TTenantMapper.xml
index 96f74cc..31b8911 100644
--- a/ruoyi-system/src/main/resources/mapper/system/TTenantMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/TTenantMapper.xml
@@ -9,9 +9,6 @@
         <result column="checkIn_time" property="checkinTime" />
         <result column="tenant_attributes" property="tenantAttributes" />
         <result column="tenant_type" property="tenantType" />
-        <result column="tenant_building" property="tenantBuilding" />
-        <result column="room_number" property="roomNumber" />
-        <result column="building_area" property="buildingArea" />
         <result column="phone" property="phone" />
         <result column="id_card" property="idCard" />
         <result column="email" property="email" />
@@ -28,18 +25,18 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, resident_name, checkIn_time, tenant_attributes, tenant_type, tenant_building, room_number, building_area, phone, id_card, email,
+        id, resident_name, checkIn_time, tenant_attributes, tenant_type, phone, id_card, email,
             bank_number, mail_address, create_time, update_time, create_by, update_by, disabled,account,password
     </sql>
     <select id="pageList" resultType="com.ruoyi.system.model.TTenant">
         SELECT <include refid="Base_Column_List"/>
         FROM t_tenant
         <where>
-            <if test="residentName != null and residentName != ''">
-                AND resident_name LIKE concat('%',#{residentName},'%')
+            <if test="query.residentName != null and query.residentName != ''">
+                AND resident_name LIKE concat('%',#{query.residentName},'%')
             </if>
-            <if test="phone != null and phone != ''">
-                AND phone LIKE concat('%',#{phone},'%')
+            <if test="query.phone != null and query.phone != ''">
+                AND phone LIKE concat('%',#{query.phone},'%')
             </if>
             AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
         </where>

--
Gitblit v1.7.1