feiyu02
2025-09-18 baf2cc2ce3dfd1235c012a3750132769fcd9ad2f
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
@@ -45,9 +47,12 @@
        }
    }
    override fun findByType(typeId: Byte): List<Userinfo> {
    override fun findByType(typeId: Byte, enable: Boolean?): List<Userinfo> {
        val result = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
            createCriteria().andEqualTo("usertypeid", typeId)
                .apply {
                    enable?.let { andEqualTo("isenable", it) }
                }
        })
        return result
@@ -69,6 +74,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 }