From a4b25fda54a32b88a6683fae9550276984555081 Mon Sep 17 00:00:00 2001 From: "@jyuhsin" <729757837@qq.com> Date: Tue, 6 May 2025 17:44:32 +0800 Subject: [PATCH 1/4] commit --- .../controller/ActUserController.java | 2 +- .../ActWonderfulMomentController.java | 123 ++++++++++++++++ .../controller/ActivityManageController.java | 9 ++ .../activity/models/ActWonderfulMoment.java | 56 ++++++++ .../service/ActWonderfulMomentService.java | 14 ++ .../impl/ActWonderfulMomentServiceImpl.java | 21 +++ backend/src/main/resources/application.yaml | 6 +- .../components/plugins/imageUpload/index.vue | 18 ++- .../platform/activity/manage/addOrUpdate.js | 3 + .../activity/wonderfulMoment/addOrUpdate.js | 78 ++++++++++ .../activity/wonderfulMoment/index.html | 120 ++++++++++++++++ frontend/src/pages.json | 6 + .../pages/activity/wonderfulMoment/index.vue | 56 ++++++++ frontend/src/pages/index/index.vue | 133 +++++++++++++++--- 14 files changed, 620 insertions(+), 25 deletions(-) create mode 100644 backend/src/main/java/com/budwk/app/module/activity/controller/ActWonderfulMomentController.java create mode 100644 backend/src/main/java/com/budwk/app/module/activity/models/ActWonderfulMoment.java create mode 100644 backend/src/main/java/com/budwk/app/module/activity/service/ActWonderfulMomentService.java create mode 100644 backend/src/main/java/com/budwk/app/module/activity/service/impl/ActWonderfulMomentServiceImpl.java create mode 100644 backend/src/main/resources/views/platform/activity/wonderfulMoment/addOrUpdate.js create mode 100644 backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html create mode 100644 frontend/src/pages/activity/wonderfulMoment/index.vue 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..ee8bb26 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 @@ -182,7 +182,7 @@ public class ActUserController { @At @SaCheckPermission("activity.user") public Result getActivityList(String year){ - List activityList = dao.query(Activity.class, Cnd.where("YEAR(startTime)", "=", year).and(Activity::getDelFlag, "=", false)); + List activityList = dao.query(Activity.class, Cnd.NEW().andEX("YEAR(startTime)", "=", year).and(Activity::getDelFlag, "=", false)); return Result.success(activityList); } diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActWonderfulMomentController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActWonderfulMomentController.java new file mode 100644 index 0000000..41ee653 --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActWonderfulMomentController.java @@ -0,0 +1,123 @@ +package com.budwk.app.module.activity.controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.page.PageForm; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.result.Result; +import com.budwk.app.module.activity.models.ActWonderfulMoment; +import com.budwk.app.module.activity.models.Activity; +import com.budwk.app.module.activity.service.ActWonderfulMomentService; +import com.budwk.app.web.commons.auth.satoken.StpClientUtil; +import lombok.extern.slf4j.Slf4j; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Cnd; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.aop.Aop; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Lang; +import org.nutz.lang.util.NutMap; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @ClassName ActWonderfulMomentController + * @Author JyuHsin + * @Date 2025/5/6 15:30 + * @Version 1.0 + * @Description TODO + */ +@Slf4j +@IocBean +@Ok("json:full") +@At("/platform/activity/wonderfulMoment") +public class ActWonderfulMomentController { + + @Inject + private ActWonderfulMomentService wonderfulMomentService; + + @At("") + @SaCheckPermission("activity.wonderfulMoment") + @Ok("beetl:/platform/activity/wonderfulMoment/index.html") + public void index() { + } + + @At + @SaCheckPermission("activity.wonderfulMoment") + public Result pageData(PageForm pageForm, String startTime, String endTime){ + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + cnd.and("title", "like", "%" + pageForm.getSearchKeyword() + "%"); + } + cnd.andEX("publishTime", ">=", startTime); + cnd.andEX("publishTime", "<=", endTime); + cnd.desc("publishTime"); + Pagination pagination = wonderfulMomentService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd); + return Result.success(pagination); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("activity.wonderfulMoment") + public Result onHandle(@Param("wonderfulMoment") ActWonderfulMoment wonderfulMoment) { + if(wonderfulMoment.getId() == null) { + wonderfulMoment.setPublishTime(DateUtil.now()); + } + wonderfulMomentService.insertOrUpdate(wonderfulMoment); + return Result.success(); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("activity.wonderfulMoment") + public Result onDelete(Long id) { + wonderfulMomentService.delete(id); + return Result.success(); + } + + @At + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result getWonderfulMoment(@Param("id") Long id) { + Cnd cnd = Cnd.where("published", "=", true).andEX("id", "=", id); + cnd.desc("publishTime"); + List momentList = wonderfulMomentService.query(cnd); + List result = new ArrayList<>(); + for (ActWonderfulMoment wonderfulMoment : momentList) { + NutMap nutMap = Lang.obj2map(wonderfulMoment, NutMap.class); + DateTime dateTime = DateUtil.parse(wonderfulMoment.getPublishTime()); + //如果是今天 + if(DateUtil.isSameDay(dateTime, new Date())) { + nutMap.put("time", "今天" + DateUtil.format(dateTime, "HH:mm")); + } else { + nutMap.put("time", DateUtil.betweenDay(dateTime, new Date(), false) + "天前"); + } + result.add(nutMap); + } + return Result.success(result); + } + + @At("/getWonderfulMomentById/?") + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result getWonderfulMomentById(Long id) { + ActWonderfulMoment moment = wonderfulMomentService.fetch(id); + return Result.success(moment); + } + + @At("/handleWonderfulMoment/?") + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result handleWonderfulMoment(Long id) { + ActWonderfulMoment moment = wonderfulMomentService.fetch(id); + moment.setReadCount(moment.getReadCount() + 1); + wonderfulMomentService.update(moment); + return Result.success(); + } +} diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java index e4aae90..827b7d8 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java @@ -1,5 +1,6 @@ package com.budwk.app.module.activity.controller; +import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.hutool.core.collection.CollUtil; import com.budwk.app.base.page.PageForm; @@ -8,6 +9,7 @@ import com.budwk.app.base.result.Result; import com.budwk.app.module.activity.models.Activity; import com.budwk.app.module.activity.models.ActivityItem; import com.budwk.app.module.activity.service.ActivityManageService; +import com.budwk.app.web.commons.auth.satoken.StpClientUtil; import lombok.extern.slf4j.Slf4j; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; @@ -163,4 +165,11 @@ public class ActivityManageController { return Result.success(); } + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result getActivity() { + List activityList = activityService.query(Cnd.NEW()); + return Result.success(activityList); + } } diff --git a/backend/src/main/java/com/budwk/app/module/activity/models/ActWonderfulMoment.java b/backend/src/main/java/com/budwk/app/module/activity/models/ActWonderfulMoment.java new file mode 100644 index 0000000..e2aa5fb --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/models/ActWonderfulMoment.java @@ -0,0 +1,56 @@ +package com.budwk.app.module.activity.models; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; + +/** + * @ClassName ActWonderfulMoment + * @Author JyuHsin + * @Date 2025/5/6 15:28 + * @Version 1.0 + * @Description TODO + */ +@Data +@Comment("活动项目队伍得分表") +@Table("act_wonderful_moment") +@EqualsAndHashCode(callSuper = true) +@TableMeta("{'mysql-charset':'utf8mb4'}") +public class ActWonderfulMoment extends BaseModel { + + @Id + @Comment("ID") + private Long id; + + @Column + @Comment("标题") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String title; + + @Column + @Comment("发布内容") + @ColDefine(type = ColType.TEXT) + private String content; + + @Column + @Comment("发布时间") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String publishTime; + + @Column + @Comment("封面图") + @ColDefine(type = ColType.VARCHAR, width = 500) + private String cover; + + @Column + @Comment("是否发布") + @ColDefine(type = ColType.BOOLEAN) + private Boolean published; + + @Column + @Comment("阅读次数") + @Default(value = "0") + @ColDefine(type = ColType.INT) + private Integer readCount; +} diff --git a/backend/src/main/java/com/budwk/app/module/activity/service/ActWonderfulMomentService.java b/backend/src/main/java/com/budwk/app/module/activity/service/ActWonderfulMomentService.java new file mode 100644 index 0000000..b95ded8 --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/service/ActWonderfulMomentService.java @@ -0,0 +1,14 @@ +package com.budwk.app.module.activity.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.module.activity.models.ActWonderfulMoment; + +/** + * @ClassName ActWonderfulMomentService + * @Author JyuHsin + * @Date 2025/5/6 15:30 + * @Version 1.0 + * @Description TODO + */ +public interface ActWonderfulMomentService extends BaseService { +} diff --git a/backend/src/main/java/com/budwk/app/module/activity/service/impl/ActWonderfulMomentServiceImpl.java b/backend/src/main/java/com/budwk/app/module/activity/service/impl/ActWonderfulMomentServiceImpl.java new file mode 100644 index 0000000..c53e062 --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/service/impl/ActWonderfulMomentServiceImpl.java @@ -0,0 +1,21 @@ +package com.budwk.app.module.activity.service.impl; + +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.module.activity.models.ActWonderfulMoment; +import com.budwk.app.module.activity.service.ActWonderfulMomentService; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.IocBean; + +/** + * @ClassName ActWonderfulMomentServiceImpl + * @Author JyuHsin + * @Date 2025/5/6 15:31 + * @Version 1.0 + * @Description TODO + */ +@IocBean(args = {"refer:dao"}) +public class ActWonderfulMomentServiceImpl extends BaseServiceImpl implements ActWonderfulMomentService { + public ActWonderfulMomentServiceImpl(Dao dao) { + super(dao); + } +} diff --git a/backend/src/main/resources/application.yaml b/backend/src/main/resources/application.yaml index 4ac4425..6a8d6bc 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: D:/project/hmc_gbhd/backend/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: D:/project/hmc_gbhd/backend/src/main/resources/views/ root: views/ DELIMITER_STATEMENT_START: '' diff --git a/backend/src/main/resources/static/components/plugins/imageUpload/index.vue b/backend/src/main/resources/static/components/plugins/imageUpload/index.vue index 343e919..006143a 100644 --- a/backend/src/main/resources/static/components/plugins/imageUpload/index.vue +++ b/backend/src/main/resources/static/components/plugins/imageUpload/index.vue @@ -12,10 +12,22 @@ :on-exceed="handleExceed" :file-list="fileList" > - + +
+ + + + + + + + + +
- + @@ -124,4 +136,4 @@ module.exports = { \ No newline at end of file + diff --git a/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js b/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js index 5e27579..6d4ff33 100644 --- a/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js +++ b/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js @@ -78,6 +78,9 @@ const addOrUpdate = { {{form.files}} + + + From 91002349239c95f642db964a14f9afdf316bf94e Mon Sep 17 00:00:00 2001 From: "@jyuhsin" <729757837@qq.com> Date: Tue, 6 May 2025 17:47:09 +0800 Subject: [PATCH 2/4] commit --- frontend/src/pages/index/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/index/index.vue b/frontend/src/pages/index/index.vue index e22ab8d..ed5addf 100644 --- a/frontend/src/pages/index/index.vue +++ b/frontend/src/pages/index/index.vue @@ -80,7 +80,7 @@ {{ item.title }} From 3a2e992774f2fc23e33039bdf2ee6a0dfa8b4366 Mon Sep 17 00:00:00 2001 From: "@jyuhsin" <729757837@qq.com> Date: Tue, 6 May 2025 17:54:09 +0800 Subject: [PATCH 3/4] commit --- .../activity/wonderfulMoment/index.html | 19 +++++++++++++++++++ frontend/src/pages/index/index.vue | 11 ++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html b/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html index ad86197..75e09bc 100644 --- a/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html +++ b/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html @@ -93,6 +93,25 @@ layout("/layouts/platform_1.html"){ } }, methods: { + onTableRowDelete(id) { + if (!id) { + return + } + this.$confirm('确定删除该数据吗?', '提示', { + type: 'warning', + confirmButtonText: '确定', + cancelButtonText: '取消' + }).then(() => { + $.post(this.tableDeleteUrl, {id}).then((res) => { + if (res.code === 0) { + this.$message.success("删除成功") + this.pageData() + } else { + this.$message.error(res.msg) + } + }) + }).catch(() => {}) + }, publishedChange(val, row) { const params = JSON.parse(JSON.stringify(row)) this.$set(params, 'published', val) diff --git a/frontend/src/pages/index/index.vue b/frontend/src/pages/index/index.vue index ed5addf..41abb53 100644 --- a/frontend/src/pages/index/index.vue +++ b/frontend/src/pages/index/index.vue @@ -48,6 +48,7 @@ @@ -68,6 +69,10 @@ + @@ -76,7 +81,7 @@ 精彩瞬间 - + + From 4742d0c4aaa0152c70462665457bdc91cfb219c2 Mon Sep 17 00:00:00 2001 From: Paidax Date: Tue, 6 May 2025 17:58:39 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=9F=AD=E4=BF=A1+=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/application.yaml | 158 ------------------ .../activity/vo/ClientActivitySignVO.java | 2 + .../controller/ActUserController.java | 7 +- .../ActivitySignInQueryController.java | 12 ++ .../app/module/activity/models/ActUser.java | 17 ++ .../app/web/commons/ext/sms/SmsService.java | 20 ++- backend/src/main/resources/application.yaml | 12 +- .../activity/signInUserQuery/index.html | 32 +++- .../views/platform/activity/user/index.html | 74 +++++++- 9 files changed, 154 insertions(+), 180 deletions(-) delete mode 100644 backend/application.yaml 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() } })