From 2ee12b7514eccf85d1251a84bc77dda800706a68 Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Fri, 26 Sep 2025 09:51:39 +0800 Subject: [PATCH 1/4] commit --- .../app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java index bbddad06..0ecd04fc 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareProjectServiceImpl.java @@ -63,6 +63,7 @@ public class WelfareProjectServiceImpl extends BaseServiceImpl i public void updateProject(WelfareProject project) { // 更新项目 update(project); + dao().clear(WelfareProjectSubjectOption.class, Cnd.where(WelfareProjectSubjectOption::getWelfareId, "=", project.getId())); // 新增或更新选项 for (WelfareProjectSubjectOption option : project.getOptions()) { From 35b77a6770bd84ac6593213e3f13cbe2737ee0e6 Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Sun, 28 Sep 2025 08:51:55 +0800 Subject: [PATCH 2/4] commit --- .../zhgh/democratic/teachercongress/delegate/push/write.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/write.js b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/write.js index 7a0bb16a..18d1f81c 100644 --- a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/write.js +++ b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/write.js @@ -66,9 +66,9 @@ const write = { - - - + + + From aeb8e2b4d2e2a70246287721e32a3e625a420dc1 Mon Sep 17 00:00:00 2001 From: "@jyuhsin" <729757837@qq.com> Date: Sun, 28 Sep 2025 10:25:27 +0800 Subject: [PATCH 3/4] commit --- .../manage/FamilyActivityApplyController.java | 7 +- .../examine/ClubExamineApplyController.java | 33 +- .../manage/LiteracyAdjustController.java | 2 +- .../manage/LiteracyApplyController.java | 6 +- .../manage/LiteracyCourseController.java | 47 ++ .../manage/LiteracyManageController.java | 2 +- .../manage/LiteracyMineController.java | 4 +- .../manage/LiteracyTeacherController.java | 92 +++ .../manage/LiteracyTypeController.java | 2 +- .../manage/LiteracyUserManageController.java | 2 +- .../LiteracyActivityStatisticsController.java | 2 +- .../literacy/models/LiteracyTeacher.java | 53 ++ .../zhgh/activity/trainSignUp/manage/info.js | 2 +- .../trainSignUp/userAdjust/userInfo.js | 4 +- .../dayofficework/literacy/apply/applyForm.js | 210 +++++++ .../literacy/apply/courseList.js | 340 ++++++++++ .../dayofficework/literacy/apply/index.html | 175 ++++++ .../dayofficework/literacy/course/index.html | 121 ++++ .../literacy/manage/basicForm.js | 593 ++++++++++++++++++ .../literacy/manage/courseTime.js | 215 +++++++ .../literacy/manage/customForm.js | 210 +++++++ .../dayofficework/literacy/manage/index.html | 201 ++++++ .../dayofficework/literacy/manage/info.js | 111 ++++ .../literacy/manage/makeQrcode.js | 84 +++ .../literacy/manage/unionForm.js | 221 +++++++ .../literacy/statistics/index.html | 156 +++++ .../dayofficework/literacy/statistics/info.js | 98 +++ .../dayofficework/literacy/teacher/index.html | 194 ++++++ .../dayofficework/literacy/type/basicForm.js | 350 +++++++++++ .../dayofficework/literacy/type/index.html | 120 ++++ .../literacy/userAdjust/index.html | 144 +++++ .../literacy/userAdjust/userInfo.js | 224 +++++++ .../literacy/userManage/index.html | 235 +++++++ .../activity/trainSignUp/list/applyForm.js | 2 +- .../dayofficework/literacy/apply/index.html | 165 +++++ .../dayofficework/literacy/common/times.js | 89 +++ .../dayofficework/literacy/list/applyForm.js | 159 +++++ .../dayofficework/literacy/list/index.html | 231 +++++++ .../dayofficework/literacy/mine/index.html | 132 ++++ 39 files changed, 5017 insertions(+), 21 deletions(-) create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTeacherController.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/applyForm.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/courseList.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/courseTime.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/customForm.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/info.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/makeQrcode.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/unionForm.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/info.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/teacher/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/type/basicForm.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/type/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/userInfo.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/userManage/index.html create mode 100644 src/main/resources/views/platform/zhghh5/dayofficework/literacy/apply/index.html create mode 100644 src/main/resources/views/platform/zhghh5/dayofficework/literacy/common/times.js create mode 100644 src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/applyForm.js create mode 100644 src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/index.html create mode 100644 src/main/resources/views/platform/zhghh5/dayofficework/literacy/mine/index.html diff --git a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java index ca51de3c..279c27c8 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java @@ -221,6 +221,7 @@ public class FamilyActivityApplyController { currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0; FamilyCourse course = dao.fetch(FamilyCourse.class, courseId); + FamilyType type = dao.fetch(FamilyType.class, course.getCourseType()); FamilyActivity activity = dao.fetch(FamilyActivity.class, course.getActivityId()); //判断时间 @@ -237,6 +238,10 @@ public class FamilyActivityApplyController { return Result.error(99,"抱歉,您没有此次活动的权限"); } + if(type.getIsBringFamily() && currentFamilyNumber == 0) { + return Result.error(99, "%s信息不能为空".formatted(activity.getKeyWord())); + } + //判断是否报名 boolean courseByUser = familyActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId()); if(courseByUser) { @@ -246,7 +251,7 @@ public class FamilyActivityApplyController { //判断活动人数 boolean signFull = familyActivityService.isSignFull(course, currentFamilyNumber); if(signFull) { - return Result.error(99,"啊哦,目前报名人数已达上限。您可保持关注,如有老师取消之前的报名从而释放出名额,您可再来试试。谢谢!"); + return Result.error(99,"抱歉,报名人数已满"); } //判断活动限制 diff --git a/src/main/java/com/budwk/app/zhgh/club/controller/examine/ClubExamineApplyController.java b/src/main/java/com/budwk/app/zhgh/club/controller/examine/ClubExamineApplyController.java index e02d046c..ded88f71 100644 --- a/src/main/java/com/budwk/app/zhgh/club/controller/examine/ClubExamineApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/club/controller/examine/ClubExamineApplyController.java @@ -67,7 +67,13 @@ public class ClubExamineApplyController { @At @SaCheckLogin - public Result getCount(@Valid String id, @Valid Integer year) { + public Result getCount(String id, Integer year) { + if(StrUtil.isBlank(id)) { + return Result.error("协会信息为空,请核查"); + } + if(year == null) { + return Result.error("年份信息为空,请核查"); + } List list = dao.query(SysClubExamineRegister.class, Cnd.where("clubId", "=", id).and("year(registerDate)", "=", year)); List instanceList = dao.query( ProcessInstance.class, @@ -86,21 +92,30 @@ public class ClubExamineApplyController { @At @SaCheckLogin - public Result getClubUserNum(@Valid String clubId) { + public Result getClubUserNum(String clubId) { + if(StrUtil.isBlank(clubId)) { + return Result.error("协会信息为空,请核查"); + } List result = sysClubExamineService.getClubUserNum(clubId); return Result.success(result); } @At @SaCheckLogin - public Result getJgUser(@Valid String clubId) { + public Result getJgUser(String clubId) { + if(StrUtil.isBlank(clubId)) { + return Result.error("协会信息为空,请核查"); + } List result = sysClubExamineService.getJgUser(clubId); return Result.success(result); } @At @SaCheckLogin - public Result getClubMemberMoney(@Valid String clubId) { + public Result getClubMemberMoney(String clubId) { + if(StrUtil.isBlank(clubId)) { + return Result.error("协会信息为空,请核查"); + } int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)); SysClub club = dao.fetch(SysClub.class, clubId); int money = count * (club.getDue() != null ? Integer.parseInt(club.getDue()) : 0); @@ -117,7 +132,10 @@ public class ClubExamineApplyController { @At @SaCheckLogin - public Result getLasYearSurplus(@Valid String clubId) { + public Result getLasYearSurplus(String clubId) { + if(StrUtil.isBlank(clubId)) { + return Result.error("协会信息为空,请核查"); + } SysClubExamineRegister register = dao.fetch(SysClubExamineRegister.class, Cnd.where("clubId", "=", clubId) .and("YEAR(registerDate)", "=", DateUtil.thisYear() - 1)); if (Lang.isNotEmpty(register)) { @@ -130,7 +148,10 @@ public class ClubExamineApplyController { @At @SaCheckPermission("club.examine") - public Result info(@Valid String id) { + public Result info(String id) { + if(StrUtil.isBlank(id)) { + return Result.error("id信息为空,请核查"); + } SysClubExamineRegister examineRegister = sysClubExamineService.fetch(id); sysClubExamineService.fetchLinks(examineRegister, "detailedList"); return Result.success(examineRegister); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyAdjustController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyAdjustController.java index 246cdfec..93ff6cb1 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyAdjustController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyAdjustController.java @@ -48,7 +48,7 @@ public class LiteracyAdjustController { @At("") @SaCheckPermission("literacy.adjust") - @Ok("beetl:/platform/zhgh/activity/literacy/userAdjust/index.html") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/userAdjust/index.html") public void index() { } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyApplyController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyApplyController.java index 6e4210b7..3091a2d7 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyApplyController.java @@ -61,19 +61,19 @@ public class LiteracyApplyController { @At("/") @SaCheckPermission("literacy.apply") - @Ok("beetl:/platform/zhgh/activity/literacy/apply/index.html") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/apply/index.html") public void index() { } @At("/h5") @SaCheckPermission("h5.literacy.apply") - @Ok("beetl:/platform/zhghh5/activity/literacy/apply/index.html") + @Ok("beetl:/platform/zhghh5/dayofficework/literacy/apply/index.html") public void h5Index() { } @At("/list/h5") @SaCheckPermission("h5.literacy.apply") - @Ok("beetl:/platform/zhghh5/activity/literacy/list/index.html") + @Ok("beetl:/platform/zhghh5/dayofficework/literacy/list/index.html") public void listIndex() { } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java new file mode 100644 index 00000000..07b6a0a7 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java @@ -0,0 +1,47 @@ +package com.budwk.app.zhgh.dayofficework.literacy.controller.manage; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.result.Result; +import com.budwk.app.base.service.BaseService; +import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +/** + * @ClassName LiteracyCourseController + * @Author JyuHsin + * @Date 2025/9/26 16:44 + * @Version 1.0 + * @Description TODO + */ +@Slf4j +@IocBean +@Ok("json:full") +@Api(tags = "职工素养培训-课程管理") +@At("/platform/literacy/course") +public class LiteracyCourseController { + + @Inject + private Dao dao; + @Inject + private BaseService baseService; + + @At("") + @SaCheckPermission("literacy.course") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/course/index.html") + public void index() { + } + + @At + @SaCheckPermission("literacy.course") + public Result pageData(PageForm pageForm) { + + return Result.success(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyManageController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyManageController.java index ed924ac2..dd16c02b 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyManageController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyManageController.java @@ -45,7 +45,7 @@ public class LiteracyManageController { @At("") @SaCheckPermission("literacy.manage") - @Ok("beetl:/platform/zhgh/activity/literacy/manage/index.html") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/manage/index.html") public void index() { } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyMineController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyMineController.java index 665e5a6e..45f02979 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyMineController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyMineController.java @@ -41,13 +41,13 @@ public class LiteracyMineController { @At("/") @SaCheckPermission("literacy.mine") - @Ok("beetl:/platform/zhgh/activity/literacy/mine/index.html") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/mine/index.html") public void index() { } @At("/h5") @SaCheckPermission("h5.literacy.mine") - @Ok("beetl:/platform/zhghh5/activity/literacy/mine/index.html") + @Ok("beetl:/platform/zhghh5/dayofficework/literacy/mine/index.html") public void h5Index() { } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTeacherController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTeacherController.java new file mode 100644 index 00000000..7fba7a71 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTeacherController.java @@ -0,0 +1,92 @@ +package com.budwk.app.zhgh.dayofficework.literacy.controller.manage; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.result.Result; +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.dayofficework.literacy.models.LiteracyTeacher; +import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +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.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import java.util.List; + +@Slf4j +@IocBean +@Ok("json:full") +@Api(tags = "职工素养培训-教师管理") +@At("/platform/literacy/teacher") +public class LiteracyTeacherController { + + @Inject + private Dao dao; + @Inject + private BaseService baseService; + + @At("") + @SaCheckPermission("literacy.teacher") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/teacher/index.html") + public void index() { + } + + @At + @SaCheckPermission("literacy.teacher") + public Result pageData(PageForm pageForm, + @Param(value = "name") String name) { + Sql sql = Sqls.create(""" + select * from literacy_teacher $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and(Cnd.likeEX("name", name)); + sql.setCondition(cnd); + Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("literacy.teacher") + @SLog(type = "职工素养-教师管理", tag = "新增", msg = "新增教师") + public Result add(LiteracyTeacher teacher) throws Exception { + dao.insert(teacher); + return Result.success(); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("literacy.teacher") + @SLog(type = "职工素养-教师管理", tag = "编辑", msg = "编辑教师") + public Result edit(LiteracyTeacher teacher) { + dao.updateIgnoreNull(teacher); + return Result.success(); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("literacy.teacher") + @SLog(type = "职工素养-教师管理", tag = "删除", msg = "删除教师") + public Object delete(@Param(value = "id") String id) { + dao.clear(LiteracyTeacher.class, Cnd.where("id", "=", id)); + return Result.success(); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("literacy") + public Object queryTeachers() { + List teachers = dao.query(LiteracyTeacher.class, Cnd.NEW()); + return Result.success(teachers); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTypeController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTypeController.java index 00ba868b..bd11f36f 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTypeController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyTypeController.java @@ -47,7 +47,7 @@ public class LiteracyTypeController { @At("") @SaCheckPermission("literacy.type") - @Ok("beetl:/platform/zhgh/activity/literacy/type/index.html") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/type/index.html") public void index() { } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyUserManageController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyUserManageController.java index 2a7b6ff7..961a2460 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyUserManageController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyUserManageController.java @@ -55,7 +55,7 @@ public class LiteracyUserManageController { @At("") @SaCheckPermission("literacy.userManage") - @Ok("beetl:/platform/zhgh/activity/literacy/userManage/index.html") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/userManage/index.html") public void index() { } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/statistics/LiteracyActivityStatisticsController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/statistics/LiteracyActivityStatisticsController.java index 4a905b27..7245ddef 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/statistics/LiteracyActivityStatisticsController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/statistics/LiteracyActivityStatisticsController.java @@ -59,7 +59,7 @@ public class LiteracyActivityStatisticsController { @At("") @SaCheckPermission("literacy.statistics") - @Ok("beetl:/platform/zhgh/activity/literacy/statistics/index.html") + @Ok("beetl:/platform/zhgh/dayofficework/literacy/statistics/index.html") public void index() { } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java new file mode 100644 index 00000000..e9cd345a --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java @@ -0,0 +1,53 @@ +package com.budwk.app.zhgh.dayofficework.literacy.models; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +import java.io.Serial; +import java.io.Serializable; + +@Data +@Table +@Accessors(chain = true) +@Comment("职工素养教师管理") +@EqualsAndHashCode(callSuper = true) +public class LiteracyTeacher extends BaseModel implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @Name + @Comment("id") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @Comment("姓名") + @ColDefine(type = ColType.VARCHAR, width = 10) + private String name; + + @Column + @Comment("单位") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String unitName; + + @Column + @Comment("联系电话") + @ColDefine(type = ColType.VARCHAR, width = 20) + private String mobile; + + @Column + @Comment("专业") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String major; + + @Column + @Comment("备注") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String remark; +} diff --git a/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/info.js b/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/info.js index a997f578..93933ec0 100644 --- a/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/info.js +++ b/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/info.js @@ -104,7 +104,7 @@ const info = { }, }, style: /*language=CSS*/ ` - .el-button--text { + /deep/ .el-button--text { padding: 0; } ` diff --git a/src/main/resources/views/platform/zhgh/activity/trainSignUp/userAdjust/userInfo.js b/src/main/resources/views/platform/zhgh/activity/trainSignUp/userAdjust/userInfo.js index 12a469b3..4c19d8ce 100644 --- a/src/main/resources/views/platform/zhgh/activity/trainSignUp/userAdjust/userInfo.js +++ b/src/main/resources/views/platform/zhgh/activity/trainSignUp/userAdjust/userInfo.js @@ -213,10 +213,10 @@ const userInfo = { this.unitList = await this.$businessTool.listUnit(this.registerForm.unionId) }, style: /*language=CSS*/ ` - .adjustDialog .el-radio__label { + /deep/ .adjustDialog .el-radio__label { display: none; } - .adjustDialog .el-dialog__body { + /deep/ .adjustDialog .el-dialog__body { max-height: 600px; overflow-y: auto; } diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/applyForm.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/applyForm.js new file mode 100644 index 00000000..25f3a597 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/applyForm.js @@ -0,0 +1,210 @@ +const applyForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + 提 交 + + +
+ `, + store, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + signDialog: false, + formData: {}, + courseRow: {}, + courseTimeSelectList: [], + } + }, + methods: { + async getCourseTimeSelectList(o) { + const resp = await $.post('/platform/literacy/apply/getCourseTimeSelectList',{ courseId: o.id }) + if (resp.code === 0) { + this.courseTimeSelectList = resp.data + } else { + this.$message.warning('获取时段信息失败,请联系管理员') + } + }, + async onOpen(row, course) { + this.initData(row, course) + if (row.courseIsLimitApply) { + await this.getCourseTimeSelectList(row) + } + this.courseRow = row + this.signDialog = true + this.$nextTick(() => { + this.$refs.form.clearValidate() + }) + }, + async validateSignUp() { + // 获取家属人数 + let familyCount = this.formData.mobileSignColumnList.filter(o => o.columnCode === 'xdqsrs').reduce((sum, item) => { + return sum + (Number(item.columnValue) || 0) + }, 0) + const res = await this.$axios.post("/platform/literacy/apply/validateSignUp", { + courseId: this.formData.courseId, + currentFamilyNumber: familyCount + }) + return res.code === 0 + }, + async validateCourseTime() { + const res = await this.$axios.post('/platform/literacy/apply/validateSourceSignUp', { + activityCourseId: this.formData.activityCourseId, + courseId: this.courseRow.id + }) + return res.code === 0 + }, + async onSubmit() { + if(!await this.validateSignUp()) return + + this.$refs["form"].validate(async (valid) => { + if (valid) { + if(this.courseRow.courseIsLimitApply && !await this.validateCourseTime()) return + this.$confirm("您确定要提交吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(async () => { + const mobileColumnsValue = this.formData.mobileSignColumnList.map((v) => { + return { + columnName: v.columnName, + columnValue: v.columnValue, + columnCode: v.columnCode, + columnFormType: v.columnFormType + } + }) + this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue) + const resp = await this.$axios.post("/platform/literacy/apply/doSignUp", this.formData) + if (resp.code === 0) { + this.signDialog = false + this.$message.success(resp.msg) + this.$emit('refresh') + } else { + this.$message.warning(resp.msg) + } + }) + } + }) + }, + initData(row, course) { + this.$set(this.formData, 'username', this.$store.state.user.username) + this.$set(this.formData, 'loginname', this.$store.state.user.loginname) + this.$set(this.formData, 'unionName', this.$store.state.user.union.name) + this.$set(this.formData, 'unitName', this.$store.state.user.unit.name) + this.$set(this.formData, 'sex', this.$store.state.user.sex) + this.$set(this.formData, 'activityId', row.activityId) + this.$set(this.formData, 'courseId', row.id) + this.$set(this.formData, 'mobileSignColumnList', course.mobileSignColumnList) + + this.formData.mobileSignColumnList.forEach((item) => { + item.columnValue = this.$store.state.user[item.columnCode] || "" + }) + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/courseList.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/courseList.js new file mode 100644 index 00000000..130489e1 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/courseList.js @@ -0,0 +1,340 @@ + +const courseList = { + template: /*language=HTML*/ ` +
+ + + + + 类  型: + + + + + + + + 分类标识: + + + {{ item }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + + + + +
+ + 取 消 + +
+ + +
+ + 取 消 + +
+ + +
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + mixins: [initTableMixins], + components: { + "apply-form": applyForm, + }, + data() { + return { + pageForm: { + assortTypes: [], + }, + assortList: [], + courseTimeListDialog: false, + viewMapDialog: false, + courseTimeList: [], + tableColumns: [ + { prop: "courseName", label: "名称" }, + { prop: "typeName", label: "类型", width: 130}, + { prop: "campus", label: "校区", width: 160 }, + { prop: "courseLocationCoordinates", label: "地点", width: 200 }, + { prop: "courseInstructor", label: "联系人", width: 100 }, + { prop: "courseTime", label: "时间", width: 160 }, + { prop: "introduce", label: "详细信息", width: 100 }, + { prop: "applyNum", label: "已报名人数", width: 200 } + ], + activity: {}, + courseTypeList: [], + + trainType: '', + pdf: false, + infoVisible: false, + introduce: '', + } + }, + methods: { + async onPreview(introduce) { + try { + const parser = new DOMParser(); + const doc = parser.parseFromString(introduce, 'text/html'); + const link = doc.querySelector('a'); + const href = link.getAttribute('href'); + + const id = href.substring(href.indexOf("=") + 1) + const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) }) + + this.pdf = true + window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name) + } catch (e) { + this.introduce = introduce + this.pdf = false + this.infoVisible = true + } + }, + tagClick(key, val) { + let idx = this.pageForm[key].indexOf(val) + if (idx !== -1) { + this.pageForm[key].splice(idx, 1) + } else { + this.pageForm[key].push(val) + } + this.doSearch() + }, + async onOpen(row) { + this.activity = row + this.$set(this.pageForm, 'activityId', row.id) + await this.pageData() + await this.getCourseTypeList() + this.queryCourseAssort() + }, + onSign(row) { + const course = this.courseTypeList.find((v) => v.id === row.courseType) + this.$axios.post("/platform/literacy/apply/validateSignUp", {courseId: row.id}) + .then((res) => { + if (res.code !== 0) { + this.$alert(res.msg, "提示", { + confirmButtonText: "确定", + type: "warning" + }) + } else { + let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber) + if(row.reserveMode === 2 && lave <= 0) { + this.$alert('您当前的报名为候补报名状态', "提示", { + confirmButtonText: "确定", + type: "warning" + }) + } + this.$refs.formRef.onOpen(row, course) + } + }) + }, + onCancel(row) { + this.$confirm("您确定要取消吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "info" + }).then(async () => { + const resp = await this.$axios.post("/platform/literacy/apply/cancelSignUp", { + activityId: row.activityId, + courseId: row.id + }) + if (resp.code === 0) { + await this.pageData() + this.$message.success(resp.msg) + } else { + this.$message.warning(resp.msg) + } + }) + }, + async getCourseTypeList() { + const resp = await this.$axios.post("/platform/literacy/type/getAllType") + if (resp.code === 0) { + this.courseTypeList = resp.data + } + }, + async openViewCourseTime(id) { + const resp = await this.$axios.post(loc() + "/getCourseTime", { id: id }) + this.courseTimeList = resp.data + this.courseTimeListDialog = true + }, + openViewMap(point) { + if (!Array.isArray(point)) { + this.$message.warning("没有设置点位,无法通过地图查看") + return + } + this.viewMapDialog = true + this.$nextTick(() => { + const viewMap = new AMap.Map("viewMap", { + resizeEnable: true, + center: point, + zoom: 16 + }) + if (viewMarker) { + viewMap.remove(viewMarker) + } + viewMarker = new AMap.Marker({ + position: point, + offset: new AMap.Pixel(-13, -30) + }) + viewMap.add(viewMarker) + viewMap.setFitView(null, false, [150, 60, 100, 60]) + }) + }, + calcSignUpCount(o) { + let lave = o.coursePeopleNumber - (o.hasRegisterNum + o.courseReservedNumber) + if(o.reserveMode === 2) { + let lave2 = o.waitingNum - o.hasWaitingNum + return "余" + lave +"/" + o.coursePeopleNumber + "人" + + ",候补余" + lave2 + "/" + o.waitingNum + "人" + } else { + return "余" + lave +"/" + o.coursePeopleNumber + "人" + } + }, + async pageData() { + const pageForm = clone({...this.pageForm}) + pageForm.assortTypes = JSON.stringify(pageForm.assortTypes) + const resp = await this.$axios.post(loc() + "/pageData", pageForm) + if (resp.code === 0) { + this.tableData = resp.data.list + this.pageForm.totalCount = resp.data.totalCount + } else { + this.$message.warning(resp.msg) + } + }, + queryCourseAssort() { + this.$axios.post(loc() + "/queryCourseAssort", {activityId: this.activity.id}) + .then((resp) => { + this.assortList = resp.data + }) + }, + }, + created() { + + }, + style: /*language=CSS*/ ` + /deep/ .glow-box { + min-height: calc(100vh - 56px - 40px - 50px - 80px); + max-height: calc(100vh - 56px - 40px - 50px - 80px); + overflow-y: auto; + background: #F0F2F5; + } + /deep/ img { + width: 100%; + height: 180px; + } + /deep/ .title { + background: white; + height: 20px; + } + /deep/ .query-row { + display: flex; + align-items: center; + padding: 6px 0; + } + /deep/ .query-row:not(:last-child) { + border-bottom: 1px dashed rgb(230, 230, 230); + } + /deep/ .query-row > .query-title { + width: 100px; + max-width: 100px; + min-width: 100px; + overflow: hidden; + } + /deep/ .query-row > .query-content { + min-width: 200px; + overflow: hidden; + } + /deep/ .query-row > .query-content > .el-tag { + margin-bottom: 5px; + margin-top: 5px; + } + /deep/ @media screen and (max-width: 992px) { + .query-row:nth-child(4) .query-content .el-col:not(:last-child) { + margin-bottom: 5px; + } + + .query-title { + display: none; + } + } + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/index.html new file mode 100644 index 00000000..4a165668 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/apply/index.html @@ -0,0 +1,175 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html new file mode 100644 index 00000000..46f2b9c9 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html @@ -0,0 +1,121 @@ + + + + +
+ + + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js new file mode 100644 index 00000000..461cdc24 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js @@ -0,0 +1,593 @@ + + +const basicForm = { + template: /*language=HTML*/ ` +
+ +
+ + + + + 沿用之前活动 + 不沿用之前活动 + + + + + + + + + + + + + + + + + + + + + 通知 + 不通知 + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+ 设置 +
+
+
+
+ + + + + + + +
+ + + + + + + + + + + + + +
+
+
+
{{trainType + '信息(温馨提示:如不需要人数限制,下方人数框填写0或者不填)'}}
+
+ 添加{{ trainType }} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
个人报名数量限制
+ + + 无限制 + 按类型限制 + 按活动限制 + +
+
注:无限制指对报名的个数不做任何限制
+
+
+ 设置报名限制 + 注:按类型限制指对每个类型下的个数进行限制 +
+
+
+
+ + 注:按活动限制指只能报{{formData.limitNum}}个,不与类型关联 +
+
+
+
+
+
+
+ 取消 + 上一步 + 下一步 + 保存 + 提交 +
+ + + + + + + + + + + 取消 + 确定 + + + + + + + + +
+ `, + dicts: ["USER_CAMPUS", "LITERACY_SIGNUP_TYPE"], + data() { + return { + signUpDialog: false, + step: 1, + formData: { + notice: false, + courseList: [ + { orderNum: 1, courseName: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false }, + ], + conditionStructure: { + method: "AND", + conditions: [{}] + }, + restrictLimit: 1, + limitNum: 1, + typeLimits: [] + }, + historicalActList: [], + trainTypeList: [], + trainType: "培训班", + activityGroupList: [], + pickerOptions: { + disabledDate(time) { + return time.getTime() < Date.now() - 24 * 60 * 60 * 1000 + } + }, + campusList: [], + courseTypeList: [], + } + }, + components: { + "drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue"), + "course-time": courseTime, + "custom-form": customForm, + }, + methods: { + async validNumber(row, old) { + if (GetQueryString("id") === "") { + if (row.courseReservedNumber > row.coursePeopleNumber && row.reserveMode === 1) { + this.$alert("预留人数不能大于" + this.trainType + "人数!", "提示", { + confirmButtonText: "确定" + }) + row.courseReservedNumber = 0 + } + } else { + const registerUserCount = await this.getRegisterUserCount(row.id) + if (row.courseReservedNumber + registerUserCount > row.coursePeopleNumber) { + if (row.reserveMode === 1) { + let num = row.coursePeopleNumber - registerUserCount + let str = + "您设置的" + + this.trainType + + "人数为" + + row.coursePeopleNumber + + "人,当前报名人数为" + + registerUserCount + + "人,预留名额上限为" + + num + + "人!" + this.$alert(str, "提示", { + confirmButtonText: "确定" + }) + row.courseReservedNumber = 0 + } + } + } + }, + async getRegisterUserCount(courseId) { + const resp = await this.$axios.post("/platform/literacy/manage/getRegisterUserCount", { courseId }) + return resp.code === 0 ? resp.data : 0 + }, + courseTypeChange(val, row) { + row.reserveMode = 1 + }, + setSignUpCondition() { + if (this.formData.courseList !== undefined && this.formData.courseList.length > 0) { + const courseValid = this.formData.courseList.some((item, index) => { + if (item.courseType === undefined) { + this.$message.warning("请在" + (index + 1) + "行" + this.trainType + "信息中选择类型!") + return true + } + return false + }) + if (courseValid) { + return + } + const array = [...new Set(this.formData.courseList.map((o) => o.courseType))] + const typeArray = clone([...this.courseTypeList].filter((x) => array.some((y) => x.id === y))) + const arr = [] + typeArray.forEach((item) => { + const t = this.formData.typeLimits.find(o => o.typeId === item.id) + if (t) { + const type = this.courseTypeList.find(o => o.id === t.typeId) + t.code = type.code + t.typeName = type.typeName + arr.push(t) + } else { + arr.push({ + code: item.code, + typeName: item.typeName, + typeId: item.id, + limitNum: 0 + }) + } + }) + this.formData.typeLimits = arr + this.signUpDialog = true + } else { + this.$message.warning("请在" + this.trainType + "信息中选择类型!") + } + }, + doLimitNum() { + this.signUpDialog = false + }, + openMoreInfo(row, index) { + this.$refs.customFormRef.onOpen(this.formData, row, index) + }, + async removeTableCourse(index) { + const confirm = await this.$confirm( + "请确认是否删除此" + this.trainType + "?如果该" + this.trainType + "已有报名人员,会随之一起删除!确定吗?", + "提示", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + } + ) + if (confirm) { + this.formData.courseList.splice(index, 1) + } + }, + openSetUpCourseTime(index) { + this.$refs.courseTimeRef.onOpen(this.formData, index) + }, + courseOrderNumChange() { + this.formData.courseList = this.formData.courseList.sort((a, b) => a.orderNum - b.orderNum) + }, + addCourse() { + this.formData.courseList.push({ courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false }) + }, + async historicalActChange(val) { + const resp = await this.$axios.post("/platform/literacy/manage/findOne", {id: val}) + if (resp.code === 0) { + this.formData = resp.data + this.typeChange(this.formData.trainType) + this.formData.id = "" + } + }, + typeChange(val) { + const type = this.dict.type.LITERACY_SIGNUP_TYPE.find(o => o.code === val) + this.trainType = type?.name || "培训班" + }, + changeActivity(val) { + if (val) { + const group = this.activityGroupList.find(v => v.groupId === val) + this.$set(this.formData, "activityGroupName", group.groupName) + } else { + this.$set(this.formData, "activityGroupName", "全部教职工") + } + }, + async getActivityGroup() { + const { data } = await this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup") + return data + }, + async getHistoricalActList() { + const resp = await this.$axios.post("/platform/literacy/manage/getHistoricalActList", {}) + return resp.data + }, + async onSave() { + let valid = false + this.$refs.form.validateField("activityName", (errMsg) => { + valid = errMsg === "" + }) + if (!valid) { + this.$message.warning("请输入活动名称") + return + } + await this.doHandle('保存') + }, + onSubmit() { + this.$refs["form"].validate(async (valid, errMsg) => { + if (valid) { + const courseValid = this.formData.courseList.some((v, i) => { + const basicValid = v.courseName && v.coursePeopleNumber && v.courseLocation && v.courseInstructor && v.courseType + const timeValid = + v.courseTimeList.length > 0 && + v.courseTimeList.every((x) => { + return x.courseStartTime && x.courseEndTime && x.courseStartTime < x.courseEndTime + }) + if (!timeValid) { + this.$message.warning("第" + (i + 1) + "行时间填写有误,请核查") + return true + } + if (!basicValid) { + this.$message.warning("第" + (i + 1) + "行信息填写有误,请核查") + return true + } + if (v.isMobileSign === true && v.signType === 3 && (v.courseLocationCoordinates === undefined || v.courseLocationCoordinates.length < 2)) { + this.$message.warning("第" + (i + 1) + "行地点坐标填写有误,请核查") + return true + } + if (v.isMobileSign === true && v.signType === 3 && (v.signType === "" || v.signType === undefined)) { + this.$message.warning("第" + (i + 1) + "行签到方式填写有误,请核查") + return true + } + return false + }) + if (courseValid) return + if (this.formData.restrictLimit === 2 && this.formData.typeLimits.length === 0) { + this.$message.warning("请设置报名限制") + return + } + this.formData.isDisabled = false + await this.doHandle('提交') + } else { + if(Object.keys(errMsg).length > 0) { + this.$message.warning(errMsg[Object.keys(errMsg)[0]][0].message) + return + } + this.$message.warning("存在必填项未填写") + } + }) + }, + async doHandle(type) { + const cloneData = clone(this.formData) + cloneData.activitySignUpStartTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[0] : null + cloneData.activitySignUpEndTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[1] : null + cloneData.activityStartTime = cloneData.activityTime !== undefined ? cloneData.activityTime[0] : null + cloneData.activityEndTime = cloneData.activityTime !== undefined ? cloneData.activityTime[1] : null + if (cloneData.activityStartTime !== undefined && cloneData.activityStartTime !== null) { + cloneData.year = new Date(cloneData.activityStartTime).getFullYear() + } + cloneData.typeLimits = JSON.stringify(this.formData.typeLimits) + cloneData.courseList = JSON.stringify(cloneData.courseList) + const confirm = await this.$confirm("您确定要" + type + "吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + if (confirm !== "confirm") return + const resp = await this.$axios.post("/platform/literacy/manage/doHandle", cloneData) + if (resp.code === 0) { + this.$message.success(resp.msg) + this.step = 1 + this.$emit('refresh') + this.$emit('back') + } else { + this.$message.warning(resp.msg) + } + }, + async getAllType() { + const resp = await this.$axios.post("/platform/literacy/type/getAllType", {}) + return resp.data + }, + async init(row) { + if (row && row.id) { + const resp = await this.$axios.post("/platform/literacy/manage/findOne", {id: row.id}) + if (resp.code === 0) { + this.formData = resp.data + this.typeChange(this.formData.trainType) + } + } + }, + async initData(row) { + this.activityGroupList = await this.getActivityGroup() + this.historicalActList = await this.getHistoricalActList() + this.courseTypeList = await this.getAllType() + await this.init(row) + }, + }, + watch: { + 'formData.restrictLimit'(val) { + if (!this.formData.id) { + this.formData.limitNum = val === 3 ? 1 : '' + } + }, + 'formData.activityGroupId': { + async handler(newVal, oldVal) { + this.activityGroupList = await this.getActivityGroup() + this.userScopeDialog = false + }, + deep: true + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/courseTime.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/courseTime.js new file mode 100644 index 00000000..3835e7f4 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/courseTime.js @@ -0,0 +1,215 @@ +const courseTime = { + template: /*language=HTML*/ ` +
+ +
温馨提示:有人员报名后,禁止修改下列时间,如有修改,请联系管理员
+
选择日期
+ +
设置时间
+ + + + 一键设置开始/结束时间 + 报名人数是否限制: + + + + + + + + + + + + + + + + + + + + + + + 确定 + +
+
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + const that = this + return { + setUpCourseDialog: false, + courseIndex: 0, + formData: {}, + courseTimeOneKeySet: { + startTime: "", + endTime: "" + }, + setUpCoursePickerOptions: { + disabledDate(time) { + return ( + time.getTime() < Date.parse(that.$moment(that.formData.activityTime[0]).format("YYYY-MM-DD") + " 00:00:00") || + time.getTime() > Date.parse(that.$moment(that.formData.activityTime[1]).format("YYYY-MM-DD") + " 00:00:00") + ) + } + }, + } + }, + methods: { + removeSetUpTableCourseRow(row, index) { + this.formData.courseList[this.courseIndex].courseTimeList.splice(index, 1) + //培训时间列表日期数组 + const courseDateArray = this.formData.courseList[this.courseIndex].courseTimeList.map((v) => + this.$moment(v.courseDate).format("YYYY-MM-DD") + ) + //选择课程日期数组 + const scdList = this.formData.courseList[this.courseIndex].setUpCourseData + + this.formData.courseList[this.courseIndex].setUpCourseData = scdList.filter((v) => { + return courseDateArray.includes(this.$moment(v).format("YYYY-MM-DD")) + }) + }, + oneKeySetStartEndTime() { + const { startTime, endTime } = this.courseTimeOneKeySet + this.formData.courseList[this.courseIndex].courseTimeList.forEach((v) => { + this.$set(v, "courseStartTime", startTime) + this.$set(v, "courseEndTime", endTime) + }) + this.$forceUpdate() + }, + setUpCourseDataChange(val) { + if (!val) { + this.formData.courseList[this.courseIndex].courseTimeList = [] + return + } + //培训时间日期Set + if (this.formData.courseList[this.courseIndex].courseTimeList === undefined) { + this.$set(this.formData.courseList[this.courseIndex], "courseTimeList", []) + } + const ctList = new Set( + this.formData.courseList[this.courseIndex].courseTimeList.map((v) => this.$moment(v.courseDate).format("YYYY-MM-DD")) + ) + val.forEach((v) => { + if (!ctList.has(v)) { + this.formData.courseList[this.courseIndex].courseTimeList.push({ + courseDate: v, + courseTime: null + }) + } + }) + this.formData.courseList[this.courseIndex].courseTimeList = this.formData.courseList[this.courseIndex].courseTimeList.filter((v) => { + return val.includes(this.$moment(v.courseDate).format("YYYY-MM-DD")) + }) + this.formData.courseList[this.courseIndex].courseTimeList.sort((a, b) => { + return Date.parse(a["courseDate"]) - Date.parse(b["courseDate"]) + }) + }, + //设置课程时间确定 + doConfirmSetUpCourse() { + const courseTableData = this.formData.courseList[this.courseIndex].courseTimeList + if (courseTableData.length === 0) { + this.$message.warning("请填写时间!") + return + } + if (courseTableData && courseTableData.length > 0) { + const valid = courseTableData.every((v) => v.courseStartTime && v.courseEndTime && v.courseStartTime < v.courseEndTime) + if (!valid) { + this.$message.warning("时间填写不完整或者有误!") + return + } + this.setUpCourseDialog = false + } + }, + onOpen(formData, index) { + this.formData = formData + this.courseIndex = index + if (!this.formData.activityTime || this.formData.activityTime.length === 0) { + this.$message.warning("请先设置活动起止时间") + return + } + this.courseIndex = index + this.setUpCourseDialog = true + }, + }, + created() { + if(!this.formData.courseList) { + this.formData = {courseList: [{unionLimit: []}]} + } + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/customForm.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/customForm.js new file mode 100644 index 00000000..62452b20 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/customForm.js @@ -0,0 +1,210 @@ + +const customForm = { + template: /*language=HTML*/ ` +
+ + + + 分工会人数限制 + + + + 设置分工会人数限制 + + + 已设置 + + 未设置 + + + + + + 承办工会 + + + + + + + + + + + 对内报名时间 + + + + + + + + + 是否签到 + + + + 签到 + 不签到 + + + + + + + 签到方式 + + + + 扫描二维码 + 被扫 + GPS定位签到 + + + + + + + 地点坐标 + + + 设置签到点 + + + + + + 是否领取礼品 + + + + 领取 + 不领取 + + + + + + + 领取方式 + + + + 扫描二维码 + 面对面确认 + + + + + + + 报名方式 + + + + 报名人员减少模式 + 候补模式 + + + + + + 候补数量 + + + + + + + + + 详细信息 + + + + + + +
+ 取 消 + 保 存 +
+
+ + + + + 确 定 + + + + +
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + moreInfoDrawer: false, + unionList: [], + formData: {}, + moreInfoRow: {}, + moreInfoIndex: 0, + + mapDialog: false, + mapIndex: 0, + } + }, + components: { + "union-form": unionForm, + "map-container": httpVueLoader("/components/plugins/mapContainer/MapContainer.vue?v=1.0.1") + }, + methods: { + openMap(index) { + this.mapIndex = index + this.mapDialog = true + }, + openSetUpUnionLimit(index) { + this.$refs.unionFormRef.onOpen(this.formData, index) + }, + async onOpen(formData, chooseRow, index) { + this.formData = formData + this.moreInfoRow = chooseRow + this.moreInfoIndex = index + this.unionList = await this.$businessTool.listUnion() + this.moreInfoDrawer = true + }, + }, + created() { + if(!this.formData.courseList) { + this.formData = {courseList: [{unionLimit: []}]} + } + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html new file mode 100644 index 00000000..4523c77a --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html @@ -0,0 +1,201 @@ + + + + +
+ + + + + + + + + + + + + + + + 新建活动 + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + 关 闭 + +
+
+
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/info.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/info.js new file mode 100644 index 00000000..e05d8322 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/info.js @@ -0,0 +1,111 @@ +const info = { + template: /*language=HTML*/ ` +
+ + + + {{viewData.activityName}} + {{viewData.year}} + {{$moment(viewData.createdAt).format('YYYY-MM-DD HH:mm:ss')}} + {{viewData.activityStartTime}} + {{viewData.activityEndTime}} + {{viewData.activitySignUpStartTime}} + {{viewData.activitySignUpEndTime}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 关 闭 + + + + +
+
+
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + trainType: '', + viewData: {}, + courseTimeListDialog: false, + courseTimeList: [], + + viewMapDialog: false, + } + }, + methods: { + initData(id) { + this.$axios.post("/platform/literacy/manage/findOne", { id: id }) + .then((resp) => { + if (resp.code === 0) { + this.viewData = resp.data + const type = this.dict.type.LITERACY_SIGNUP_TYPE.find((o) => o.code === resp.data.trainType) + this.trainType = type?.name || "培训班" + } + }) + }, + openViewCourseTime(courseTimeList) { + this.courseTimeList = courseTimeList + this.courseTimeListDialog = true + }, + openViewMap(point) { + if (!Array.isArray(point)) { + this.$message.warning("没有设置点位,无法通过地图查看") + return + } + this.viewMapDialog = true + this.$nextTick(() => { + viewMap = new AMap.Map("viewMap", { + resizeEnable: true, + center: point, + zoom: 16 + }) + if (viewMarker) { + viewMap.remove(viewMarker) + } + viewMarker = new AMap.Marker({ + position: point, + offset: new AMap.Pixel(-13, -30) + }) + viewMap.add(viewMarker) + viewMap.setFitView(null, false, [150, 60, 100, 60]) + }) + }, + }, + style: /*language=CSS*/ ` + /deep/ .el-button--text { + padding: 0; + } + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/makeQrcode.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/makeQrcode.js new file mode 100644 index 00000000..7ba42a75 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/makeQrcode.js @@ -0,0 +1,84 @@ +const makeQrcode = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + + + + + + + + + 关 闭 + + +
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + courseDialog: false, + trainType: "", + courseList: [], + } + }, + methods: { + initData(row) { + this.courseList = row.courseList + const type = this.dict.type.LITERACY_SIGNUP_TYPE.find((o) => o.code === row.trainType) + this.trainType = type?.name || "培训班" + this.courseDialog = true + }, + makeCourseCode(row) { + const url = '/platform/literacy/mine/drivingScan' + const data = url + '?courseId=' + row.id + console.log(data) + const content = jrQrcode.getQrBase64(data) + let image = new Image() + image.src = content + let viewer = new Viewer(image, { + zIndex: 99999999, + }) + viewer.show() + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/unionForm.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/unionForm.js new file mode 100644 index 00000000..9271d71f --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/unionForm.js @@ -0,0 +1,221 @@ +const unionForm = { + template: /*language=HTML*/ ` +
+ +
+
分段设置
+
+ 应用分段设置 +
+
+ + + + + + + + + + + + + + + + + +
+ ({{index+1}}). + {{item}} +
+
+ +
+
比例设置
+
+ 一键比例: + + 应用比例设置 +
+
+ + + + + + + + + + + + +
+ 限制总人数:{{summaryCount}}人 +
+ 清空分工会人数限制 + 取消 + 确定 +
+
+
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + formData: {}, + unionLimitIndex: 0, + setUpUnionLimitDialog: false, + unionList: [], + unionUserNumCalc: [{}], + unionUserNumOneKeyRatio: null, + summaryCount: 0, + } + }, + computed: { + unionUserNumCalcTips() { + return this.unionUserNumCalc.map((v) => { + return ( + (v.startNum ? v.startNum : "?") + + "-" + + (v.endNum ? v.endNum : "?") + + "人的分工会,限报" + + (v.resultNum ? v.resultNum : "?") + + "人" + ) + }) + } + }, + methods: { + calSummaryCount() { + const array = this.formData.courseList[this.unionLimitIndex].unionLimit + if (array) { + this.summaryCount = array.reduce((prev, curr) => { + const value = Number(curr.limitCount) + if (!isNaN(value)) { + return prev + curr.limitCount + } else { + return prev + } + }, 0) + } + }, + async onOpen(formData, index) { + this.unionList = await this.$businessTool.listUnion() + this.formData = formData + this.unionLimitIndex = index + this.setUpUnionLimitDialog = true + if ( + !this.formData.courseList[this.unionLimitIndex].unionLimit || + this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0 + ) { + const resp = await this.$axios.get("/platform/literacy/manage/getUnionLimit", { + activityScopeId: this.formData.activityGroupId + }) + if (resp.code === 0) { + this.$set(this.formData.courseList[this.unionLimitIndex], "unionLimit", resp.data) + } + } + this.summaryCount = this.formData.courseList[this.unionLimitIndex].unionLimit.reduce((prev, curr) => { + const value = Number(curr.limitCount) + if (!isNaN(value)) { + return prev + curr.limitCount + } else { + return prev + } + }, 0) + }, + unionLimitQuickSetting() { + this.unionUserNumCalc.forEach((v, i) => { + const startNum = v.startNum + const endNum = v.endNum + const resultNum = v.resultNum + if (startNum > endNum) { + this.$message.warning("第" + (i + 1) + "行设置错误") + } else { + this.formData.courseList[this.unionLimitIndex].unionLimit.forEach((x) => { + if (x.teacherCount >= startNum && x.teacherCount <= endNum) { + x.limitCount = resultNum + } + }) + this.calSummaryCount() + } + }) + }, + doConfirmSetUpUnionLimit() { + this.setUpUnionLimitDialog = false + }, + //应用比例设置 + applyScaleSettings() { + this.formData.courseList[this.unionLimitIndex].unionLimit.forEach((v) => { + v.limitCount = parseFloat(((v.teacherCount * this.unionUserNumOneKeyRatio) / 100).toFixed(0)) + if (v.ratio) { + v.limitCount = parseFloat(((v.teacherCount * v.ratio) / 100).toFixed(0)) + } + }) + this.calSummaryCount() + }, + async clearUnionLimit() { + const confirm = await this.$confirm("确定要清空分工会人数限制吗, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + if ("confirm" === confirm) { + this.formData.courseList[this.unionLimitIndex].unionLimit = [] + this.unionUserNumOneKeyRatio = null + this.unionUserNumCalc = [{}] + this.setUpUnionLimitDialog = false + } + }, + }, + created() { + if(!this.formData.courseList) { + this.formData = {courseList: [{unionLimit: []}]} + } + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/index.html new file mode 100644 index 00000000..f2cacdea --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/index.html @@ -0,0 +1,156 @@ + + + + +
+ + + + + + + + + + + + + + + + 导出报名人员 + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/info.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/info.js new file mode 100644 index 00000000..c20212d2 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/statistics/info.js @@ -0,0 +1,98 @@ +const info = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + {{key}} + + + + + + + + + + + + + +
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + registerUserTableData: [], + registerUserTableColumns: [ + { label: "姓名", prop: "username" }, + { label: "工号", prop: "loginname" }, + { label: "单位", prop: "unitName" }, + { label: "分工会", prop: "unionName" }, + { label: "联系方式", prop: "mobile" }, + { label: "报名时间", prop: "signUpTime" }, + { label: "报名状态", prop: "state" } + ], + cloneTableColumns: [ + {label: '姓名', prop: 'username'}, + {label: '工号', prop: 'loginname'}, + {label: '单位', prop: 'unitName'}, + {label: '分工会', prop: 'unionName'}, + {label: '联系方式', prop: 'mobile'}, + {label: '报名时间', prop: 'signUpTime'}, + {label: '报名状态', prop: 'state'}, + ], + userSignInfo: {}, + clickRow: {} + } + }, + methods: { + async onOpen(row) { + this.clickRow = row + const resp_register = await this.$axios.post(loc() + "/registerUserList", {courseId: row.id}) + this.registerUserTableData = resp_register.data + const resp_signInfo = await this.$axios.post(loc() + "/getSignInfo", {courseId: row.id}) + this.userSignInfo = resp_signInfo.data + const resp_columnInfo = await $.get(loc() + '/getTaleColumnInfo', {courseId: row.id}) + if (resp_columnInfo.data) { + this.registerUserTableColumns = [] + this.registerUserTableColumns = this.cloneTableColumns.concat(resp_columnInfo.data) + } + } + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/teacher/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/teacher/index.html new file mode 100644 index 00000000..4fed95de --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/teacher/index.html @@ -0,0 +1,194 @@ + + + + +
+ + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/type/basicForm.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/type/basicForm.js new file mode 100644 index 00000000..2313e614 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/type/basicForm.js @@ -0,0 +1,350 @@ +const basicForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + 携带 + 不携带 + + + + + 纳入 + 不纳入 + + + + + 纳入 + 不纳入 + + + + +
+
+ 报名填写字段 + + 注:移动端报名时字段的显示顺序会按照下面表格中的序号进行排列、字段编码不能重复 + +
+
+ + + 添加 + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 取 消 + 确 定 +
+ + + + + + + + + + + +
+ 取 消 + 确 定 +
+
+
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + formData: { + mobileSignColumnList: [{ isRequired: false }], + isBringFamily: false, + isAddFamily: false, + selfAddFamily: true, + }, + rules: { + typeName: [{ required: true, message: "请输入类型名称", trigger: ["change", "blur"] }], + code: [{ required: true, message: "请输入类型编码", trigger: ["change", "blur"] }], + isBringFamily: [{ required: true, message: "请选择是否携带家属", trigger: ["blur", "change"] }], + isAddFamily: [{ required: true, message: "请选择家属是否纳入总人数", trigger: ["blur", "change"] }] + }, + columnTypeOptions: [], + columnFormTypeList: [], + clickRow: {}, + paramFormRules: { + selectValues: [{ required: true, message: "请选择选项列表", trigger: ["blur"] }], + fileType: [{ required: true, message: "请选择文件类型", trigger: ["blur"] }], + fileNumber: [{ required: true, message: "请输入文件个数", trigger: ["blur", "change"] }] + }, + detailedParamsVisible: false, + } + }, + methods: { + isBringFamilyInput(o) { + this.$set(this.formData, "isAddFamily", o === true ? false : null) + if (o === true) { + this.formData.mobileSignColumnList.unshift({ + columnName: "携带亲属人数", + columnCode: "xdqsrs", + columnFormType: "INPUT", + columnType: "INT", + isRequired: true + }) + } else { + this.formData.mobileSignColumnList.forEach((item, index) => { + if (item.columnCode === "xdqsrs" && this.formData.isBringFamily === false) { + this.formData.mobileSignColumnList.splice(index, 1) + } + }) + } + }, + columnFormTypeChange(val, index) { + if (val === "FILE") { + this.formData.mobileSignColumnList[index].columnType = "JSON" + this.formData.mobileSignColumnList[index].isDisabled = true + } else { + this.formData.mobileSignColumnList[index].columnType = "" + this.formData.mobileSignColumnList[index].isDisabled = false + } + }, + doHandle() { + if (this.formData.id) { + this.doEdit() + } else { + this.doAdd() + } + }, + async doDetailParams() { + const isValid = await this.$refs["paramForm"].validate() + if (isValid) { + this.detailedParamsVisible = false + } + }, + openDetailedParams(row, index) { + this.clickRow = row + this.detailedParamsVisible = true + if (this.$refs["paramForm"]) this.$refs["paramForm"].clearValidate() + }, + doAdd() { + this.$refs["addForm"].validate((valid) => { + if (valid) { + const newListLength = new Set(this.formData.mobileSignColumnList.map((item) => item.columnCode)).size + const listLength = this.formData.mobileSignColumnList.length + if (listLength > newListLength) { + this.$message.warning('字段编码不能重复') + return + } + const cloneData = clone(this.formData) + this.$axios.post(loc() + "/doAdd", { data: JSON.stringify(cloneData) }).then((res) => { + if (res.code === 0) { + this.$message.success(res.msg) + this.$emit('refresh') + } else { + this.$message.error(res.msg) + } + }) + } + }) + }, + doEdit() { + this.$refs["addForm"].validate((valid) => { + if (valid) { + const newListLength = new Set(this.formData.mobileSignColumnList.map((item) => item.columnCode)).size + const listLength = this.formData.mobileSignColumnList.length + if (listLength > newListLength) { + this.$message.warning('字段编码不能重复') + return + } + const cloneData = clone(this.formData) + cloneData.mobileSignColumnList = JSON.stringify(cloneData.mobileSignColumnList) + this.$axios.post(loc() + "/doEdit", cloneData).then((res) => { + if (res.code === 0) { + this.$message.success(res.msg) + this.$emit('refresh') + } else { + this.$message.error(res.msg) + } + }) + } + }) + }, + async getColTypeOptions() { + const resp = await this.$axios.get(loc() + "/getColumnType") + this.columnTypeOptions = resp.data + }, + async getEnumOptions() { + const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: "ColumnFormTypeEnum" }) + return resp.data + }, + initData(row) { + if(row && row.id) { + this.formData = JSON.parse(JSON.stringify(row)) + this.formData.mobileSignColumnList.forEach((item) => { + item.isDisabled = item.columnFormType === "FILE" + }) + } else { + this.formData = { + mobileSignColumnList: [{ isRequired: false }], + isBringFamily: false, + isAddFamily: false, + selfAddFamily: true, + } + if (this.$refs["addForm"]) this.$refs["addForm"].resetFields() + } + }, + }, + async created() { + await this.getColTypeOptions() + this.columnFormTypeList = await this.getEnumOptions() + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/type/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/type/index.html new file mode 100644 index 00000000..7aee3621 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/type/index.html @@ -0,0 +1,120 @@ + + + + +
+ + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/index.html new file mode 100644 index 00000000..4580cbfb --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/index.html @@ -0,0 +1,144 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/userInfo.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/userInfo.js new file mode 100644 index 00000000..2f820f97 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/userAdjust/userInfo.js @@ -0,0 +1,224 @@ +const userInfo = { + template: /*language=HTML*/ ` +
+
{{ registerCourse.courseName + '报名人员' }}
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + 注:如单选为灰色选择不了,则表示对应的{{ trainType }}人数已满!候补报名不做调整。 + + + + + + + + + + + + + 取 消 + 确 定 + + +
+ `, + dicts: ["LITERACY_SIGNUP_TYPE"], + data() { + return { + afterAdjustCourse: "", + adjustDialogVisible: false, + unionList: [], + unitList: [], + registerForm: { + unionId: "", + unitId: "" + }, + registerCourse: {}, + courseList: [], + userInfo: {}, + chooseRow: {}, + registerUserTableData: [], + registerUserTableColumns: [ + { label: "姓名", prop: "username" }, + { label: "工号", prop: "loginname" }, + { label: "单位", prop: "unitName" }, + { label: "分工会", prop: "unionName" }, + { label: "联系方式", prop: "mobile" }, + { label: "报名时间", prop: "signUpTime" }, + { label: "报名状态", prop: "state" } + ], + trainType: '', + activity: {}, + } + }, + methods: { + async onOpen(row, activity) { + this.registerCourse = row + this.registerForm.courseId = row.id + this.activity = activity + const resp_register = await this.$axios.post(loc() + "/registerUserList", this.registerForm) + this.registerUserTableData = resp_register.data + + const type = this.dict.type.LITERACY_SIGNUP_TYPE.find(o => o.code === activity.trainType) + this.trainType = type?.name || "培训班" + }, + getCurrentRow(row) { + this.chooseRow = row + }, + async doAdjust() { + if (!this.afterAdjustCourse) { + this.$message.warning("请选择要调整的" + this.trainType + "!") + return + } + this.$confirm( + "您确定要将" + + "" + + this.userInfo.username + + "" + + "的报名信息调整到" + + "" + + this.chooseRow.courseName + + "" + + "中吗?", + "提示", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + dangerouslyUseHTMLString: true + } + ) + .then(async () => { + const loading = this.$loading({ + lock: true, + text: "努力调整中,感谢您的耐心等待。。。", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)" + }) + const resp = await this.$axios.post(loc() + "/adjust", { + activityId: this.activity.id, + oldCourseId: this.registerCourse.id, + newCourseId: this.afterAdjustCourse, + userId: this.userInfo.userId + }) + loading.close() + if (resp.code === 0) { + this.$message.success(resp.msg) + this.adjustDialogVisible = false + await this.registerSearch() + this.$emit("refresh", null) + } else { + this.$message.warning(resp.msg) + } + }) + .catch(() => {}) + }, + async adjust(o) { + this.userInfo = o + this.afterAdjustCourse = "" + await this.getCourse(this.activity.id) + this.adjustDialogVisible = true + }, + deleteSignUser(o) { + this.$confirm("您确定要删除" + "" + o.username + "" + "的报名信息吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + dangerouslyUseHTMLString: true + }) + .then(async () => { + const resp = await this.$axios.post(loc() + "/deleteSignUser", { + activityId: this.activity.id, + courseId: this.registerCourse.id, + userId: o.userId + }) + if (resp.code === 0) { + this.$message.success(resp.msg) + await this.registerSearch() + this.$emit("refresh", null) + } else { + this.$message.warning(resp.msg) + } + }) + .catch(() => {}) + }, + async registerSearch() { + this.registerForm.courseId = this.registerCourse.id + const resp_register = await $.get(loc() + "/registerUserList", this.registerForm) + this.registerUserTableData = resp_register.data + }, + async getCourse(val) { + const {data} = await this.$axios.post(loc() + "/getCourse", {activityId: val}) + this.courseList = data + } + }, + async created() { + this.unionList = await this.$businessTool.listUnion() + this.unitList = await this.$businessTool.listUnit(this.registerForm.unionId) + }, + style: /*language=CSS*/ ` + /deep/ .adjustDialog .el-radio__label { + display: none; + } + /deep/ .adjustDialog .el-dialog__body { + max-height: 600px; + overflow-y: auto; + } + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/userManage/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/userManage/index.html new file mode 100644 index 00000000..ad52f613 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/userManage/index.html @@ -0,0 +1,235 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + 补充人员 + 导出签到名单 + 导出领取名单 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + 确 定 + + +
+ + + + diff --git a/src/main/resources/views/platform/zhghh5/activity/trainSignUp/list/applyForm.js b/src/main/resources/views/platform/zhghh5/activity/trainSignUp/list/applyForm.js index eaaa5101..c8a90763 100644 --- a/src/main/resources/views/platform/zhghh5/activity/trainSignUp/list/applyForm.js +++ b/src/main/resources/views/platform/zhghh5/activity/trainSignUp/list/applyForm.js @@ -150,7 +150,7 @@ const applyForm = { }, }, style: /*language=CSS*/ ` - .button { + /deep/ .button { position: fixed; bottom: 0; width: 100%; diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/literacy/apply/index.html b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/apply/index.html new file mode 100644 index 00000000..130e1a05 --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/apply/index.html @@ -0,0 +1,165 @@ + + + + +
+ + + + + + + + + + + + + + + + +
+
+ +
{{infoRow.activityName}}
+ +
+
+ + + 去报名 + + + +
+
+
+ +
+ + + + diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/literacy/common/times.js b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/common/times.js new file mode 100644 index 00000000..ea58d8e6 --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/common/times.js @@ -0,0 +1,89 @@ +const times = { + template: + /*language=HTML*/ + ` +
+ + + + + + + +
+ `, + store, + data() { + return { + visible:false, + row: null, + weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'}, + + selectCourseTime: {}, + signVisible: false, + } + }, + components: { + "scan-code": httpVueLoader("/components/plugins/sysScanCode/index.vue?v=" + new Date().getTime()) + }, + methods: { + onSignClose() { + this.$refs.scanCodeRef.closeScan() + }, + onOpen(row) { + this.row = row + this.visible = true + }, + onSign(courseTime) { + this.selectCourseTime = courseTime + if(this.row.signType === 1) { + this.signVisible = true + this.$nextTick(() => { + this.$refs.scanCodeRef.init() + }) + } + if(this.row.signType === 2) { + this.makeCode() + } + if(this.row.signType === 3) { + this.$toast('此签到模式正在升级中') + } + }, + makeCode() { + const url = '/platform/literacy/mine/passiveScan' + const data = url + '?id=' + this.selectCourseTime.id + console.log(data) + const content = jrQrcode.getQrBase64(data) + vant.ImagePreview([content]) + }, + onClose(){ + this.visible = false + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/applyForm.js b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/applyForm.js new file mode 100644 index 00000000..a3d7cdda --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/applyForm.js @@ -0,0 +1,159 @@ +const applyForm = { + template: + /*language=HTML*/ + ` +
+ + + + + + + + + + + + + + + + + +
+ 提交 +
+
+
+
+ `, + data() { + return { + row: {}, + activity: {}, + dynamicColumnsData: [], + visible: false, + formData: {}, + showCoursePicker: false, + courseTimeSelectList: [], + } + }, + components: { + "train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue") + }, + methods: { + async onOpen(row, courseType) { + this.row = row + this.init(row, courseType) + if(row.courseIsLimitApply) { + await this.getCourseTimeSelectList(row) + } + this.visible = true + }, + init(row, courseType) { + this.$set(this.formData, 'username', this.$store.state.user.username) + this.$set(this.formData, 'loginname', this.$store.state.user.loginname) + this.$set(this.formData, 'unionName', this.$store.state.user.union.name) + this.$set(this.formData, 'unitName', this.$store.state.user.unit.name) + this.$set(this.formData, 'sex', this.$store.state.user.sex) + this.$set(this.formData, 'activityId', row.activityId) + this.$set(this.formData, 'courseId', row.id) + + this.dynamicColumnsData = courseType ? courseType.trainMobileSignColumnList : [] + this.dynamicColumnsData.forEach((item) => { + item.columnValue = this.$store.state.user[item.columnCode] || "" + }) + }, + onCourseConfirm(val){ + this.formData.activityCourseId = val.value + this.$set(this.formData, "activityCourseId", val.value) + this.$set(this.formData, "courseTimeName", val.text.substring(0, 12)) + this.showCoursePicker = false + }, + async getCourseTimeSelectList(o) { + const resp = await this.$axios.post('/platform/literacy/apply/getCourseTimeSelectList',{courseId: o.id}) + if (resp.code === 0) { + this.courseTimeSelectList = resp.data + } else { + this.$toast.fail("获取时段信息失败,请联系管理员") + } + }, + async validateSignUp() { + // 验证自定义表单 + await this.$refs.dynamicForm.$refs.form.validate() + // 获取家属人数 + let familyCount = this.dynamicColumnsData.filter(o => o.columnCode === 'xdqsrs').reduce((sum, item) => { + return sum + (Number(item.columnValue) || 0) + }, 0) + + const res = await this.$axios.post("/platform/literacy/apply/validateSignUp", { + courseId: this.formData.courseId, + currentFamilyNumber: familyCount + }) + return res.code === 0 + }, + async validateCourseTime() { + const res = await this.$axios.post('/platform/literacy/apply/validateSourceSignUp', { + activityCourseId: this.formData.activityCourseId, + courseId: this.row.id + }) + return res.code === 0 + }, + async onSubmit() { + if(!await this.validateSignUp()) return + + this.$refs.formRef.validate().then(() => { + this.$dialog.confirm({ + title: "提示", + message: "您确定要提交吗?" + }).then(async () => { + if (this.row.courseIsLimitApply) { + if(!await this.validateCourseTime()) return + } + + const mobileColumnsValue = this.dynamicColumnsData.map((v) => { + return { + columnName: v.columnName, + columnValue: v.columnValue, + columnCode: v.columnCode, + columnFormType: v.columnFormType + } + }) + this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue) + this.$axios.post("/platform/literacy/apply/doSignUp", this.formData).then(res => { + if (res.code === 0) { + this.$toast(res.msg) + this.visible = false + this.$emit('refresh') + } + }) + }) + }) + }, + }, + style: /*language=CSS*/ ` + /deep/ .button { + position: fixed; + bottom: 0; + width: 100%; + } + ` +} diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/index.html b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/index.html new file mode 100644 index 00000000..989be05e --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/list/index.html @@ -0,0 +1,231 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/literacy/mine/index.html b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/mine/index.html new file mode 100644 index 00000000..33e969be --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/dayofficework/literacy/mine/index.html @@ -0,0 +1,132 @@ + + + + +
+ + + + + + + + + + + + + + + + +
+
+ +
{{infoRow.activityName}}
+ +
+
+
+ +
+ + + + From 8f835e3fc7d32426c4af5ee7c5eac24b09e617e7 Mon Sep 17 00:00:00 2001 From: "@jyuhsin" <729757837@qq.com> Date: Mon, 29 Sep 2025 08:59:18 +0800 Subject: [PATCH 4/4] commit --- .../manage/LiteracyCourseController.java | 84 ++++++- .../literacy/models/LiteracyActivity.java | 6 +- .../models/LiteracyActivityCourse.java | 6 +- .../literacy/models/LiteracyBlackList.java | 7 +- .../literacy/models/LiteracyCourse.java | 132 +--------- .../models/LiteracyMobileSignColumn.java | 8 +- .../literacy/models/LiteracySourceCourse.java | 145 +++++++++++ .../literacy/models/LiteracyTeacher.java | 8 +- .../literacy/models/LiteracyType.java | 8 +- .../literacy/models/LiteracyTypeLimit.java | 8 +- .../literacy/models/LiteracyUser.java | 6 +- .../literacy/models/LiteracyUserCourse.java | 6 +- .../activity/trainSignUp/manage/index.html | 13 +- .../literacy/course/basicForm.js | 231 ++++++++++++++++++ .../literacy/course/courseTime.js | 189 ++++++++++++++ .../dayofficework/literacy/course/index.html | 57 ++++- .../dayofficework/literacy/course/info.js | 80 ++++++ .../literacy/manage/basicForm.js | 10 +- .../dayofficework/literacy/manage/index.html | 13 +- 19 files changed, 853 insertions(+), 164 deletions(-) create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracySourceCourse.java create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/course/basicForm.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/course/courseTime.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/literacy/course/info.js diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java index 07b6a0a7..533353c9 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/controller/manage/LiteracyCourseController.java @@ -1,18 +1,32 @@ package com.budwk.app.zhgh.dayofficework.literacy.controller.manage; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; import com.budwk.app.base.service.BaseService; +import com.budwk.app.base.utils.PageUtil; +import com.budwk.app.zhgh.dayofficework.literacy.models.LiteracySourceCourse; +import com.budwk.app.zhgh.dayofficework.literacy.models.LiteracyTeacher; import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Cnd; import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +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.util.NutMap; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; +import java.util.List; + /** * @ClassName LiteracyCourseController * @Author JyuHsin @@ -40,8 +54,76 @@ public class LiteracyCourseController { @At @SaCheckPermission("literacy.course") - public Result pageData(PageForm pageForm) { + public Result pageData(PageForm pageForm, + @Param("courseType") String courseType, + @Param("teacherId") String teacherId) { + Sql sql = Sqls.create(""" + SELECT + sc.*, + t.typeName, + te.NAME AS teacherName + FROM + `literacy_source_course` sc + LEFT JOIN literacy_type t ON sc.courseType = t.id + LEFT JOIN literacy_teacher te ON sc.courseInstructor = te.id + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and(Cnd.likeEX("sc.courseName", pageForm.getSearchKeyword())); + cnd.andEX("sc.courseType", "=", courseType); + cnd.andEX("sc.courseInstructor", "=", teacherId); + + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("sc.createdAt"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + + sql.setCondition(cnd); + Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("literacy.course") + @SLog(type = "职工素养-课程管理", tag = "新增/编辑", msg = "新增/编辑教师") + public Result submit(LiteracySourceCourse sourceCourse) { + if(StrUtil.isNotBlank(sourceCourse.getId())) { + dao.updateIgnoreNull(sourceCourse); + } else { + sourceCourse.setOpenOtherUnion(false); + dao.insert(sourceCourse); + } return Result.success(); } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("literacy.course") + @SLog(type = "职工素养-课程管理", tag = "删除", msg = "删除教师") + public Object delete(@Param(value = "id") String id) { + dao.clear(LiteracySourceCourse.class, Cnd.where("id", "=", id)); + return Result.success(); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("literacy") + public Object querySourceCourses() { + Sql sql = Sqls.create(""" + SELECT + sc.*, + t.typeName, + te.NAME AS teacherName, + te.NAME AS courseInstructor + FROM + `literacy_source_course` sc + LEFT JOIN literacy_type t ON sc.courseType = t.id + LEFT JOIN literacy_teacher te ON sc.courseInstructor = te.id + """); + List list = baseService.listMap(sql); + return Result.success(list); + } } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivity.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivity.java index 43a2f4d1..28a40e19 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivity.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivity.java @@ -21,8 +21,10 @@ import java.util.List; @EqualsAndHashCode(callSuper = false) public class LiteracyActivity extends BaseModel implements Serializable, SysHomeConvert { - @Name - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivityCourse.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivityCourse.java index bd8cde93..7a8b0e89 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivityCourse.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyActivityCourse.java @@ -15,8 +15,10 @@ import java.util.Date; @EqualsAndHashCode(callSuper = false) public class LiteracyActivityCourse { - @Name - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyBlackList.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyBlackList.java index 40145e6a..87d398bb 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyBlackList.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyBlackList.java @@ -13,9 +13,10 @@ import org.nutz.dao.interceptor.annotation.PrevInsert; @EqualsAndHashCode(callSuper = false) public class LiteracyBlackList { - @Name - @ColDefine(type = ColType.VARCHAR, width = 32) - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyCourse.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyCourse.java index a9d692fc..9c6ef458 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyCourse.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyCourse.java @@ -16,10 +16,12 @@ import java.util.List; @Comment("职工素养的子活动") @Table @EqualsAndHashCode(callSuper = false) -public class LiteracyCourse extends BaseModel implements Serializable { +public class LiteracyCourse extends LiteracySourceCourse implements Serializable { - @Name - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column @@ -27,137 +29,23 @@ public class LiteracyCourse extends BaseModel implements Serializable { @Comment("活动ID") private String activityId; - @Column - @ColDefine(type = ColType.VARCHAR, width = 50) - @Comment("课程名称") - private String courseName; - - @Column - @ColDefine(type = ColType.INT) - @Comment("课程人数") - private int coursePeopleNumber; - - @Column - @ColDefine(type = ColType.INT) - @Default(value = "0") - @Comment("预留名额") - private int courseReservedNumber; - - @Column - @ColDefine(type = ColType.VARCHAR, width = 50) - @Comment("课程地点") - private String courseLocation; - - @Column - @ColDefine(type = ColType.VARCHAR, width = 32) - @Comment("课程类型") - private String courseType; - - @Column - @ColDefine(type = ColType.MYSQL_JSON) - @Comment("课程地点坐标") - private List courseLocationCoordinates; - - @Column - @ColDefine(type = ColType.VARCHAR, width = 20) - @Comment("课程讲师") - private String courseInstructor; - - @Column - @ColDefine(type = ColType.VARCHAR, width = 32) - @Comment("校区") - private String campus; - - @Column - @ColDefine(type = ColType.BOOLEAN) - @Comment("报名人数是否限制") - private Boolean courseIsLimitApply; - - @Column - @ColDefine(type = ColType.INT) - @Comment("序号") - private int orderNum; - - @Column - @ColDefine(customType = "longtext") - @Comment("详细信息") - private String introduce; - @Many(field = "courseId") private List courseTimeList; + @Column + @Comment("分工会人数限制") + @ColDefine(type = ColType.MYSQL_JSON) + private List unionLimit; + //已报人数 private Integer hasRegisterNum; - private Boolean isBringFamily; - private Boolean isAddFamily; - //是否报过该课程 private Boolean isSign; - //还能报该类型的课程吗 private Boolean canSignThisCourseType; - - @Column - @Comment("分工会人数限制") - @ColDefine(type = ColType.MYSQL_JSON) - private List unionLimit; - - @Column - @ColDefine(type = ColType.BOOLEAN) - @Comment("移动端是否签到") - private boolean isMobileSign; - - @Column - @ColDefine(type = ColType.INT) - @Comment("签到方式 1.扫描二维码签到 2.被扫 3.gps签到") - private Integer signType; - - @Column - @ColDefine(type = ColType.BOOLEAN) - @Comment("移动端是否签收礼品") - private boolean isReceiveGift; - - @Column - @ColDefine(type = ColType.INT) - @Comment("领取礼品方式 1.扫描二维码 2.线下") - private Integer giftType; - - @Column - @ColDefine(type = ColType.INT) - @Comment("预留名额方式 1.报名人员减少模式 2.报名人数不变模式") - private Integer reserveMode; - - @Column - @Comment("承办工会") - @ColDefine(type = ColType.VARCHAR, width = 32) - private String hostUnionId; - - @Column - @Comment("对内报名时间") - @ColDefine(type = ColType.VARCHAR, width = 32) - private String interTime; - - @Column - @Comment("是否开放给其他工会") - @ColDefine(type = ColType.BOOLEAN, width = 4) - private Boolean openOtherUnion; - - @Column - @Comment("分类标识") - @ColDefine(type = ColType.VARCHAR, width = 30) - private String assort; - - @Column - @ColDefine(type = ColType.INT) - @Default(value = "0") - @Comment("候补名额数") - private Integer waitingNum; - //候补已报人数 private Integer hasWaitingNum; - private String courseTimeName; - } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyMobileSignColumn.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyMobileSignColumn.java index 8e4f23e1..252c3ebc 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyMobileSignColumn.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyMobileSignColumn.java @@ -17,10 +17,10 @@ public class LiteracyMobileSignColumn { private static final long serialVersionUID = 1L; - @Name - @Comment("id") - @ColDefine(type = ColType.VARCHAR, width = 32) - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracySourceCourse.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracySourceCourse.java new file mode 100644 index 00000000..0cd85442 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracySourceCourse.java @@ -0,0 +1,145 @@ +package com.budwk.app.zhgh.dayofficework.literacy.models; + +import cn.hutool.json.JSONObject; +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; +import org.nutz.lang.util.NutMap; + +import java.util.List; + +/** + * @ClassName LiteracySourceCourse + * @Author JyuHsin + * @Date 2025/9/28 14:46 + * @Version 1.0 + * @Description TODO + */ +@Data +@Accessors(chain = true) +@Comment("职工素养-课程管理") +@Table +@EqualsAndHashCode(callSuper = false) +public class LiteracySourceCourse extends BaseModel { + + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 50) + @Comment("课程名称") + private String courseName; + + @Column + @ColDefine(type = ColType.INT) + @Comment("课程人数") + private int coursePeopleNumber; + + @Column + @ColDefine(type = ColType.INT) + @Default(value = "0") + @Comment("预留名额") + private int courseReservedNumber; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 50) + @Comment("课程地点") + private String courseLocation; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 32) + @Comment("课程类型") + private String courseType; + + @Column + @ColDefine(type = ColType.MYSQL_JSON) + @Comment("课程地点坐标") + private List courseLocationCoordinates; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 50) + @Comment("课程讲师") + private String courseInstructor; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 32) + @Comment("校区") + private String campus; + + @Column + @ColDefine(type = ColType.BOOLEAN) + @Comment("报名人数是否限制") + private Boolean courseIsLimitApply; + + @Column + @ColDefine(type = ColType.INT) + @Comment("序号") + private int orderNum; + + @Column + @ColDefine(customType = "longtext") + @Comment("详细信息") + private String introduce; + + @Column + @ColDefine(type = ColType.BOOLEAN) + @Comment("移动端是否签到") + private boolean isMobileSign; + + @Column + @ColDefine(type = ColType.INT) + @Comment("签到方式 1.扫描二维码签到 2.被扫 3.gps签到") + private Integer signType; + + @Column + @ColDefine(type = ColType.BOOLEAN) + @Comment("移动端是否签收礼品") + private boolean isReceiveGift; + + @Column + @ColDefine(type = ColType.INT) + @Comment("领取礼品方式 1.扫描二维码 2.线下") + private Integer giftType; + + @Column + @ColDefine(type = ColType.INT) + @Comment("预留名额方式 1.报名人员减少模式 2.报名人数不变模式") + private Integer reserveMode; + + @Column + @Comment("承办工会") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String hostUnionId; + + @Column + @Comment("对内报名时间") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String interTime; + + @Column + @Comment("是否开放给其他工会") + @ColDefine(type = ColType.BOOLEAN, width = 4) + private Boolean openOtherUnion; + + @Column + @Comment("分类标识") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String assort; + + @Column + @ColDefine(type = ColType.INT) + @Default(value = "0") + @Comment("候补名额数") + private Integer waitingNum; + + @Column + @ColDefine(type = ColType.MYSQL_JSON) + @Comment("时间段") + private List timeList; +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java index e9cd345a..d5605adc 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTeacher.java @@ -20,10 +20,10 @@ public class LiteracyTeacher extends BaseModel implements Serializable { @Serial private static final long serialVersionUID = 1L; - @Name - @Comment("id") - @ColDefine(type = ColType.VARCHAR, width = 32) - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyType.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyType.java index 94787cc6..1cc0edbb 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyType.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyType.java @@ -21,10 +21,10 @@ public class LiteracyType extends BaseModel implements Serializable { @Serial private static final long serialVersionUID = 1L; - @Name - @Comment("id") - @ColDefine(type = ColType.VARCHAR, width = 32) - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTypeLimit.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTypeLimit.java index f6bbbde6..59624c35 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTypeLimit.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyTypeLimit.java @@ -17,10 +17,10 @@ public class LiteracyTypeLimit implements Serializable { private static final long serialVersionUID = 1L; - @Name - @Comment("id") - @ColDefine(type = ColType.VARCHAR, width = 32) - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUser.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUser.java index d581fad0..f7dcd15c 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUser.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUser.java @@ -19,8 +19,10 @@ import java.util.List; @TableIndexes({@Index(name = "INDEX_TRAIN_SIGN_UP_USER_COURSEID", fields = {"courseId"}, unique = false)}) public class LiteracyUser implements Serializable { - @Name - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUserCourse.java b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUserCourse.java index dbef4c26..3fc26190 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUserCourse.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/literacy/models/LiteracyUserCourse.java @@ -20,8 +20,10 @@ import java.util.Date; }) public class LiteracyUserCourse implements Serializable { - @Name - @PrevInsert(uu32 = true) + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) private String id; @Column diff --git a/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/index.html b/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/index.html index 0366ed3f..5aa7908e 100644 --- a/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/index.html +++ b/src/main/resources/views/platform/zhgh/activity/trainSignUp/manage/index.html @@ -3,7 +3,18 @@ layout("/layouts/platform.html"){ #-->
diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/basicForm.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/basicForm.js new file mode 100644 index 00000000..fc6e4623 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/basicForm.js @@ -0,0 +1,231 @@ + +const basicForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 点击设置课程时间 + 您已设置{{ formData.timeList.length || 0 }}个课程时间 + + + + + + 签到 + 不签到 + + + + + + + 扫描二维码 + 被扫 + GPS定位签到 + + + + + + 点击设置地点坐标 + + + + + + 领取 + 不领取 + + + + + + + 扫描二维码 + 面对面确认 + + + + + + + 报名人员减少模式 + 候补模式 + + + + + + + + + + + + + + +
+ 取 消 + 确 定 +
+ + +
+ `, + dicts: ["USER_CAMPUS"], + data() { + return { + formData: { + courseReservedNumber: 0, + timeList: [], + unionLimit: [], + isMobileSign: false, + signType: 1, + isReceiveGift: false, + giftType: 1, + reserveMode: 1, + }, + rules: { + courseName: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + courseType: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + coursePeopleNumber: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + courseReservedNumber: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + campus: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + courseLocation: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + courseInstructor: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + timeList: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + isMobileSign: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + signType: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + isReceiveGift: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + giftType: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + reserveMode: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + waitingNum: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + courseLocationCoordinates: [{ required: true, message: "必填", trigger: ["change", "blur"] }], + }, + typeOptions: [], + teacherOptions: [], + unionList: [], + } + }, + components: { + "course-time": courseTime, + }, + methods: { + onOpen(row) { + if(row && row.timeList) { + row.timeList = JSON.parse(row.timeList) + } + this.formData = clone(row) + }, + async submit() { + const valid = await this.$refs["form"].validate() + if (valid) { + this.$confirm("您确定要提交吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(() => { + const formData = clone(this.formData) + formData.timeList = JSON.stringify(formData.timeList) + this.$axios.post('/platform/literacy/course/submit', formData).then(res => { + if (res.code === 0) { + this.$message.success(res.msg) + this.$emit('refresh') + } + }) + }) + } + }, + openSetUpCourseTime() { + this.$refs.courseTimeRef.onOpen(this.formData) + }, + async getTypeOptions() { + const resp = await this.$axios.post("/platform/literacy/type/getAllType") + this.typeOptions = resp.data + }, + async getTeacherOptions() { + const resp = await this.$axios.post("/platform/literacy/teacher/queryTeachers") + this.teacherOptions = resp.data + }, + }, + async created() { + await this.getTypeOptions() + await this.getTeacherOptions() + this.unionList = await this.$businessTool.listUnion() + + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/courseTime.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/courseTime.js new file mode 100644 index 00000000..2c4d309c --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/courseTime.js @@ -0,0 +1,189 @@ +const courseTime = { + template: /*language=HTML*/ ` +
+ +
温馨提示:有人员报名后,禁止修改下列时间,如有修改,请联系管理员
+
选择日期
+ +
设置时间
+ + + + 一键设置开始/结束时间 + 报名人数是否限制: + + + + + + + + + + + + + + + + + + + + + + + 确定 + +
+
+ `, + data() { + return { + setUpCourseDialog: false, + formData: {}, + courseTimeOneKeySet: { + startTime: "", + endTime: "" + }, + } + }, + methods: { + removeSetUpTableCourseRow(row, index) { + this.formData.timeList.splice(index, 1) + //培训时间列表日期数组 + const courseDateArray = this.formData.timeList.map((v) => + this.$moment(v.courseDate).format("YYYY-MM-DD") + ) + //选择课程日期数组 + const scdList = this.formData.setUpCourseData + this.formData.setUpCourseData = scdList.filter((v) => { + return courseDateArray.includes(this.$moment(v).format("YYYY-MM-DD")) + }) + }, + oneKeySetStartEndTime() { + const { startTime, endTime } = this.courseTimeOneKeySet + this.formData.timeList.forEach((v) => { + this.$set(v, "courseStartTime", startTime) + this.$set(v, "courseEndTime", endTime) + }) + this.$forceUpdate() + }, + setUpCourseDataChange(val) { + if (!val) { + this.formData.timeList = [] + return + } + //培训时间日期Set + if (this.formData.timeList === undefined) { + this.$set(this.formData, "timeList", []) + } + const ctList = new Set( + this.formData.timeList.map((v) => this.$moment(v.courseDate).format("YYYY-MM-DD")) + ) + val.forEach((v) => { + if (!ctList.has(v)) { + this.formData.timeList.push({ + courseDate: v, + courseTime: null + }) + } + }) + this.formData.timeList = this.formData.timeList.filter((v) => { + return val.includes(this.$moment(v.courseDate).format("YYYY-MM-DD")) + }) + this.formData.timeList.sort((a, b) => { + return Date.parse(a["courseDate"]) - Date.parse(b["courseDate"]) + }) + }, + //设置课程时间确定 + doConfirmSetUpCourse() { + const courseTableData = this.formData.timeList + if (courseTableData.length === 0) { + this.$message.warning("请填写时间!") + return + } + if (courseTableData && courseTableData.length > 0) { + const valid = courseTableData.every((v) => v.courseStartTime && v.courseEndTime && v.courseStartTime < v.courseEndTime) + if (!valid) { + this.$message.warning("时间填写不完整或者有误!") + return + } + this.setUpCourseDialog = false + } + }, + onOpen(formData) { + this.formData = formData + this.setUpCourseDialog = true + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html index 46f2b9c9..e69ab1a5 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/index.html @@ -12,7 +12,7 @@ layout("/layouts/platform.html"){ - + - - + + @@ -67,15 +67,17 @@ layout("/layouts/platform.html"){
diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/info.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/info.js new file mode 100644 index 00000000..334f9411 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/course/info.js @@ -0,0 +1,80 @@ +const info = { + template: ` +
+ + + {{viewData.courseName}} + + + {{viewData.typeName}} + + + {{viewData.coursePeopleNumber}} + + + {{viewData.courseReservedNumber}} + + + {{viewData.campus}} + + + {{viewData.courseLocation}} + + + {{viewData.teacherName}} + + + {{viewData.assort}} + + + + + + + + + {{viewData.isMobileSign ? '签到' : '不签到'}} + + + 扫描二维码 + 被扫 + GPS签到 + + + {{viewData.isReceiveGift ? '领取' : '不领取'}} + + + 扫描二维码 + 面对面确认 + + + {{viewData.reserveMode ? '报名人员减少模式' : '候补模式'}} + + + {{viewData.waitingNum}} + + + + + + + + + + +
+ `, + data() { + return { + viewData: {}, + } + }, + methods: { + onOpen(row) { + if(row && row.timeList) { + row.timeList = JSON.parse(row.timeList) + } + this.viewData = clone(row) + } + } +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js index 461cdc24..cc502807 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/basicForm.js @@ -158,7 +158,9 @@ const basicForm = { @@ -331,6 +333,7 @@ const basicForm = { }, campusList: [], courseTypeList: [], + sourceCourseList: [], } }, components: { @@ -566,10 +569,15 @@ const basicForm = { } } }, + async querySourceCourses() { + const resp = await this.$axios.post("/platform/literacy/course/querySourceCourses", {}) + return resp.data + }, async initData(row) { this.activityGroupList = await this.getActivityGroup() this.historicalActList = await this.getHistoricalActList() this.courseTypeList = await this.getAllType() + this.sourceCourseList = await this.querySourceCourses() await this.init(row) }, }, diff --git a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html index 4523c77a..096e347a 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/literacy/manage/index.html @@ -3,7 +3,18 @@ layout("/layouts/platform.html"){ #-->