diff --git a/src/main/java/com/budwk/app/base/constant/RoleConstant.java b/src/main/java/com/budwk/app/base/constant/RoleConstant.java index 1a1eb9e8..c5231a4a 100644 --- a/src/main/java/com/budwk/app/base/constant/RoleConstant.java +++ b/src/main/java/com/budwk/app/base/constant/RoleConstant.java @@ -49,6 +49,7 @@ RoleConstant { TEACHER_CONGRESS_DELEGATE_ATTENDANCE("教代会列席代表"), TEACHER_CONGRESS_DELEGATE_SPECIALLY_INVITE("教代会特邀代表"), TEACHER_CONGRESS_DELEGATION_HEAD("教代会代表团团长"), + TEACHER_CONGRESS_VICE_DELEGATION_HEAD("教代会代表团副团长"), PROPOSAL_COMMITTEE_DIRECTOR("提案委员会主任"), PROPOSAL_COMMITTEE_DEPUTY_DIRECTOR("提案委员会副主任"), diff --git a/src/main/java/com/budwk/app/sys/controller/SysHomeActivityController.java b/src/main/java/com/budwk/app/sys/controller/SysHomeActivityController.java index 4f853005..958bed35 100644 --- a/src/main/java/com/budwk/app/sys/controller/SysHomeActivityController.java +++ b/src/main/java/com/budwk/app/sys/controller/SysHomeActivityController.java @@ -81,4 +81,26 @@ public class SysHomeActivityController { return Result.success(); } + @At + @SaCheckPermission("sys.homeActivity") + @ApiOperation("推送大图") + public Result push(@Valid String id){ + Sys_home_activity sysHomeActivity = new Sys_home_activity(); + sysHomeActivity.setId(id); + sysHomeActivity.setPush(true); + sysHomeActivityService.updateIgnoreNull(sysHomeActivity); + return Result.success(); + } + + @At + @SaCheckPermission("sys.homeActivity") + @ApiOperation("取消推送大图") + public Result cancelPush(@Valid String id){ + Sys_home_activity sysHomeActivity = new Sys_home_activity(); + sysHomeActivity.setId(id); + sysHomeActivity.setPush(false); + sysHomeActivityService.updateIgnoreNull(sysHomeActivity); + return Result.success(); + } + } diff --git a/src/main/java/com/budwk/app/sys/controller/SysHomeController.java b/src/main/java/com/budwk/app/sys/controller/SysHomeController.java index b8f4470c..7123fbaf 100644 --- a/src/main/java/com/budwk/app/sys/controller/SysHomeController.java +++ b/src/main/java/com/budwk/app/sys/controller/SysHomeController.java @@ -6,8 +6,6 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.http.useragent.UserAgent; import cn.hutool.http.useragent.UserAgentUtil; import com.budwk.app.base.constant.RedisConstant; -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.sys.models.Sys_home_activity; import com.budwk.app.sys.models.Sys_menu; @@ -29,7 +27,6 @@ import org.nutz.dao.util.Daos; import org.nutz.integration.jedis.RedisService; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; -import org.nutz.json.Json; import org.nutz.lang.Lang; import org.nutz.lang.Strings; import org.nutz.lang.util.NutMap; @@ -37,17 +34,16 @@ import org.nutz.log.Log; import org.nutz.log.Logs; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; import org.nutz.plugins.wkcache.annotation.CacheDefaults; import org.nutz.plugins.wkcache.annotation.CacheResult; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import javax.validation.Valid; -import java.io.IOException; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.List; @IocBean @@ -148,7 +144,7 @@ public class SysHomeController { @SaCheckLogin @ApiOperation("电脑端推荐应用") @Ok("json") - public Result listRecommendApp(String platform) { + public Result listRecommendApp(@Param(value = "platform", df = "PC") String platform) { List list = sysMenuService.query(Cnd.where(Sys_menu::getIsRecommendApp, "=", 1) .and(Sys_menu::getDisabled, "=", 0) .and(Sys_menu::getShowit, "=", 1) @@ -160,6 +156,23 @@ public class SysHomeController { return Result.success(sysMenus); } + @At + @SaCheckLogin + @ApiOperation("电脑端推荐服务") + @Ok("json") + public Result listRecommendService(@Param(value = "platform", df = "PC") String platform) { + List list = sysMenuService.query(Cnd.where(Sys_menu::getIsRecommendService, "=", 1) + .and(Sys_menu::getDisabled, "=", 0) + .and(Sys_menu::getShowit, "=", 1) + .and(Sys_menu::getPlatform, "=", platform) + ); + List menus = sysUserService.getMenus(SecurityUtil.getUserId()); + List allMenuIds = menus.stream().map(Sys_menu::getId).toList(); + List sysMenus = list.stream().filter(m -> allMenuIds.contains(m.getId())).sorted(Comparator.comparingInt(Sys_menu::getLocation)).toList(); + return Result.success(sysMenus); + } + + @At @SaCheckLogin @ApiOperation("首页推送活动") diff --git a/src/main/java/com/budwk/app/sys/models/Sys_home_activity.java b/src/main/java/com/budwk/app/sys/models/Sys_home_activity.java index d2aac44c..3d7a3647 100644 --- a/src/main/java/com/budwk/app/sys/models/Sys_home_activity.java +++ b/src/main/java/com/budwk/app/sys/models/Sys_home_activity.java @@ -28,6 +28,11 @@ public class Sys_home_activity extends BaseModel { @Comment("活动封面") private String cover; + @Column + @ColDefine(type = ColType.TEXT) + @Comment("活动内容") + private String content; + @Column @ColDefine(type = ColType.VARCHAR, width = 1000) @Comment("活动链接") @@ -65,6 +70,12 @@ public class Sys_home_activity extends BaseModel { @Default("0") private Boolean top; + @Column + @Comment("是否推送大图") + @ColDefine(type = ColType.BOOLEAN) + @Default("0") + private Boolean push; + @Column @Comment("排序号") @Default("0") diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/edu/controller/EduPersonRankController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/controller/EduPersonRankController.java new file mode 100644 index 00000000..e3c7fb31 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/controller/EduPersonRankController.java @@ -0,0 +1,85 @@ +package com.budwk.app.zhgh.dayofficework.edu.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +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.zhgh.dayofficework.edu.models.EduCourses; +import com.budwk.app.zhgh.dayofficework.edu.service.EduCoursesService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +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.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 +@At("/platform/edu/personRank") +@Ok("json:full") +@Api(tags = "个人排行榜") +public class EduPersonRankController { + + @Inject + private Dao dao; + @Inject + private EduCoursesService eduCoursesService; + + @At("") + @Ok("beetl:/platform/zhgh/dayofficework/edu/personRank/index.html") + @SaCheckPermission("edu.person.rank") + public void index() { + } + + @At("/courses") + @ApiOperation("获取课程列表") + @SaCheckPermission("edu.person.rank") + public Result getCourses() { + List courses = dao.query(EduCourses.class, Cnd.where(EduCourses::getDisabled, "=", 0).desc(EduCourses::getCreatedAt)); + return Result.success(courses); + } + + @At("/ranking") + @ApiOperation("获取排行榜数据") + @SaCheckPermission("edu.person.rank") + public Result getRanking(@Param("courseId") String courseId, + @Param(value = "rankType", df = "watchTime") String rankType, + @Param("startDate") String startDate, + @Param("endDate") String endDate, + PageForm pageForm) { + // 学习总时长排序 + Sql sql = Sqls.create(""" + SELECT + r.userId, + u.loginname, + u.username, + u.unitId, + u.unionId, + u.unitName, + u.unionName, + SUM(r.watchedDuration) AS totalWatchTime + FROM + edu_study_records r + INNER JOIN vw_user u ON r.userId = u.id + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.andEX("r.courseId", "=", courseId); + cnd.andEX("r.lastWatchedTime", ">=", startDate); + cnd.andEX("r.lastWatchedTime", "<=", endDate); + cnd.groupBy("r.userId"); + cnd.having(Cnd.where("totalWatchTime", ">", 0)); + cnd.orderBy("totalWatchTime", "desc"); + sql.setCondition(cnd); + Pagination pagination = eduCoursesService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/edu/controller/EduUnionRankController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/controller/EduUnionRankController.java new file mode 100644 index 00000000..106c7852 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/controller/EduUnionRankController.java @@ -0,0 +1,91 @@ +package com.budwk.app.zhgh.dayofficework.edu.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.StrUtil; +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.zhgh.dayofficework.edu.models.EduCourses; +import com.budwk.app.zhgh.dayofficework.edu.service.EduCoursesService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +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.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 +@At("/platform/edu/unionRank") +@Ok("json:full") +@Api(tags = "工会排行榜") +public class EduUnionRankController { + + @Inject + private Dao dao; + @Inject + private EduCoursesService eduCoursesService; + + @At("") + @Ok("beetl:/platform/zhgh/dayofficework/edu/unionRank/index.html") + @SaCheckPermission("edu.union.rank") + public void index() { + } + + @At("/courses") + @ApiOperation("获取课程列表") + @SaCheckPermission("edu.union.rank") + public Result getCourses() { + List courses = dao.query(EduCourses.class, Cnd.where(EduCourses::getDisabled, "=", 0).desc(EduCourses::getCreatedAt)); + return Result.success(courses); + } + + @At("/ranking") + @ApiOperation("获取排行榜数据") + @SaCheckPermission("edu.union.rank") + public Result getRanking(@Param("courseId") String courseId, + @Param(value = "rankType", df = "watchTime") String rankType, + @Param("startDate") String startDate, + @Param("endDate") String endDate, + PageForm pageForm) { + // 学习总时长排序 + Sql sql = Sqls.create(""" + SELECT + su.id AS unionId, + su.name AS unionName, + su.unionCode, + COALESCE(participant_count.participantCount, 0) AS participantCount + FROM + sys_union su + LEFT JOIN ( + SELECT + u.unionId, + COUNT(DISTINCT esr.userId) AS participantCount + FROM + edu_study_records esr + INNER JOIN vw_user u ON esr.userId = u.id + WHERE + esr.watchedDuration > 0 + AND u.unionId IS NOT NULL + $courseId + GROUP BY + u.unionId) participant_count ON su.id = participant_count.unionId + ORDER BY + participantCount DESC, + su.NAME + """); + if(StrUtil.isNotBlank(courseId)){ + sql.setVar("courseId", "and esr.courseId='" + courseId + "'"); + } + Pagination pagination = eduCoursesService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/edu/h5controller/H5EduController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/h5controller/H5EduController.java index df2a8e93..7087e89b 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/edu/h5controller/H5EduController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/h5controller/H5EduController.java @@ -172,7 +172,7 @@ public class H5EduController { } @At("/study/history") - @Ok("beetl:/platform/zhghh5/dayofficework/edu/study/history.html") + @Ok("beetl:/platform/zhghh5/dayofficework/edu/history/index.html") @SaCheckLogin @ApiOperation("学习历史页面") public void studyHistory() { diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/edu/h5controller/H5EduStudyHisController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/h5controller/H5EduStudyHisController.java new file mode 100644 index 00000000..57c92426 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/h5controller/H5EduStudyHisController.java @@ -0,0 +1,224 @@ +package com.budwk.app.zhgh.dayofficework.edu.h5controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.result.Result; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.dayofficework.edu.models.EduChapters; +import com.budwk.app.zhgh.dayofficework.edu.models.EduCourses; +import com.budwk.app.zhgh.dayofficework.edu.models.EduStudyRecords; +import com.budwk.app.zhgh.dayofficework.edu.models.EduVideos; +import com.budwk.app.zhgh.dayofficework.edu.service.EduCoursesService; +import com.budwk.app.zhgh.dayofficework.edu.service.EduStudyRecordsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +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.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.*; + +@Slf4j +@IocBean +@At("/platform/h5/edu/studyhis") +@Ok("json:full") +@Api(tags = "移动端学习历史统计") +public class H5EduStudyHisController { + + @Inject + private Dao dao; + @Inject + private EduCoursesService eduCoursesService; + @Inject + private EduStudyRecordsService eduStudyRecordsService; + + @At("") + @Ok("beetl:/platform/zhghh5/dayofficework/edu/studyhis/index.html") + @SaCheckLogin + @ApiOperation("学习历史统计页面") + public void studyHistoryPage() { + } + + /** + * 获取学习统计数据 + */ + @At("/stats") + @SaCheckLogin + @ApiOperation("获取学习统计数据") + public Result getStudyStats() { + try { + // 获取用户学习的课程总数 + Sql courseCountSql = Sqls.create("SELECT COUNT(DISTINCT courseId) as total_courses FROM edu_study_records WHERE userId = @userId"); + courseCountSql.params().set("userId", SecurityUtil.getUserId()); + courseCountSql.setCallback(Sqls.callback.maps()); + dao.execute(courseCountSql); + + int totalCourses = 0; + if (!courseCountSql.getList(NutMap.class).isEmpty()) { + Object count = courseCountSql.getList(NutMap.class).get(0).get("total_courses"); + totalCourses = count != null ? ((Number) count).intValue() : 0; + } + + // 获取用户完成的视频总数 + int completedVideos = dao.count(EduStudyRecords.class, + Cnd.where("userId", "=", SecurityUtil.getUserId()).and("isCompleted", "=", true)); + + // 获取用户总学习时长(秒) + Sql watchTimeSql = Sqls.create("SELECT COALESCE(SUM(watchedDuration), 0) as total_watch_time FROM edu_study_records WHERE userId = @userId"); + watchTimeSql.params().set("userId", SecurityUtil.getUserId()); + watchTimeSql.setCallback(Sqls.callback.maps()); + dao.execute(watchTimeSql); + + int totalWatchTime = 0; + if (!watchTimeSql.getList(NutMap.class).isEmpty()) { + Object time = watchTimeSql.getList(NutMap.class).get(0).get("total_watch_time"); + totalWatchTime = time != null ? ((Number) time).intValue() : 0; + } + + Map stats = new HashMap<>(); + stats.put("totalCourses", totalCourses); + stats.put("completedVideos", completedVideos); + stats.put("totalWatchTime", totalWatchTime); + + return Result.success("获取成功", stats); + } catch (Exception e) { + log.error("获取学习统计数据失败", e); + return Result.error("获取失败"); + } + } + + /** + * 获取学习历史列表 + */ + @At("/history") + @SaCheckLogin + @ApiOperation("获取学习历史列表") + public Result getStudyHistory(@Param("filter") String filter) { + try { + String userId = SecurityUtil.getUserId(); + if (StrUtil.isBlank(userId)) { + return Result.error("用户未登录"); + } + + List historyList; + if ("completed".equals(filter)) { + // 获取已完成的学习记录 + historyList = dao.query(EduStudyRecords.class, + Cnd.where("userId", "=", userId) + .and("isCompleted", "=", true) + .orderBy("completedAt", "desc")); + } else if ("inProgress".equals(filter)) { + // 获取进行中的学习记录 + historyList = dao.query(EduStudyRecords.class, + Cnd.where("userId", "=", userId) + .and("isCompleted", "=", false) + .and("watchedDuration", ">", 0) + .orderBy("updatedAt", "desc")); + } else { + // 获取所有学习记录 + historyList = dao.query(EduStudyRecords.class, + Cnd.where("userId", "=", userId) + .orderBy("updatedAt", "desc")); + } + + return Result.success("获取成功", historyList); + } catch (Exception e) { + log.error("获取学习历史失败", e); + return Result.error("获取失败"); + } + } + + @At("/progress/detail") + @SaCheckLogin + @ApiOperation("获取课程详细进度") + public Result getCourseProgressDetail(@Param("courseId") String courseId) { + try { + if (StrUtil.isBlank(courseId)) { + return Result.error("课程ID不能为空"); + } + + String userId = SecurityUtil.getUserId(); + if (userId == null) { + return Result.error("用户未登录"); + } + + // 获取课程信息 + EduCourses course = dao.fetch(EduCourses.class, courseId); + if (course == null) { + return Result.error("课程不存在"); + } + + // 获取课程章节和视频 + List chapters = dao.query(EduChapters.class, + Cnd.where("courseId", "=", courseId).orderBy("sortCode", "asc")); + + List> chapterList = new ArrayList<>(); + int totalVideos = 0; + int completedVideos = 0; + int totalWatchTime = 0; + + for (EduChapters chapter : chapters) { + List videos = dao.query(EduVideos.class, + Cnd.where("chapterId", "=", chapter.getId()).orderBy("sortCode", "asc")); + + List> videoList = new ArrayList<>(); + + for (EduVideos video : videos) { + totalVideos++; + + // 获取学习记录 + EduStudyRecords record = dao.fetch(EduStudyRecords.class, + Cnd.where("userId", "=", userId) + .and("videoId", "=", video.getId()) + .and("courseId", "=", courseId)); + + boolean isCompleted = record != null && record.getIsCompleted(); + if (isCompleted) completedVideos++; + + int watchDuration = record != null ? (record.getWatchedDuration() != null ? record.getWatchedDuration() : 0) : 0; + totalWatchTime += watchDuration; + + Map videoInfo = new HashMap<>(); + videoInfo.put("videoId", video.getId()); + videoInfo.put("title", video.getTitle()); + videoInfo.put("duration", video.getDuration()); + videoInfo.put("isCompleted", isCompleted); + videoInfo.put("watchDuration", watchDuration); + videoInfo.put("lastWatchTime", record != null ? record.getLastWatchedTime() : null); + + videoList.add(videoInfo); + } + + Map chapterInfo = new HashMap<>(); + chapterInfo.put("chapterId", chapter.getId()); + chapterInfo.put("title", chapter.getTitle()); + chapterInfo.put("videos", videoList); + + chapterList.add(chapterInfo); + } + + Map progressDetail = new HashMap<>(); + progressDetail.put("course", course); + progressDetail.put("chapters", chapterList); + progressDetail.put("totalVideos", totalVideos); + progressDetail.put("completedVideos", completedVideos); + progressDetail.put("totalWatchTime", totalWatchTime); + progressDetail.put("completionRate", totalVideos > 0 ? (double) completedVideos / totalVideos * 100 : 0); + + return Result.success(progressDetail); + } catch (Exception e) { + log.error("获取课程详细进度失败", e); + return Result.error("获取课程详细进度失败"); + } + } + + +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/edu/models/EduStudyRecords.java b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/models/EduStudyRecords.java index c8a3da3d..35624aa1 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/edu/models/EduStudyRecords.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/edu/models/EduStudyRecords.java @@ -25,6 +25,26 @@ public class EduStudyRecords extends BaseModel { @Column private String userId; + @Comment("单位ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @Column + private String unitId; + + @Comment("单位名称") + @ColDefine(type = ColType.VARCHAR, width = 100) + @Column + private String unitName; + + @Comment("工会ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @Column + private String unionId; + + @Comment("工会名称") + @ColDefine(type = ColType.VARCHAR, width = 100) + @Column + private String unionName; + @Comment("视频ID") @ColDefine(type = ColType.VARCHAR, width = 32) @Column diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessage.java b/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessage.java index a3b729ac..2bf08e31 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessage.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessage.java @@ -16,6 +16,9 @@ import java.util.List; @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableMeta("{'mysql-charset':'utf8mb4'}") +@TableIndexes(value = { + @Index(name = "INDEX_GLOBAL_MESSAGE_STATUS", fields = "status", unique = false) +}) @Comment("全局消息") public class GlobalMessage extends BaseModel { diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessageReceiver.java b/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessageReceiver.java index a65cf4cf..083f3bc4 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessageReceiver.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/message/models/GlobalMessageReceiver.java @@ -14,6 +14,13 @@ import java.util.Date; @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableMeta("{'mysql-charset':'utf8mb4'}") +@TableIndexes(value = + { + @Index(name = "INDEX_GLOBAL_MESSAGE_RECEIVER_MESSAGEID", fields = "messageId", unique = false), + @Index(name = "INDEX_GLOBAL_MESSAGE_RECEIVER_RECEIVERID", fields = "receiverId", unique = false), + @Index(name = "INDEX_GLOBAL_MESSAGE_RECEIVER_ISREAD", fields = "isRead", unique = false) + } +) @Comment("全局消息接收用户") public class GlobalMessageReceiver extends BaseModel { diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/dashboard/ProposalDashboardController.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/dashboard/ProposalDashboardController.java new file mode 100644 index 00000000..b2ee782e --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/dashboard/ProposalDashboardController.java @@ -0,0 +1,174 @@ +package com.budwk.app.zhgh.democratic.proposal.controller.dashboard; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.StrUtil; +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.flow.engine.model.ProcessModel; +import com.budwk.app.flow.engine.model.TaskModel; +import com.budwk.app.flow.entity.ProcessDefine; +import com.budwk.app.flow.service.ProcessDefineService; +import com.budwk.app.sys.models.Sys_dict; +import com.budwk.app.sys.services.SysDictService; +import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo; +import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService; +import io.swagger.annotations.Api; +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.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.ArrayList; +import java.util.List; + +@IocBean +@At("/platform/proposal/dashboard") +@Api("提案数据看板") +@Ok("json:full") +public class ProposalDashboardController { + + @Inject + private ProposalCommonService proposalCommonService; + @Inject + private ProcessDefineService processDefineService; + @Inject + private SysDictService sysDictService; + @Inject + private Dao dao; + + @At("") + @Ok("beetl:/platform/zhgh/democratic/proposal/dashboard/index.html") + @SaCheckPermission("proposal.dashboard") + public void index() { + } + + @At + @SaCheckPermission("proposal.dashboard") + public Result listNode(@Param("sessionId") String sessionId) { + List nodes = new ArrayList<>(); + + // 提案总数 + nodes.add(NutMap.NEW().addv("name", "提案总数").addv("id", "total").addv("type", "total").addv("count", 0)); + + // 节点 + ProcessDefine define = processDefineService.getLastByName("JDHTA"); + ProcessModel processModel = processDefineService.processDefineToModel(define); + List taskModels = processModel.getTasks(); + + List excludeNodes = new ArrayList<>(3); + excludeNodes.add("撰写提案"); + excludeNodes.add("邀请附议人"); + excludeNodes.add("提案附议"); + + List taskNodes = taskModels.stream().filter(taskModel -> !excludeNodes.contains(taskModel.getDisplayName())) + .map(taskModel -> NutMap.NEW() + .addv("name", taskModel.getDisplayName()) + .addv("id", taskModel.getName()) + .addv("type", "task") + .addv("count", 0)).toList(); + nodes.addAll(taskNodes); + + // 立案结果 + List caseFilingResult = sysDictService.getSubListByCode("PROPOSAL_CASE_FILING_RESULT"); + for (Sys_dict dict : caseFilingResult) { + nodes.add(NutMap.NEW() + .addv("name", dict.getName()) + .addv("id", dict.getCode()) + .addv("type", "caseFilingResult") + .addv("count", 0)); + } + + // 查询待办任务 + Sql todoSql = Sqls.create(""" + SELECT + t.taskName + FROM + wf_process_task t + INNER JOIN wf_process_instance ins ON ins.id = t.processInstanceId + INNER JOIN proposal_info info ON info.id = ins.businessNo + WHERE + t.taskState = 10 + AND info.sessionId = @sessionId + """); + todoSql.setParam("sessionId", sessionId); + List todoTasks = processDefineService.listMap(todoSql); + + for (NutMap node : nodes) { + if (node.getString("type").equals("task")) { + long count = todoTasks.stream().filter(task -> task.getString("taskName").equals(node.getString("id"))).count(); + node.put("count", count); + } else if (node.getString("type").equals("total")) { + int count = dao.count(ProposalInfo.class, Cnd.where(ProposalInfo::getSessionId, "=", sessionId)); + node.put("count", count); + } else if (node.getString("type").equals("caseFilingResult")) { + int count = dao.count(ProposalInfo.class, Cnd.where(ProposalInfo::getSessionId, "=", sessionId).and(ProposalInfo::getCaseFilingResult, "=", node.getString("id"))); + node.put("count", count); + } + } + + return Result.success(nodes); + } + + + @At + @SaCheckPermission("proposal.dashboard") + public Result pageData(PageForm pageForm, String sessionId, String selectNodeId, String selectNodeType) { + Sql sql = Sqls.create(""" + SELECT + info.*, + COUNT(p.consolidationIds) > 0 AS isConsolidation, + type.name AS typeName, + tcs.fullName AS sessionName, + tcd.`name` AS delegationName, + ins.id AS instanceId, + ins.businessNo, + ins.state instanceState, + ins.variable instanceVariable, + ins.processDefineId instanceProcessDefineId, + t.displayName curTaskName, + JSON_UNQUOTE(JSON_EXTRACT(caseTasks.variable, '$.tf_hostUnitName')) AS masterUnitName, + caseTasks.variable->>'$.tf_helpUnitNameStr' AS slaveUnitNames + FROM + proposal_info info + LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id)) + LEFT JOIN proposal_type type on type.id = info.typeId + LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId + LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId + LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName + LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id + LEFT JOIN (SELECT processInstanceId, MAX(finishTime) AS finishTime FROM wf_process_task WHERE taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND taskState = 20 GROUP BY processInstanceId) latestTasks ON latestTasks.processInstanceId = ins.id + LEFT JOIN wf_process_task caseTasks ON caseTasks.processInstanceId = ins.id AND caseTasks.taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND caseTasks.taskState = 20 AND caseTasks.finishTime = latestTasks.finishTime + LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10 + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("info.sessionId", "=", sessionId); + cnd.groupBy("info.id"); + + if(StrUtil.isNotBlank(selectNodeType) && StrUtil.isNotBlank(selectNodeId)){ + switch (selectNodeType){ + case "task": + cnd.and("t.taskName", "=", selectNodeId); + break; + case "total": + break; + case "caseFilingResult": + cnd.and("info.caseFilingResult", "=", selectNodeId); + break; + } + } + + sql.setCondition(cnd); + Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + +} diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalMineController.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalMineController.java index 371afe46..46288613 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalMineController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalMineController.java @@ -120,6 +120,51 @@ public class ProposalMineController { return Result.success(pagination); } + @At + @SaCheckPermission("proposal.mine") + @Aop(TransAop.READ_COMMITTED) + public Result selectOne(@Valid String id){ + Sql sql = Sqls.create(""" + SELECT + info.*, + type.name AS typeName, + tcs.fullName AS sessionName, + tcd.`name` AS delegationName, + ins.id AS instanceId, + ins.businessNo, + ins.state instanceState, + ins.variable instanceVariable, + ins.processDefineId instanceProcessDefineId, + t.id taskId, + t.taskName AS taskKey, + t.displayName taskName, + t.taskType, + t.performType taskPerformType, + t.taskState, + t.finishTime, + t.taskParentId, + t.variable taskVariable, + IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke, + (select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId + FROM + proposal_info info + LEFT JOIN proposal_type type on type.id = info.typeId + LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId + LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId + LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id + LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10 + LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("info.id", "=", id); + cnd.groupBy("info.id"); + sql.setCondition(cnd); + NutMap data = proposalCommonService.fetchMap(sql); + return Result.success(data); + } + + @At @SaCheckPermission("proposal.mine") @Aop(TransAop.READ_COMMITTED) diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalViceDelegationController.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalViceDelegationController.java new file mode 100644 index 00000000..6b0562dd --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalViceDelegationController.java @@ -0,0 +1,90 @@ +package com.budwk.app.zhgh.democratic.proposal.controller.transact; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.constant.RoleConstant; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.result.Result; +import com.budwk.app.web.commons.auth.utils.AuthUtil; +import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam; +import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +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 javax.validation.Valid; + +@IocBean +@At("/platform/proposal/vice/delegation") +@Slf4j +@Ok("json:full") +@Api(tags = "提案-办理-副团长查阅") +public class ProposalViceDelegationController { + + @Inject + private ProposalCommonService proposalCommonService; + + @At("") + @Ok("beetl:/platform/zhgh/democratic/proposal/transact/viceDelegation/index.html") + @SaCheckPermission("proposal.vice.delegation") + public void index() { + } + + @At("/h5") + @Ok("beetl:/platform/zhghh5/democratic/proposal/transact/viceDelegation/index.html") + @SaCheckPermission("proposal.vice.delegation") + public void h5Index() { + } + + @At + @SaCheckPermission("proposal.vice.delegation") + @ApiOperation("分页列表") + public Result pageData(@Valid ProposalSearchParam pageForm) { + Sql sql = Sqls.create(""" + SELECT + info.*, + type.NAME AS typeName, + tcs.fullName AS sessionName, + tcd.`name` AS delegationName, + ins.id AS instanceId, + ins.businessNo, + ins.state instanceState, + ins.variable instanceVariable, + ins.processDefineId instanceProcessDefineId, + t.id taskId, + t.taskName AS taskKey, + t.displayName taskName, + t.taskType, + t.performType taskPerformType, + t.taskState, + t.finishTime, + t.taskParentId + FROM + proposal_info info + LEFT JOIN proposal_type type ON type.id = info.typeId + LEFT JOIN teacher_congress_session tcs ON tcs.id = info.sessionId + LEFT JOIN teacher_congress_delegation tcd ON tcd.id = info.delegationId + LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id + LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id\s + AND t.taskState = 10 + $condition + """); + Cnd cnd = Cnd.NEW(); + if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) { + cnd.and("info.delegationId", "in", proposalCommonService.getSelfManageDelegationIds()); + } + ProposalSearchParam.buildSearch(cnd, pageForm); + cnd.groupBy("info.id"); + sql.setCondition(cnd); + Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + +} diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/models/ProposalInfo.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/models/ProposalInfo.java index 0f43d33c..e8671894 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/proposal/models/ProposalInfo.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/models/ProposalInfo.java @@ -129,8 +129,8 @@ public class ProposalInfo extends BaseModel { @Column @Comment("建议落实部门") - @ColDefine(type = ColType.VARCHAR, width = 500) - private String implementUnitName; + @ColDefine(type = ColType.MYSQL_JSON) + private List suggestUnits; @Column @Comment("提案状态") diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java index 794e1abb..ab2bcab7 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java @@ -457,7 +457,8 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl imp @Override public List getSelfManageDelegationIds() { Sys_role role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD.name()); - List sysUserRoles = dao().query(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", role.getId()) + Sys_role viceRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_VICE_DELEGATION_HEAD.name()); + List sysUserRoles = dao().query(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "in", List.of(role.getId(), viceRole.getId())) .and(Sys_user_role::getUserId, "=", SecurityUtil.getUserId())); List delegationIds = sysUserRoles.stream() .map(Sys_user_role::getTcDelegationId) diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegation/controller/TeacherCongressDelegationController.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegation/controller/TeacherCongressDelegationController.java index d7947674..dd181ccf 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegation/controller/TeacherCongressDelegationController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegation/controller/TeacherCongressDelegationController.java @@ -18,7 +18,9 @@ import com.budwk.app.sys.services.SysRoleService; import com.budwk.app.sys.services.SysUserService; import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation; import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_unit; -import io.swagger.annotations.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Chain; import org.nutz.dao.Cnd; @@ -69,25 +71,25 @@ public class TeacherCongressDelegationController { @POST @SaCheckPermission("tc.delegation") @ApiOperation(value = "届次信息列表", httpMethod = "POST") - @ApiImplicitParams({ - @ApiImplicitParam(name = "sessionId", value = "届次ID", dataType = "String", paramType = "query"), - @ApiImplicitParam(name = "delegationId", value = "代表团ID", dataType = "String", paramType = "query") - }) public Result pageData(@Valid @ApiParam(value = "分页表单") PageForm pageForm, @Valid @ApiParam(value = "届次ID") String sessionId) { Sys_role role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD); + Sys_role role2 = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_VICE_DELEGATION_HEAD); Sql sql = Sqls.create(""" SELECT tcd.*, tcs.fullName as sessionName, - GROUP_CONCAT(u.username,u.loginname) as delegationHead + GROUP_CONCAT(u.username,u.loginname) as delegationHead, + GROUP_CONCAT(u2.username,u2.loginname) as viceDelegationHead FROM teacher_congress_delegation tcd LEFT JOIN teacher_congress_session tcs ON tcs.id = tcd.sessionId - LEFT JOIN sys_user_role sur ON sur.tcDelegationId = tcd.id - AND sur.roleId = @roleId + LEFT JOIN sys_user_role sur ON sur.tcDelegationId = tcd.id AND sur.roleId = @roleId LEFT JOIN sys_user u ON u.id = sur.userId + LEFT JOIN sys_user_role sur2 ON sur2.tcDelegationId = tcd.id AND sur2.roleId = @roleId2 + LEFT JOIN sys_user u2 ON u2.id = sur2.userId $condition"""); sql.setParam("roleId", role.getId()); + sql.setParam("roleId2", role2.getId()); Cnd cnd = Cnd.NEW(); cnd.and("tcd.sessionId", "=", sessionId); cnd.asc("tcd.code"); @@ -241,8 +243,8 @@ public class TeacherCongressDelegationController { public Result notHeadUser(@Valid String sessionId, @Valid String delegationId, String keyWord) { Sql sql = Sqls.create("select userId,loginName,userName,unitName from teacher_congress_delegate $condition"); Cnd cnd = Cnd.NEW(); - cnd.and("delegationId","=",delegationId); - cnd.and("sessionId","=",sessionId); + cnd.and("delegationId", "=", delegationId); + cnd.and("sessionId", "=", sessionId); SqlExpressionGroup seg = new SqlExpressionGroup(); seg.orLike("loginName", keyWord); seg.orLike("userName", keyWord); @@ -261,8 +263,14 @@ public class TeacherCongressDelegationController { */ @At @SaCheckPermission("tc.delegation") - public Result headUser(@Valid String sessionId, @Valid String delegationId) { - Sys_role role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD); + public Result headUser(@Valid String sessionId, @Valid String delegationId, @Param(value = "type", df = "TEACHER_CONGRESS_DELEGATION_HEAD") String type) { + Sys_role role = null; + if (type.equals(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD.name())) { + role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD); + } else { + role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_VICE_DELEGATION_HEAD); + } + Record record = dao.fetch("sys_user_role", Cnd.where("tcSessionId", "=", sessionId).and("tcDelegationId", "=", delegationId).and("roleId", "=", role.getId())); String userId = Optional.ofNullable(record).map(r -> r.getString("userId")).orElse(null); @@ -297,17 +305,23 @@ public class TeacherCongressDelegationController { @At @SaCheckPermission("tc.delegation") @Aop(TransAop.READ_COMMITTED) - public Result insertHead(@Valid String delegationId, @Valid String sessionId, @Valid String userId) { + public Result insertHead(@Valid String delegationId, @Valid String sessionId, @Valid String userId, String viceUserId) { + // 团长 Sys_role role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD); - - //删除权限 只能有一个团长 dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getTcDelegationId, "=", delegationId) .and(Sys_user_role::getTcSessionId, "=", sessionId) .and(Sys_user_role::getRoleId, "=", role.getId()) ); - - //再加 dao.insert("sys_user_role", Chain.make("userId", userId).add("roleId", role.getId()).add("tcDelegationId", delegationId).add("tcSessionId", sessionId)); + + // 副团长 + Sys_role role2 = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_VICE_DELEGATION_HEAD); + dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getTcDelegationId, "=", delegationId) + .and(Sys_user_role::getTcSessionId, "=", sessionId) + .and(Sys_user_role::getRoleId, "=", role2.getId()) + ); + dao.insert("sys_user_role", Chain.make("userId", viceUserId).add("roleId", role2.getId()).add("tcDelegationId", delegationId).add("tcSessionId", sessionId)); + sysUserService.clearCache(); return Result.success(); } diff --git a/src/main/resources/static/assets/platform/js/util/commonUtil.js b/src/main/resources/static/assets/platform/js/util/commonUtil.js index d344abe6..2de29cfb 100644 --- a/src/main/resources/static/assets/platform/js/util/commonUtil.js +++ b/src/main/resources/static/assets/platform/js/util/commonUtil.js @@ -221,7 +221,8 @@ const commonUtil = { }) viewer.show() } else { - this.$message.warning("暂不支持预览该文件,请下载后查看") + // this.$message.warning("暂不支持预览该文件,请下载后查看") + alert("暂不支持预览该文件,请下载后查看") } }, @@ -317,5 +318,15 @@ function base64ToFile(base64Data, filename) { return new File([blob], filename, {type: contentType}) } +function createLoading(text= '加载中...'){ + return ELEMENT.Loading.service({ + lock: true, + text: text, + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) +} + + diff --git a/src/main/resources/static/components/plugins/h5/TableList.vue b/src/main/resources/static/components/plugins/h5/TableList.vue index 1bf76ec3..c84bc6c9 100644 --- a/src/main/resources/static/components/plugins/h5/TableList.vue +++ b/src/main/resources/static/components/plugins/h5/TableList.vue @@ -1,278 +1,293 @@ diff --git a/src/main/resources/static/components/plugins/sysUpload/index.vue b/src/main/resources/static/components/plugins/sysUpload/index.vue index 8b32809d..bacbb510 100644 --- a/src/main/resources/static/components/plugins/sysUpload/index.vue +++ b/src/main/resources/static/components/plugins/sysUpload/index.vue @@ -1,585 +1,601 @@  diff --git a/src/main/resources/views/layouts/platform.html b/src/main/resources/views/layouts/platform.html index 7a90c3ce..6754bef8 100644 --- a/src/main/resources/views/layouts/platform.html +++ b/src/main/resources/views/layouts/platform.html @@ -239,7 +239,6 @@ layout("/layouts/v4/baseLayout.html"){ $(document).on("pjax:complete", function () { NProgress.done() $("#sub-app-container-main-content").show() - setContentTitle() }) diff --git a/src/main/resources/views/layouts/platform_h5.html b/src/main/resources/views/layouts/platform_h5.html index 4d7765e1..d0c34f01 100644 --- a/src/main/resources/views/layouts/platform_h5.html +++ b/src/main/resources/views/layouts/platform_h5.html @@ -68,7 +68,7 @@ - + diff --git a/src/main/resources/views/layouts/v4/serv.html b/src/main/resources/views/layouts/v4/serv.html index d444730e..4be7cc1a 100644 --- a/src/main/resources/views/layouts/v4/serv.html +++ b/src/main/resources/views/layouts/v4/serv.html @@ -322,17 +322,17 @@ layout("/layouts/v4/baseLayout.html"){
- 应用中心 + 应用中心
{{ category.name }} @@ -344,7 +344,7 @@ layout("/layouts/v4/baseLayout.html"){
@@ -353,12 +353,14 @@ layout("/layouts/v4/baseLayout.html"){
首字母:
-
全部
+
+ 全部 +
{{ letter }}
@@ -404,7 +406,7 @@ layout("/layouts/v4/baseLayout.html"){ // 应用列表 applications: [], // 分类列表 - categories: [{ id: "all", name: "全部服务", icon: "fa fa-th-large" }], + categories: [{id: "all", name: "全部服务", icon: "fa fa-th-large"}], // 动态加载的分类 dynamicCategories: [], // 当前选中的分类 @@ -486,8 +488,8 @@ layout("/layouts/v4/baseLayout.html"){ this.activeCategory === "all" ? "" : this.activeCategory === "favorites" || this.activeCategory === "recommended" - ? this.activeCategory - : this.activeCategory, + ? this.activeCategory + : this.activeCategory, letter: this.activeAlphabet, keyword: this.searchKeyword } @@ -541,7 +543,7 @@ layout("/layouts/v4/baseLayout.html"){ if (!app) return const url = app.isFavorite ? "/platform/v4/serv/removeFavorite" : "/platform/v4/serv/addFavorite" - const params = { appId: appId } + const params = {appId: appId} $.post(url, params) .then((result) => { @@ -585,8 +587,11 @@ layout("/layouts/v4/baseLayout.html"){ // 打开应用 openApp(app) { console.log(app) - // 新标签页打开 - window.open("/flow/common/approval/form?defineKey=" + app.name, "_blank") + if (!app.instanceUrl) { + this.$message.warning("管理员未配置服务地址") + return + } + window.open(app.instanceUrl, "_blank") } } }) diff --git a/src/main/resources/views/platform/sys/conf/index.html b/src/main/resources/views/platform/sys/conf/index.html index a9d19dfa..1b382e51 100644 --- a/src/main/resources/views/platform/sys/conf/index.html +++ b/src/main/resources/views/platform/sys/conf/index.html @@ -13,9 +13,12 @@ layout("/layouts/platform.html"){ - - - + + + - - - - - + + + + + + + + @@ -61,7 +77,7 @@ layout("/layouts/platform.html"){ confirmButtonText: "确定", cancelButtonText: "取消" }).then(() => { - this.$axios.post(loc() + "/disable", { id }).then((resp) => { + this.$axios.post(loc() + "/disable", {id}).then((resp) => { if (resp.code === 0) { this.$message.success(resp.msg) this.pageData() @@ -75,7 +91,7 @@ layout("/layouts/platform.html"){ confirmButtonText: "确定", cancelButtonText: "取消" }).then(() => { - this.$axios.post(loc() + "/enable", { id }).then((resp) => { + this.$axios.post(loc() + "/enable", {id}).then((resp) => { if (resp.code === 0) { this.$message.success(resp.msg) this.pageData() @@ -89,7 +105,7 @@ layout("/layouts/platform.html"){ confirmButtonText: "确定", cancelButtonText: "取消" }).then(() => { - this.$axios.post(loc() + "/topUp", { id }).then((resp) => { + this.$axios.post(loc() + "/topUp", {id}).then((resp) => { if (resp.code === 0) { this.$message.success(resp.msg) this.pageData() @@ -103,7 +119,35 @@ layout("/layouts/platform.html"){ confirmButtonText: "确定", cancelButtonText: "取消" }).then(() => { - this.$axios.post(loc() + "/cancelTopUp", { id }).then((resp) => { + this.$axios.post(loc() + "/cancelTopUp", {id}).then((resp) => { + if (resp.code === 0) { + this.$message.success(resp.msg) + this.pageData() + } + }) + }) + }, + push(id) { + this.$confirm("您确定要推送大图吗?", "提示", { + type: "warning", + confirmButtonText: "确定", + cancelButtonText: "取消" + }).then(() => { + this.$axios.post(loc() + "/push", {id}).then((resp) => { + if (resp.code === 0) { + this.$message.success(resp.msg) + this.pageData() + } + }) + }) + }, + cancelPush(id) { + this.$confirm("您确定要取消推送大图吗?", "提示", { + type: "warning", + confirmButtonText: "确定", + cancelButtonText: "取消" + }).then(() => { + this.$axios.post(loc() + "/cancelPush", {id}).then((resp) => { if (resp.code === 0) { this.$message.success(resp.msg) this.pageData() diff --git a/src/main/resources/views/platform/zhgh/dayofficework/edu/personRank/index.html b/src/main/resources/views/platform/zhgh/dayofficework/edu/personRank/index.html new file mode 100644 index 00000000..e252589f --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/edu/personRank/index.html @@ -0,0 +1,79 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/edu/unionRank/index.html b/src/main/resources/views/platform/zhgh/dayofficework/edu/unionRank/index.html new file mode 100644 index 00000000..1570f1b9 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/edu/unionRank/index.html @@ -0,0 +1,77 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js b/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js index 132b5f97..b98b9212 100644 --- a/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/common/info.js @@ -21,6 +21,9 @@ const PROPOSAL_INFO = { {{viewData.typeName}} + + {{viewData.suggestUnits}} + diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/dashboard/index.html b/src/main/resources/views/platform/zhgh/democratic/proposal/dashboard/index.html new file mode 100644 index 00000000..3fbe2289 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/dashboard/index.html @@ -0,0 +1,279 @@ + + + + +
+ + + + + + + + + + + + +
统计看板
+
+
+
+ +
+
+
{{ node.name || '未命名节点' }}
+
{{ node.count || 0 }}
+
+
+
+
+ + +
+ {{ tableCardTitle }} +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + + + diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/mine/index.html b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/mine/index.html index 3dc85094..9b4bfda2 100644 --- a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/mine/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/mine/index.html @@ -9,12 +9,15 @@ layout("/layouts/platform.html"){ - - + + - + @@ -38,21 +41,22 @@ layout("/layouts/platform.html"){