| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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 } |
| | |
| | | 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) |