|
|
@ -82,7 +82,7 @@ object AccountService : AbstractService() { |
|
|
|
.md5() |
|
|
|
.md5() |
|
|
|
} |
|
|
|
} |
|
|
|
token.flush() |
|
|
|
token.flush() |
|
|
|
|
|
|
|
val associationMember=AssociationMember.find { AssociationMembers.userId eq matchUser.id }.firstOrNull() |
|
|
|
return@transaction UserVo( |
|
|
|
return@transaction UserVo( |
|
|
|
studentId = matchUser.studentId, token = |
|
|
|
studentId = matchUser.studentId, token = |
|
|
|
Token( |
|
|
|
Token( |
|
|
@ -91,8 +91,8 @@ object AccountService : AbstractService() { |
|
|
|
), name = matchUser.name, |
|
|
|
), name = matchUser.name, |
|
|
|
headImg = matchUser.headImg?.filepath, |
|
|
|
headImg = matchUser.headImg?.filepath, |
|
|
|
desc = matchUser.desc, |
|
|
|
desc = matchUser.desc, |
|
|
|
associationMemberVo = matchUser.associationMember?.let { |
|
|
|
associationVo = associationMember?.let { toAssociationVo(it.association) }, |
|
|
|
AssociationMemberVo(association = toAssociationVo(it.association),isHead = it.isHead) } |
|
|
|
isHead = associationMember?.isHead |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -118,6 +118,7 @@ object AccountService : AbstractService() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun tokenRes(token:UserToken,matchUser:User):UserVo{ |
|
|
|
private fun tokenRes(token:UserToken,matchUser:User):UserVo{ |
|
|
|
|
|
|
|
val associationMember=AssociationMember.find { AssociationMembers.userId eq matchUser.id }.firstOrNull() |
|
|
|
return UserVo( |
|
|
|
return UserVo( |
|
|
|
studentId = matchUser.studentId, token = |
|
|
|
studentId = matchUser.studentId, token = |
|
|
|
Token( |
|
|
|
Token( |
|
|
@ -125,8 +126,8 @@ object AccountService : AbstractService() { |
|
|
|
createTime = token.createTime.format() |
|
|
|
createTime = token.createTime.format() |
|
|
|
), name = matchUser.name, |
|
|
|
), name = matchUser.name, |
|
|
|
headImg = matchUser.headImg?.filepath, desc = matchUser.desc, |
|
|
|
headImg = matchUser.headImg?.filepath, desc = matchUser.desc, |
|
|
|
associationMemberVo = matchUser.associationMember?.let { |
|
|
|
associationVo = associationMember?.let { toAssociationVo(it.association) }, |
|
|
|
AssociationMemberVo(association = toAssociationVo(it.association),isHead = it.isHead) } |
|
|
|
isHead = associationMember?.isHead |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -396,7 +397,8 @@ object AssociationService : AbstractService() { |
|
|
|
this.log = log |
|
|
|
this.log = log |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
val association:Association?= AuditLogging.find { AuditLeggings.userId eq user.id }.firstOrNull()?.user?.associationMember?.association |
|
|
|
val associationMember=AssociationMember.find { AssociationMembers.userId eq regVo.id }.firstOrNull() |
|
|
|
|
|
|
|
val association:Association?= associationMember?.association |
|
|
|
when { |
|
|
|
when { |
|
|
|
association != null && association.log.result == true -> throw IllegalArgumentException("您是社团团长不能再创建其他社团") |
|
|
|
association != null && association.log.result == true -> throw IllegalArgumentException("您是社团团长不能再创建其他社团") |
|
|
|
association != null && association.log.result == null -> throw IllegalArgumentException("您已经提交过社团注册资料,请耐心等待后台管理员处理") |
|
|
|
association != null && association.log.result == null -> throw IllegalArgumentException("您已经提交过社团注册资料,请耐心等待后台管理员处理") |
|
|
@ -435,8 +437,8 @@ object AssociationService : AbstractService() { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun read(vo:OnlyToken):AssociationCheckVo?{ |
|
|
|
fun read(vo:OnlyToken):AssociationCheckVo?{ |
|
|
|
return transaction { |
|
|
|
return transaction { |
|
|
|
val association:Association?= AuditLogging.find { AuditLeggings.userId eq vo.token.id }.firstOrNull()?.user?.associationMember?.association |
|
|
|
val associationMember=AssociationMember.find { AssociationMembers.userId eq vo.token.id }.firstOrNull() |
|
|
|
return@transaction association?.let { |
|
|
|
return@transaction associationMember?.association?.let { |
|
|
|
AssociationCheckVo(id=it.id.value,name=it.name,desc=it.desc,logo = it.logo.filepath, |
|
|
|
AssociationCheckVo(id=it.id.value,name=it.name,desc=it.desc,logo = it.logo.filepath, |
|
|
|
faculty = AssociationFaculty.valueOf(it.faculty),level = it.level?.let { it1 -> |
|
|
|
faculty = AssociationFaculty.valueOf(it.faculty),level = it.level?.let { it1 -> |
|
|
|
AssociationLevel.valueOf( |
|
|
|
AssociationLevel.valueOf( |
|
|
@ -531,6 +533,12 @@ object AssociationService : AbstractService() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 社团审核 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param vo |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
fun loadAudit(vo: OnlyToken): List<DisposeRegInfoVo> { |
|
|
|
fun loadAudit(vo: OnlyToken): List<DisposeRegInfoVo> { |
|
|
|
return transaction { |
|
|
|
return transaction { |
|
|
|
return@transaction Association.all().map { |
|
|
|
return@transaction Association.all().map { |
|
|
@ -606,10 +614,10 @@ object AssociationService : AbstractService() { |
|
|
|
} |
|
|
|
} |
|
|
|
association.log.nextAudit!=null&&vo.result->{ |
|
|
|
association.log.nextAudit!=null&&vo.result->{ |
|
|
|
AssociationMember.new { |
|
|
|
AssociationMember.new { |
|
|
|
|
|
|
|
user=matchUser |
|
|
|
this.association=association |
|
|
|
this.association=association |
|
|
|
isHead=true |
|
|
|
isHead=true |
|
|
|
}.apply { |
|
|
|
}.apply { |
|
|
|
matchUser.associationMember=this |
|
|
|
|
|
|
|
this@AssociationService.log.info("初始化社团团长") |
|
|
|
this@AssociationService.log.info("初始化社团团长") |
|
|
|
} |
|
|
|
} |
|
|
|
Notification.new { |
|
|
|
Notification.new { |
|
|
@ -648,6 +656,12 @@ object AssociationService : AbstractService() { |
|
|
|
level = it.level?.let { AssociationLevel.valueOf(it) }) |
|
|
|
level = it.level?.let { AssociationLevel.valueOf(it) }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* 查询社团详情 |
|
|
|
|
|
|
|
* @param vo |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
fun load(vo:ShowAssociationVo): AssociationMainVo { |
|
|
|
fun load(vo:ShowAssociationVo): AssociationMainVo { |
|
|
|
return transaction { |
|
|
|
return transaction { |
|
|
|
val associationVo= (Association.findById(vo.id)?:throw AssociationIdError(vo.id)).let { |
|
|
|
val associationVo= (Association.findById(vo.id)?:throw AssociationIdError(vo.id)).let { |
|
|
@ -665,6 +679,30 @@ object AssociationService : AbstractService() { |
|
|
|
AssociationMainVo(associationVo = associationVo,head = head) |
|
|
|
AssociationMainVo(associationVo = associationVo,head = head) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 加载社团成员 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param vo |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
fun load(vo:QueryAssociationMembers):List<UserInfoVo>{ |
|
|
|
|
|
|
|
return transaction { |
|
|
|
|
|
|
|
Users.innerJoin(AssociationMembers).innerJoin(Associations) |
|
|
|
|
|
|
|
.slice(Users.columns) |
|
|
|
|
|
|
|
.select { |
|
|
|
|
|
|
|
vo.name.let { |
|
|
|
|
|
|
|
if(it==null||it.isEmpty()) |
|
|
|
|
|
|
|
Associations.id eq vo.id |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
Associations.id eq vo.id and (Users.name like "%${vo.name}%") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}.map { |
|
|
|
|
|
|
|
UserInfoVo(name=it[Users.name],headImg = it[Users.imgId]?.let { ImageFile.findById(it) }?.filepath, |
|
|
|
|
|
|
|
desc=it[Users.desc]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|