diff --git a/backend/application.yaml b/backend/application.yaml deleted file mode 100644 index 4ac4425..0000000 --- a/backend/application.yaml +++ /dev/null @@ -1,158 +0,0 @@ -nutz: - application: - name: budwk-v5-mini-plus - mvc: - ignore: ^(.+[.])(jsp|png|gif|jpg|js|css|jspx|jpeg|html|mp3|mp4|ico|svg|vue)$ - exclusions: /favicon/*,/assets/*,/druid/*,/upload/* -server: - port: 9090 - host: 0.0.0.0 - -jetty: - contextPath: / - threadpool: - idleTimeout: 60000 - minThreads: 10 - maxThreads: 200 - gzip: - enable: true - page: - 403: /error/403.html - 404: /error/404.html - 500: /error/500.html - #结合ftp使用,或用nginx代理ftp路径 - #staticPath: E:/project/NutzWk/upload - #开发模式静态资源 - staticPathLocal: E:/project/company/hmc_gbhd/src/main/resources/static - -security: - tokenName: token - timeout: 3600 - # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) - # 允许同一账号并发登录,则系统参数 SessionOnlyOne 有效,亦可踢人下线并多了弹框提示功能 - isConcurrent: true - # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) - isShare: true - -redis: - host: 192.168.21.207 - port: 6379 - timeout: 2000 - max_redir: 10 - database: 10 - maxTotal: 150 - pool: - maxTotal: 150 - maxIdle: 50 - minIdle: 10 - #password: test123 - mode: - normal - #cluster - #nodes=192.168.6.31:6377,192.168.6.31:6378,192.168.6.28:6377,192.168.6.28:6378,192.168.6.34:6377,192.168.6.34:6378 - -jdbc: - url: jdbc:mysql://192.168.21.207:3306/hmc_gbhd?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true - username: root - password: root - validationQuery: select 1 - maxActive: 150 - testWhileIdle: true - connectionProperties: druid.stat.slowSqlMillis=2000 - defaultAutoCommit: true - - -xsssql: - ignore: - urls: /platform/cms/content/article/addDo,/platform/sys/app/conf/addDo,/platform/sys/app/conf/editDo - -beetl: - RESOURCE: - #本地路径,开发时设置本地路径,便于调试 - rootLocal: E:/project/company/hmc_gbhd/src/main/resources/views/ - root: views/ - DELIMITER_STATEMENT_START: '' - FT: - #用法: ${"wizzer",escape} - escape: com.budwk.app.web.commons.ext.beetl.HtmlEscapeFormat - #用法: ${10241024,filesize} - filesize: com.budwk.app.web.commons.ext.beetl.FileSizeFormat - #用法: ${"",html2txt="100"} 截取100字符 - html2txt: com.budwk.app.web.commons.ext.beetl.Html2TxtFormat - #用法: ${"",strlen="100"} 截取100字符 - strlen: com.budwk.app.web.commons.ext.beetl.StrlenFormat - -#============================================================== -#Configure Main Scheduler Properties -#============================================================== -#quartz延迟启动秒数 -quartz: - startupDelay: 10 - scheduler: - instanceName: defaultScheduler - instanceId: AUTO - #============================================================== - #Skip Check Update - #update:true - #not update:false - #============================================================== - skipUpdateCheck: true - #============================================================== - #Configure JobStore isClustered=启用集群模式 - #============================================================== - jobStore: - class: org.quartz.impl.jdbcjobstore.JobStoreTX - driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate - #driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate - #driverDelegateClass: org.quartz.impl.jdbcjobstore.oracle.OracleDelegate - #Other delegates can see: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-09.html - dataSource: myDS - tablePrefix: SYS_QRTZ_ - isClustered: false - clusterCheckinInterval: 20000 - maxMisfiresToHandleAtATime: 120 - misfireThreshold: 120000 - txIsolationLevelSerializable: false - - #============================================================== - #Configure ThreadPool - #============================================================== - threadPool: - class: org.quartz.simpl.SimpleThreadPool - threadCount: 2 - threadPriority: 5 - threadsInheritContextClassLoaderOfInitializingThread: true - - #============================================================================ - # Configure Plugins - #============================================================================ - plugin: - triggHistory: - class: org.quartz.plugins.history.LoggingJobHistoryPlugin - shutdownhook: - class: org.quartz.plugins.management.ShutdownHookPlugin - cleanShutdown: true - #============================================================================ - # NutDao dataSource - #============================================================================ - dataSource: - myDS: - connectionProvider: - class: com.budwk.app.task.conn.NutConnectionProvider - - -sms: - enabled: false - #腾讯云短信配置 - tencent: - secret-id: 1 - secret-key: 2 - appid: 1 #应用ID - sign: '萌发开源' #短信签名 - tpl: - #验证码模板ID - code: 1 - #短信通知模板ID - msg: 2 - diff --git a/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java b/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java index fc7c3ed..4e30663 100644 --- a/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java +++ b/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java @@ -13,6 +13,8 @@ public class ClientActivitySignVO { private Long activityId; + private String unitId; + private String unitName; private String contactName; diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java index b014f12..e756c49 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java @@ -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))); } diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java index c8bd55f..1740422 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java @@ -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") diff --git a/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java b/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java index 56a498e..bbf269a 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java +++ b/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java @@ -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; } diff --git a/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java b/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java index 3976ad9..689c054 100644 --- a/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java +++ b/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java @@ -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); diff --git a/backend/src/main/resources/application.yaml b/backend/src/main/resources/application.yaml index 16ef37e..6b65baf 100644 --- a/backend/src/main/resources/application.yaml +++ b/backend/src/main/resources/application.yaml @@ -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: '' @@ -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: diff --git a/backend/src/main/resources/views/platform/activity/signInUserQuery/index.html b/backend/src/main/resources/views/platform/activity/signInUserQuery/index.html index e02fa45..bfed59e 100644 --- a/backend/src/main/resources/views/platform/activity/signInUserQuery/index.html +++ b/backend/src/main/resources/views/platform/activity/signInUserQuery/index.html @@ -62,6 +62,18 @@ layout("/layouts/platform_1.html"){ + + + + + + @@ -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"){ \ No newline at end of file +#--> diff --git a/backend/src/main/resources/views/platform/activity/user/index.html b/backend/src/main/resources/views/platform/activity/user/index.html index 75d2ef8..9c3e74c 100644 --- a/backend/src/main/resources/views/platform/activity/user/index.html +++ b/backend/src/main/resources/views/platform/activity/user/index.html @@ -39,6 +39,20 @@ layout("/layouts/platform_1.html"){ +
+
所属单位
+
+ + + +
+
+ +
搜索
@@ -62,8 +76,8 @@ layout("/layouts/platform_1.html"){ @@ -76,7 +90,14 @@ layout("/layouts/platform_1.html"){ - + + + + @@ -175,7 +196,14 @@ layout("/layouts/platform_1.html"){ - + + + + @@ -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() } })