短信+报名人员

This commit is contained in:
Paidax
2025-05-06 17:58:39 +08:00
parent 7038cc8eb4
commit 4742d0c4aa
9 changed files with 154 additions and 180 deletions
@@ -13,6 +13,8 @@ public class ClientActivitySignVO {
private Long activityId;
private String unitId;
private String unitName;
private String contactName;
@@ -105,6 +105,7 @@ public class ActUserController {
user.setId(actUser.getId());
}
user.setUserId(user.getUserId());
user.setUnitId(vo.getUnitId());
user.setSignUpTime(localDateTime);
user.setSignUpContacts(vo.getContactName());
user.setSignUpMobile(vo.getContactPhone());
@@ -115,6 +116,7 @@ public class ActUserController {
} else {
for (ActUser user : doSignUserList) {
user.setUserId(user.getUserId());
user.setUnitId(vo.getUnitId());
user.setSignUpTime(localDateTime);
user.setSignUpContacts(vo.getContactName());
user.setSignUpMobile(vo.getContactPhone());
@@ -134,6 +136,7 @@ public class ActUserController {
dao.insert(clientUser);
user.setUserId(clientUser.getId());
user.setUnitId(vo.getUnitId());
user.setSignUpTime(localDateTime);
user.setSignUpContacts(vo.getContactName());
user.setSignUpMobile(vo.getContactPhone());
@@ -171,8 +174,8 @@ public class ActUserController {
@At
@SaCheckPermission("activity.user")
public Result findSignUserInfo(String userId){
return Result.success(dao.fetch(ActUser.class, Cnd.where(ActUser::getUserId, "=", userId)));
public Result findSignUserInfo(String id){
return Result.success(dao.fetch(ActUser.class, Cnd.where(ActUser::getId, "=", id)));
}
@@ -15,6 +15,7 @@ import com.budwk.app.module.activity.service.ActivitySignInQueryService;
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
@@ -87,6 +88,17 @@ public class ActivitySignInQueryController {
}
@At
@SaCheckPermission("activity.signInUserQuery")
public Result doGrant(String id, Boolean isGrant) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
activitySignInQueryService.update(Chain.make("isGrant", isGrant), Cnd.where("id", "=", id));
return Result.success();
}
@At
@Ok("void")
@SaCheckPermission("activity.signInUserQuery")
@@ -70,6 +70,11 @@ public class ActUser extends BaseModel {
@ColDefine(type = ColType.VARCHAR, width = 30)
private String phone;
@Column
@Comment("参加单位Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unitId;
@Column
@Comment("参加单位名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
@@ -95,6 +100,12 @@ public class ActUser extends BaseModel {
@ColDefine(type = ColType.BOOLEAN)
private Boolean isStay;
@Column
@Comment("是否联系人")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean isContacts;
@Column
@Comment("是否签到")
@ColDefine(type = ColType.BOOLEAN)
@@ -105,4 +116,10 @@ public class ActUser extends BaseModel {
@Comment("签到时间")
@ColDefine(type = ColType.DATETIME)
private LocalDateTime signInTime;
@Column
@Comment("是否发放物资")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean isGrant;
}
@@ -1,5 +1,6 @@
package com.budwk.app.web.commons.ext.sms;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.exception.BaseException;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
@@ -48,20 +49,21 @@ public class SmsService {
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
SmsClient client = new SmsClient(cred, "", clientProfile);
SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
SendSmsRequest req = new SendSmsRequest();
String[] phoneNumberSet1 = {"+86" + mobile};
req.setPhoneNumberSet(phoneNumberSet1);
String[] templateParamSet1 = {text, "5"};
req.setTemplateParamSet(templateParamSet1);
req.setTemplateID(conf.get("sms.tencent.tpl.login_code"));
req.setSmsSdkAppid(conf.get("sms.tencent.appid"));
req.setSign(conf.get("sms.tencent.sign"));
req.setTemplateID(conf.get("sms.tencent.tpl.login_code"));
String[] phoneNumberSet1 = {"+86" + mobile};
req.setPhoneNumberSet(phoneNumberSet1);
String[] templateParamSet1 = {text};
req.setTemplateParamSet(templateParamSet1);
SendSmsResponse resp = client.SendSms(req);
log.debug(SendSmsResponse.toJsonString(resp));
return true;
} catch (TencentCloudSDKException tencentCloudSDKException) {
log.error(String.valueOf(tencentCloudSDKException));
throw new BaseException(tencentCloudSDKException.getMessage());
}
}
@@ -86,12 +88,12 @@ public class SmsService {
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
SmsClient client = new SmsClient(cred, "", clientProfile);
SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
SendSmsRequest req = new SendSmsRequest();
String[] phoneNumberSet1 = {"+86" + mobile};
req.setPhoneNumberSet(phoneNumberSet1);
String[] templateParamSet1 = {text, "5"};
String[] templateParamSet1 = {text};
req.setTemplateParamSet(templateParamSet1);
req.setTemplateID(conf.get("sms.tencent.tpl.reg_code"));
req.setSmsSdkAppid(conf.get("sms.tencent.appid"));
@@ -126,7 +128,7 @@ public class SmsService {
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
SmsClient client = new SmsClient(cred, "", clientProfile);
SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
SendSmsRequest req = new SendSmsRequest();
req.setPhoneNumberSet(mobile);
+6 -6
View File
@@ -23,7 +23,7 @@ jetty:
#结合ftp使用,或用nginx代理ftp路径
#staticPath: E:/project/NutzWk/upload
#开发模式静态资源
staticPathLocal: E:/project/company/hmc_gbhd/src/main/resources/static
staticPathLocal: G:/project/hmc_gbhd/src/main/resources/static
security:
tokenName: token
@@ -35,7 +35,7 @@ security:
isShare: true
redis:
host: 192.168.21.207
host: 127.0.0.1
port: 6379
timeout: 2000
max_redir: 10
@@ -69,7 +69,7 @@ xsssql:
beetl:
RESOURCE:
#本地路径,开发时设置本地路径,便于调试
rootLocal: E:/project/company/hmc_gbhd/src/main/resources/views/
rootLocal: G:/projects/hmc_gbhd/src/main/resources/views/
root: views/
DELIMITER_STATEMENT_START: '<!--#'
DELIMITER_STATEMENT_END: '#-->'
@@ -147,11 +147,11 @@ swagger:
description: 趣味运动会系统
sms:
enabled: false
enabled: true
#腾讯云短信配置
tencent:
secret-id: 1301383032
secret-key: AKIDMZWDepjNnxqSotiHZeU6SYOyIMAj24rO
secret-id: AKID3vYx5xYu0pVwDIAm9F4ey74mEPJwJQGp
secret-key: LPDl5AyV4NQM3TdW9VaOvCE0VkjSu5zc
appid: 1400934413 #应用ID
sign: '武汉地大三思科技' #短信签名
tpl:
@@ -62,6 +62,18 @@ layout("/layouts/platform_1.html"){
<el-table-column label="联系方式" prop="mobile"></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="isGrant">
<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>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
@@ -82,6 +94,24 @@ layout("/layouts/platform_1.html"){
}
},
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)
}
})
},
doExport() {
window.open("/platform/activity/signInUserQuery/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
},
@@ -111,4 +141,4 @@ layout("/layouts/platform_1.html"){
<!--#
}
#-->
#-->
@@ -39,6 +39,20 @@ layout("/layouts/platform_1.html"){
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位</div>
<div class="search-item-option">
<el-select placeholder="请选择所属单位"
style="width: 100%;" clearable
@change="setModifyFormUnit"
v-model="modifyForm.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>
</div>
@@ -62,8 +76,8 @@ layout("/layouts/platform_1.html"){
<el-table-column label="报名时间" prop="signUpTime"></el-table-column>
<el-table-column label="操作" fixed="right" width="250">
<template #default="scope">
<el-button type="text" @click="openModify">修改</el-button>
<el-button type="text" class="text-danger" @click="onTableRowDelete(scope.row.id)">删除</el-button>
<el-button type="primary" size="mini" @click="openModify(scope.row)">修改</el-button>
<el-button type="danger" size="mini" @click="doRemove(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -76,7 +90,14 @@ layout("/layouts/platform_1.html"){
<el-input v-model="formData.activityName" readonly></el-input>
</el-form-item>
<el-form-item label="参加单位" prop="unitName">
<el-input v-model="formData.unitName" placeholder="请输入参加单位"></el-input>
<el-select placeholder="请选择所属单位"
style="width: 100%;" clearable
@change="setFormDataUnit"
v-model="formData.unitId">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
<!-- <el-input v-model="formData.unitName" placeholder="请输入参加单位"></el-input>-->
</el-form-item>
<el-form-item label="联系人" prop="contactName">
<el-input v-model="formData.contactName" placeholder="请输入联系人"></el-input>
@@ -175,7 +196,14 @@ layout("/layouts/platform_1.html"){
<el-input v-model="modifyForm.position"></el-input>
</el-form-item>
<el-form-item label="所属单位" prop="unitName">
<el-input v-model="modifyForm.unitName"></el-input>
<el-select placeholder="请选择所属单位"
style="width: 100%;" clearable
@change="setModifyFormUnit"
v-model="modifyForm.unitId">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
<!-- <el-input v-model="modifyForm.unitName"></el-input>-->
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -265,9 +293,40 @@ layout("/layouts/platform_1.html"){
contactPhone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
userList: [{required: true, message: '请添加报名人员', trigger: ['blur', 'change']}]
},
units: [],
}
},
methods: {
setFormDataUnit(val) {
if (!val) {
this.formData.unitName = ''
return
}
this.formData.unitName = this.units.find(item => item.id === this.formData.unitId).name
},
setModifyFormUnit(val) {
if (!val) {
this.modifyForm.unitName = ''
return
}
this.modifyForm.unitName = this.units.find(item => item.id === this.modifyForm.unitId).name
},
doRemove(id) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post('/platform/activity/user/doDeleteActUser', {id})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.warning('操作失败')
}
})
},
doExport() {
window.open("/platform/activity/user/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
},
@@ -390,10 +449,17 @@ layout("/layouts/platform_1.html"){
this.$set(this.pageForm, 'activityId', '')
}
this.pageData()
},
async getUnits(){
const resp = await $.post('/open/common/units')
if (resp.code === 0) {
this.units = resp.data
}
}
},
created() {
this.getActivityList()
this.getUnits()
}
})
</script>