Conflicts:
	backend/src/main/resources/application.yaml
	frontend/vite.config.js
This commit is contained in:
zhengziru
2025-05-06 20:31:52 +08:00
31 changed files with 573 additions and 338 deletions
@@ -67,9 +67,8 @@ public class ClientAuthController {
@ApiOperation(value = "注册", nickname = "/register", httpMethod = "POST")
public Result register(ClientRegisterBody registerBody) {
try {
// String token = clientAuthService.doRegister(registerBody);
// return Result.success().addData(token);
return Result.success();
String token = clientAuthService.doRegister(registerBody);
return Result.success().addData(token);
} catch (Exception e) {
log.error(e.getMessage(), e);
return Result.error(e.getMessage());
@@ -130,6 +129,7 @@ public class ClientAuthController {
@SaCheckLogin(type = StpClientUtil.TYPE)
public Result info() {
Client_user user = dao.fetch(Client_user.class, StpClientUtil.STP.getLoginIdAsLong());
dao.fetchLinks(user, "unit");
return Result.success(user);
}
@@ -1,6 +1,7 @@
package com.budwk.app.client.auth.models;
import com.budwk.app.base.model.BaseModel;
import com.budwk.app.sys.models.Sys_unit;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
@@ -62,4 +63,7 @@ public class Client_user extends BaseModel implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 255)
@Comment("openId")
private String openId;
@One(field = "unitId")
private Sys_unit unit;
}
@@ -49,12 +49,14 @@ public class ClientActivityController {
t1.endTime,
t1.signStartTime,
t1.signEndTime,
t1.coHostUnit,
t1.cover
FROM
activity t1
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(Cnd.likeEX("t1.title", pageForm.getSearchKeyword()));
sql.setCondition(cnd);
Pagination pagination = clientActivityService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
@@ -92,7 +94,10 @@ public class ClientActivityController {
SqlExpressionGroup group = new SqlExpressionGroup();
group.or(ActUser::getUserId, "=", StpClientUtil.STP.getLoginIdAsLong());
group.or(ActUser::getSignUpUserId, "=", StpClientUtil.STP.getLoginIdAsLong());
List<ActUser> list = dao.query(ActUser.class, Cnd.where(ActUser::getActivityId, "=", activityId).and(group));
ActUser actUser = dao.fetch(ActUser.class, Cnd.where(ActUser::getActivityId, "=", activityId).and(group));
List<ActUser> list = dao.query(ActUser.class, Cnd.where(ActUser::getActivityId, "=", activityId)
.and(ActUser::getSignUpUserId, "=", actUser.getSignUpUserId()));
return Result.success(list);
}
@@ -47,6 +47,9 @@ public class ClientActivityServiceImpl extends BaseServiceImpl<Activity> impleme
public void signUp(ClientActivitySignVO signVO) {
LocalDateTime now = LocalDateTime.now();
Client_user selfUser = dao().fetch(Client_user.class, StpClientUtil.STP.getLoginIdAsLong());
dao().fetchLinks(selfUser, "unit");
List<ActUser> userList = signVO.getUserList();
// 首先检查报名人员是否已经在用户表中
for (ActUser user : userList) {
@@ -58,6 +61,7 @@ public class ClientActivityServiceImpl extends BaseServiceImpl<Activity> impleme
clientUser.setSex(user.getSex());
clientUser.setPhone(user.getPhone());
clientUser.setIdCard(user.getIdCard());
clientUser.setUnitId(selfUser.getUnitId());
dao().insert(clientUser);
} else {
// 验证用户之前是不是已经报名 别人帮报 自己报 管理员报
@@ -71,6 +75,7 @@ public class ClientActivityServiceImpl extends BaseServiceImpl<Activity> impleme
user.setActivityId(signVO.getActivityId());
user.setUserId(clientUser.getId());
user.setUnitId(selfUser.getUnitId());
user.setUnitName(signVO.getUnitName());
user.setSignUpContacts(signVO.getContactName());
user.setSignUpMobile(signVO.getContactPhone());
@@ -12,6 +12,7 @@ import java.util.List;
public class ClientActivitySignVO {
private Long activityId;
private Long itemId;
private String unitId;
@@ -223,6 +223,7 @@ public class ActUserController {
add(new ExcelExportEntity("职务", "position", 20));
add(new ExcelExportEntity("所属单位", "unitName", 20));
add(new ExcelExportEntity("报名时间", "signUpTime2", 20));
add(new ExcelExportEntity("是否签到", "isSignInDesc", 20));
}};
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + new String((activity.getTitle() + "报名数据表.xlsx").getBytes(StandardCharsets.UTF_8), "ISO8859-1"));
@@ -79,9 +79,10 @@ public class ActivityItemApplyQueryController {
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.or("au.userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
group.or("au.unitName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
group.or("au.phone", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(group);
}
cnd.andEX("au.unitId","=",pageForm.getUnitId());
cnd.and("au.activityId", "=", pageForm.getActivityId());
cnd.andEX("aiu.itemId", "=", pageForm.getItemId());
cnd.asc("ai.`name`");
@@ -76,9 +76,12 @@ public class ActivitySignInQueryController {
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.or("au.userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
group.or("au.unitName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
group.or("au.phone", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(group);
}
cnd.andEX("au.unitId","=",pageForm.getUnitId());
cnd.andEX("au.isStay","=",pageForm.getIsStay());
cnd.andEX("au.isGrant","=",pageForm.getIsGrant());
cnd.and("au.activityId", "=", pageForm.getActivityId());
cnd.and("au.isSignIn", "=", 1);
cnd.desc("au.signInTime");
@@ -109,7 +112,15 @@ public class ActivitySignInQueryController {
Sql sql = Sqls.create("""
SELECT
au.*,
DATE_FORMAT(signInTime, '%Y-%m-%d %H:%i:%s') signInTime
DATE_FORMAT(signInTime, '%Y-%m-%d %H:%i:%s') signInTime,
CASE au.isStay
WHEN 1 THEN '住宿'
WHEN 0 THEN '不住宿'
END AS isStayDesc,
CASE au.isGrant
WHEN 1 THEN '已发放'
WHEN 0 THEN '未发放'
END AS isGrantDesc
FROM
`act_user` au
$condition
@@ -117,9 +128,12 @@ public class ActivitySignInQueryController {
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.or("au.userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
group.or("au.unitName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
group.or("au.phone", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(group);
}
cnd.andEX("au.isStay","=",pageForm.getIsStay());
cnd.andEX("au.isGrant","=",pageForm.getIsGrant());
cnd.andEX("au.unitId","=",pageForm.getUnitId());
cnd.and("au.activityId", "=", pageForm.getActivityId());
cnd.and("au.isSignIn", "=", 1);
cnd.desc("au.signInTime");
@@ -132,7 +146,9 @@ public class ActivitySignInQueryController {
add(new ExcelExportEntity("身份证号码", "idCard", 20));
add(new ExcelExportEntity("联系方式", "mobile", 20));
add(new ExcelExportEntity("参加单位名称", "unitName", 20));
add(new ExcelExportEntity("签到时间", "signUpTime2", 20));
add(new ExcelExportEntity("签到时间", "signInTime", 20));
add(new ExcelExportEntity("是否住宿", "isStayDesc", 20));
add(new ExcelExportEntity("物资发放", "isGrantDesc", 20));
}};
response.setContentType("application/octet-stream");
@@ -39,6 +39,10 @@ public class ActUserServiceImpl extends BaseServiceImpl<ActUser> implements ActU
SELECT
u.*,
DATE_FORMAT(signUpTime, '%Y-%m-%d %H:%i:%s') signUpTime2,
CASE u.isSignIn
WHEN 1 THEN '已签到'
WHEN 0 THEN '未签到'
END AS isSignInDesc,
act.`title` AS activityName
FROM
act_user u
@@ -53,13 +57,8 @@ public class ActUserServiceImpl extends BaseServiceImpl<ActUser> implements ActU
seg.orLike("u.phone", pageForm.getSearchKeyword());
cnd.and(seg);
}
if (pageForm.getIsSignIn() != 1) {
cnd.andEX("u.isSignIn", "=", pageForm.getIsSignIn() == 2 ? 1 : 0);
}
// cnd.andEX("u.phone", "like", "%" + pageForm.getPhone() + "%");
if (StrUtil.isNotBlank(pageForm.getUnitName())) {
cnd.and("u.unitName", "like", "%" + pageForm.getUnitName() + "%");
}
cnd.andEX("u.isSignIn", "=", pageForm.getIsSignIn());
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
sql.setCondition(cnd);
return sql;
}
@@ -23,5 +23,11 @@ public class ActSignInUserPageForm extends PageForm {
// 所属单位
private String unitName;
// 发放状态
private Integer isGrant;
// 单位
private Integer unitId;
// 是否住宿
private Integer isStay;
}
@@ -23,6 +23,8 @@ public class ActUserPageForm extends PageForm {
// 所属单位
private String unitName;
// 是否签到1.全部2.已签到3.未签到
// 所属单位
private String unitId;
// 是否签到
private Integer isSignIn;
}
File diff suppressed because one or more lines are too long
@@ -37,6 +37,8 @@
<script src="${base!}/assets/platform/plugins/adminLte/adminlte.min.js"></script>
<!-- echarts -->
<script src="${base!}/assets/platform/plugins/echarts/echarts.min.js"></script>
<!-- qrcode -->
<script src="${base!}/assets/platform/plugins/qrcode/qrcode.min.js"></script>
<!-- 自定义工具类 -->
<script src="${base!}/assets/platform/module/mixins/initTableMixins.js?v=1.0.0"></script>
<!-- main -->
@@ -46,14 +46,28 @@ layout("/layouts/platform_1.html"){
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名/单位</div>
<div class="search-item-label">姓名/电话</div>
<div class="search-item-option">
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名/单位"></el-input>
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名/电话"></el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位</div>
<div class="search-item-option">
<el-select placeholder="请选择所属单位"
style="width: 100%;" clearable
filterable
@change="setModifyFormUnit"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
<el-button type="primary" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
@@ -72,7 +86,7 @@ layout("/layouts/platform_1.html"){
<el-table-column label="性别" prop="sex"width="150"></el-table-column>
<el-table-column label="职务" prop="position"></el-table-column>
<el-table-column label="身份证号码" prop="idCard"></el-table-column>
<el-table-column label="联系方式" prop="mobile"></el-table-column>
<el-table-column label="联系方式" prop="phone"></el-table-column>
<el-table-column label="参加单位名称" prop="unitName"></el-table-column>
<el-table-column label="参加项目" prop="itemName"></el-table-column>
</el-table>
@@ -92,7 +106,8 @@ layout("/layouts/platform_1.html"){
year: new Date().getFullYear() + ""
},
activityOptions: [],
activityItemOptions: []
activityItemOptions: [],
units: [],
}
},
methods: {
@@ -126,9 +141,16 @@ layout("/layouts/platform_1.html"){
})
},
async getUnits(){
const resp = await $.post('/open/common/units')
if (resp.code === 0) {
this.units = resp.data
}
}
},
created() {
this.getActivityOptions()
this.getUnits()
}
})
</script>
@@ -0,0 +1,62 @@
const actQrCode = {
template: /*language=HTML*/ `
<el-dialog title="二维码" :visible.sync="visible" width="500px">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="活动报名二维码" name="signUp">
<div id="signUpCode" style="width:150px; height:150px;margin: 0 auto"></div>
</el-tab-pane>
<el-tab-pane label="活动签到二维码" name="signIn">
<div id="signInCode" style="width:150px; height:150px;margin: 0 auto"></div>
</el-tab-pane>
</el-tabs>
<template #footer>
<span class="dialog-footer">
<el-button size="small" @click="visible = false">取 消</el-button>
<el-button size="small" type="primary" @click="download">下载</el-button>
</span>
</template>
</el-dialog>
`,
data() {
return {
visible: false,
actId: "",
activeName: "signUp"
}
},
methods: {
handleClick(tab, event) {
},
onOpen(id) {
this.visible = true
this.actId = id
this.$nextTick(() => {
this.renderCode()
})
},
renderCode() {
let signUpCode = new QRCode(document.getElementById("signUpCode"), {
width: 150,
height: 150
})
signUpCode.makeCode("https://192.168.41.118:5173" + "/pages/activity/detail/index?id=" + this.actId)
let signInCode = new QRCode(document.getElementById("signInCode"), {
width: 150,
height: 150
})
signInCode.makeCode("https://192.168.41.118:5173" + "/pages/activity/scan-sign/index?id=" + this.actId)
},
download() {
// 获取base64
const src = $("#" + this.activeName + "Code img").attr("src")
// 利用a标签进行下载
const a = document.createElement("a")
a.href = src
a.download = (this.activeName === "signUp" ? "报名" : "签到") + "二维码.png"
a.click()
a.remove()
}
}
}
@@ -37,6 +37,7 @@ layout("/layouts/platform_1.html"){
<el-table-column label="活动结束时间" prop="endTime"></el-table-column>
<el-table-column label="操作" fixed="right" width="250">
<template #default="scope">
<el-button type="text" @click="$refs.actQrCodeRef.onOpen(scope.row.id)">二维码</el-button>
<el-button type="text" @click="$refs.addOrUpdateRef.onOpen(scope.row.id)">修改</el-button>
<el-button type="text" @click="$refs.itemFormRef.onOpen(scope.row.id)">项目管理</el-button>
<el-button type="text" class="text-danger" @click="onTableRowDelete(scope.row.id)">删除</el-button>
@@ -47,17 +48,20 @@ layout("/layouts/platform_1.html"){
</el-card>
<add-or-update ref="addOrUpdateRef" @refresh="doSearch"></add-or-update>
<item-form ref="itemFormRef"></item-form>
<act-qr-code ref="actQrCodeRef"></act-qr-code>
</div>
<script>
<!--#include('addOrUpdate.js'){}#-->
<!--#include('itemForm.js'){}#-->
<!--#include('actQrCode.js'){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"add-or-update": addOrUpdate,
"item-form": itemForm
"item-form": itemForm,
"act-qr-code": actQrCode
},
data() {
return {
@@ -33,9 +33,39 @@ layout("/layouts/platform_1.html"){
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名/单位</div>
<div class="search-item-label">发放状态</div>
<div class="search-item-option">
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名/单位"></el-input>
<el-select v-model="pageForm.isGrant" placeholder="请选择发放状态" clearable>
<el-option label="已发放" :value="1"></el-option>
<el-option label="未发放" :value="0"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">住宿状态</div>
<div class="search-item-option">
<el-select v-model="pageForm.isStay" placeholder="请选择住宿状态" clearable>
<el-option label="住宿" :value="1"></el-option>
<el-option label="不住宿" :value="0"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名/电话</div>
<div class="search-item-option">
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名/电话"></el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位</div>
<div class="search-item-option">
<el-select placeholder="请选择所属单位"
style="width: 100%;" clearable
filterable
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</div>
</div>
@@ -47,7 +77,7 @@ layout("/layouts/platform_1.html"){
<el-card shadow="never" class="mt-3">
<el-row type="flex" class="mb-3" style="justify-content: flex-end">
<el-button icon="el-icon-plus" type="primary" size="small" @click="doExport">导出</el-button>
<el-button type="primary" size="small" @click="doExport">导出</el-button>
</el-row>
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
<el-table-column label="序号" prop="index" header-align="center" align="center" width="50">
@@ -59,21 +89,28 @@ layout("/layouts/platform_1.html"){
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="职务" prop="position"></el-table-column>
<el-table-column label="身份证号码" prop="idCard"></el-table-column>
<el-table-column label="联系方式" prop="mobile"></el-table-column>
<el-table-column label="联系方式" prop="phone"></el-table-column>
<el-table-column label="参加单位名称" prop="unitName"></el-table-column>
<el-table-column label="签到时间" prop="signInTime"></el-table-column>
<el-table-column label="是否住宿" prop="isStay">
<template slot-scope="{row}">
{{row.isStay?'住宿':'不住宿'}}
</template>
</el-table-column>
<el-table-column label="物资发放" prop="isGrant">
<template slot-scope="scope">
<template slot-scope="scope">
<el-tag v-if="scope.row.isGrant" type="success">已发放</el-tag>
<el-tag v-else type="danger">未发放</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200">
<template #default="{row}">
<el-button v-if="!row.isGrant || row.isGrant === 0" type="primary" size="mini" @click="doGrant(row, true)">设为已发放物资</el-button>
<el-button v-else type="danger" size="mini" @click="doGrant(row, false)">设为未发放物资</el-button>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200">
<template #default="{row}">
<el-button v-if="!row.isGrant || row.isGrant === 0" type="primary" size="mini"
@click="doGrant(row, true)">设为已发放物资
</el-button>
<el-button v-else type="danger" size="mini" @click="doGrant(row, false)">设为未发放物资</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
@@ -90,28 +127,29 @@ layout("/layouts/platform_1.html"){
pageForm: {
year: new Date().getFullYear() + ""
},
activityOptions: []
activityOptions: [],
units: [],
}
},
methods: {
async doGrant(row, isGrant) {
this.$confirm('您确定要设置成' + (isGrant ? '已发放' : '未发放') + '状态吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post("/platform/activity/signInUserQuery/doGrant", {
id: row.id,
isGrant: isGrant
})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
})
},
async doGrant(row, isGrant) {
this.$confirm('您确定要设置成' + (isGrant ? '已发放' : '未发放') + '状态吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post("/platform/activity/signInUserQuery/doGrant", {
id: row.id,
isGrant: isGrant
})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
})
},
doExport() {
window.open("/platform/activity/signInUserQuery/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
},
@@ -131,9 +169,16 @@ layout("/layouts/platform_1.html"){
})
},
async getUnits() {
const resp = await $.post('/open/common/units')
if (resp.code === 0) {
this.units = resp.data
}
}
},
created() {
this.getActivityOptions()
this.getUnits()
}
})
</script>