13 changed files with 231 additions and 101 deletions
+27 -4
View File
@@ -1,5 +1,28 @@
# Maven build output is generated locally and must not be versioned.
/target/
# Maven build output
target/
*.class
# IDEA workspace settings belong to the local developer environment.
/.idea/workspace.xml
# IDE settings
.idea/
*.iml
*.ipr
*.iws
.vscode/
.classpath
.project
.settings/
target
# Logs and temporary files
*.log
/logs/
/temp/
/tmp/
*.tmp
*.swp
*.swo
*~
# Operating system files
.DS_Store
Thumbs.db
Desktop.ini
-14
View File
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="mini" />
</profile>
</annotationProcessing>
</component>
</project>
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>
-30
View File
@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="nutz-snapshots" />
<option name="name" value="nutz-snapshots" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
<remote-repository>
<option name="id" value="nutz" />
<option name="name" value="nutz" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
</component>
</project>
-25
View File
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" default="true" project-jdk-name="15" project-jdk-type="JavaSDK" />
<component name="SvnBranchConfigurationManager">
<option name="myConfigurationMap">
<map>
<entry key="$PROJECT_DIR$">
<value>
<SvnBranchConfiguration>
<option name="trunkUrl" value="http://28bq156916.qicp.vip/svn/UNION_NJUST" />
</SvnBranchConfiguration>
</value>
</entry>
</map>
</option>
</component>
</project>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>
Generated
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
@@ -121,11 +121,12 @@ public class MemberMobileController {
@ViReturn
@RequiresRoles(value = {"H04", "A06"}, logical = Logical.OR)
public Object viewInfo(String id) {
// 用户表仅存储出生日期,按当前日期计算周岁,空出生日期返回空年龄。
Sql sql = Sqls.create("""
SELECT
u.username,
u.sex,
u.age,
TIMESTAMPDIFF(YEAR, NULLIF(u.birthday, ''), CURDATE()) AS age,
u.nation,
u.education,
u.political,
@@ -277,7 +277,7 @@ public class MTrainSignUpActivityController {
if(signFullByUnionId) {
return Result.error("该活动您所在的分工会名额已报满");
}
if(course.getReserveMode() == 2 && currentFamilyNumber == null) {
if(Integer.valueOf(2).equals(course.getReserveMode()) && currentFamilyNumber == null) {
//课程已报人数
List<TrainSignUpUser> signUpUsers = dao.query(TrainSignUpUser.class, Cnd.where("courseId", "=", courseId));
int hasRegisterNum = signUpUsers.size() + 1;//+1是算自己
@@ -336,7 +336,7 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
TrainSignUpActivity activity = dao().fetch(TrainSignUpActivity.class, Cnd.where("id", "=", course.getActivityId()));
//如果这个课程的预留名额方式为报名人数不变
if (course.getReserveMode() == 2) {
if (Integer.valueOf(2).equals(course.getReserveMode())) {
//如果当前报名+已报小于这个课程限制人数
//课程已报人数
List<TrainSignUpUser> signUpUsers = dao().query(TrainSignUpUser.class, Cnd.where("courseId", "=", trainSignUpUser.getCourseId()));
@@ -487,7 +487,7 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
hasFamilyNum = num.get() + (currentFamilyNumber != null ? currentFamilyNumber : 0);//currentFamilyNumber是当前报名时填的家属人数
}
//如果预留名额模式是报名人数减少
if (course.getReserveMode() == 1) {
if (course.getReserveMode() == null || course.getReserveMode() == 1) {
//如果已报人数+预留人数+当前报名(自己)+家属 > 总人数
return (hasRegisterNum + course.getCourseReservedNumber() + hasFamilyNum) > coursePeopleNumber;
} else {//如果预留名额模式是报名人数不变
@@ -0,0 +1,4 @@
update sys_app_menu set moduleId = '282ea934ff624b7b9e279eab85a8ce39'
where moduleId = '956eeb9432424dbab7f1cd46950f228d';
delete from sys_app_module where moduleId = '956eeb9432424dbab7f1cd46950f228d';
@@ -0,0 +1,194 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.member-query-header {
position: sticky;
top: 0;
z-index: 10;
background-color: #fff;
}
.member-query-list {
padding: 10px 0 20px;
}
.member-query-count {
padding: 0 16px 10px;
color: #969799;
font-size: 13px;
}
.member-query-detail {
height: 85%;
padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box;
}
.member-query-detail .van-cell__value,
.member-query-list .van-cell__value {
overflow-wrap: anywhere;
white-space: pre-wrap;
}
.member-query-loading {
padding: 40px 0;
text-align: center;
}
</style>
<div id="app" v-cloak>
<div class="member-query-header">
<van-nav-bar title="会员查询" left-arrow placeholder fixed
@click-left="location.replace('/mobile/index')"></van-nav-bar>
<form action="/mobile/member/query" @submit.prevent="doSearch">
<van-search v-model="keyword" placeholder="请输入姓名或工号" label="会员" show-action
@search="doSearch" @clear="doSearch">
<template #action>
<van-button type="primary" size="small" native-type="button" @click="doSearch">搜索</van-button>
</template>
</van-search>
</form>
</div>
<div class="member-query-list">
<div v-if="tableData.length" class="member-query-count">共 {{pageForm.totalCount}} 位会员</div>
<van-list v-model="loading" :finished="finished" :error.sync="loadError"
error-text="加载失败,点击重试" :finished-text="tableData.length ? '没有更多了' : ''"
:immediate-check="false" @load="onLoad">
<div v-for="o in tableData" :key="o.id" class="list-card">
<van-cell-group inset>
<van-cell :border="false" title="姓  名">{{o.username || '—'}}</van-cell>
<van-cell :border="false" title="工  号">{{o.loginname || '—'}}</van-cell>
<van-cell :border="false" title="所在工会">{{o.unionname || '—'}}</van-cell>
<van-cell :border="false" title="所在单位">{{o.unitname || '—'}}</van-cell>
<van-cell :border="false" title="人员类型">{{o.personType || '—'}}</van-cell>
</van-cell-group>
<van-cell title="查看会员详情" is-link clickable @click="openView(o)"></van-cell>
</div>
</van-list>
<van-empty v-if="!loading && !loadError && finished && tableData.length === 0"
image="/none.svg" description="暂无符合条件的会员"></van-empty>
</div>
<van-popup v-model="showDetail" position="bottom" round class="member-query-detail">
<van-nav-bar title="会员详情" left-arrow @click-left="showDetail = false"></van-nav-bar>
<div v-if="detailLoading" class="member-query-loading">
<van-loading size="24px" vertical>加载中...</van-loading>
</div>
<van-empty v-else-if="detailError" description="详情加载失败">
<van-button type="primary" size="small" @click="openView(selectedMember)">重试</van-button>
</van-empty>
<van-cell-group v-else-if="memberInfo">
<van-cell title="姓名" :value="memberInfo.username || '—'"></van-cell>
<van-cell title="性别" :value="memberInfo.sex || '—'"></van-cell>
<van-cell title="年龄" :value="memberInfo.age == null ? '—' : memberInfo.age"></van-cell>
<van-cell title="民族" :value="memberInfo.nation || '—'"></van-cell>
<van-cell title="学历" :value="memberInfo.education || '—'"></van-cell>
<van-cell title="政治面貌" :value="memberInfo.political || '—'"></van-cell>
<van-cell title="职称" :value="memberInfo.jobTitle || '—'"></van-cell>
<van-cell title="职务" :value="memberInfo.position || '—'"></van-cell>
<van-cell title="所在单位" :value="memberInfo.unitname || '—'"></van-cell>
<van-cell title="个人简历" :value="memberInfo.vita || '—'"></van-cell>
</van-cell-group>
<van-empty v-else description="暂无会员详情"></van-empty>
</van-popup>
</div>
<script>
// 复用移动端会员接口,在查询页内查看详情,保持与查询入口一致的角色权限。
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
keyword: '',
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: ''
},
loadError: false,
requestId: 0,
pending: false,
showDetail: false,
detailLoading: false,
detailError: false,
detailRequestId: 0,
selectedMember: null,
memberInfo: null
}
},
methods: {
doSearch() {
// 新搜索使上一轮分页请求失效,避免较慢的旧响应混入新结果。
this.requestId++
this.pending = false
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.pageForm.searchKeyword = this.keyword.trim()
this.tableData = []
this.finished = false
this.loadError = false
this.onLoad()
},
async onLoad() {
if (this.pending || this.finished) return
const requestId = this.requestId
this.pending = true
this.loading = true
this.loadError = false
try {
const res = await $.post('/mobile/member/getMemberData', Object.assign({}, this.pageForm))
if (requestId !== this.requestId) return
if (res.code !== 0 || !res.data || !Array.isArray(res.data.list)) {
throw new Error('会员查询失败')
}
this.tableData = this.tableData.concat(res.data.list)
this.pageForm.totalCount = res.data.totalCount
this.finished = res.data.list.length === 0 || this.tableData.length >= res.data.totalCount
if (!this.finished) this.pageForm.pageNumber++
} catch (e) {
if (requestId === this.requestId) this.loadError = true
} finally {
if (requestId === this.requestId) {
this.pending = false
this.loading = false
}
}
},
async openView(member) {
if (!member || !member.id) {
this.$toast.fail('缺少会员信息')
return
}
const requestId = ++this.detailRequestId
this.selectedMember = member
this.memberInfo = null
this.showDetail = true
this.detailLoading = true
this.detailError = false
try {
const res = await $.get('/mobile/member/viewInfo', {id: member.id})
if (requestId !== this.detailRequestId) return
if (res.code !== 0) throw new Error('会员详情加载失败')
this.memberInfo = res.data
} catch (e) {
if (requestId === this.detailRequestId) this.detailError = true
} finally {
if (requestId === this.detailRequestId) this.detailLoading = false
}
}
},
created() {
this.doSearch()
}
})
</script>
<!--#
}
#-->
@@ -106,7 +106,7 @@ layout("/mobile/platform.html"){
@click-left="location.replace('/platform/mobile/trainSignUpActivity/trainList')"></van-nav-bar>
</van-sticky>
<van-image height="186" :src="CREATE_PREVIEW_URL(activity?.cover[0].id)"></van-image>
<van-image height="186" :src="activity.cover && activity.cover[0] ? CREATE_PREVIEW_URL(activity.cover[0].id) : ''"></van-image>
<div class="title">{{activity.activityName}}</div>
<van-tabs v-model:active="tabActive" shrink>