From bda3bf8923acb5216f6f46b5d903cac24c842143 Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期六, 28 九月 2024 22:25:29 +0800
Subject: [PATCH] 1. 新增监测数据得分批量更新接口(待完成)

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt
index 2cb6d2f..6de4b92 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt
@@ -14,6 +14,8 @@
 import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep
 import cn.flightfeather.supervision.lightshare.service.UserinfoService
 import cn.flightfeather.supervision.lightshare.vo.AreaVo
+import cn.flightfeather.supervision.lightshare.vo.DataHead
+import com.github.pagehelper.PageHelper
 import org.springframework.beans.BeanUtils
 import org.springframework.stereotype.Service
 import tk.mybatis.mapper.entity.Example
@@ -69,6 +71,14 @@
 
     override fun delete(id: String): Int = userinfoMapper.deleteByPrimaryKey(id)
 
+    override fun search(areaVo: AreaVo, keyword: String, userType: Int?, page: Int?, perPage: Int?)
+            : Pair<DataHead, List<Userinfo?>> {
+        val p = PageHelper.startPage<Userinfo>(page ?: 1, perPage ?: 30)
+        val result = userInfoSVRep.searchUser(areaVo, keyword.trim(), Constant.UserType.fromValue(userType))
+        result.forEach { it?.password = null }
+        return DataHead(p.pageNum, p.pages, p.total) to result
+    }
+
     override fun createAccount(sceneId: String): Userinfo {
         findByScene(sceneId)?.let { return it }
 
@@ -116,7 +126,7 @@
         scence.let {
             // 鍒ゆ柇璇ュ満鏅槸鍚﹀凡鏈夊搴旇处鎴�
             val user = userInfoSVRep.findUser(it.guid)
-            if (user != null) return Userinfo()
+            if (user != null) return user
 
             val sceneName = it.name ?: return Userinfo()
             val uName = getUName(sceneName)

--
Gitblit v1.9.3