diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/controller/HonorManageController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/controller/HonorManageController.java index 418ea06..c44d53a 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/controller/HonorManageController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/controller/HonorManageController.java @@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.util.StrUtil; import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.page.Pagination; @@ -55,6 +56,28 @@ public class HonorManageController { } + /** + * 移动端劳模先进展示页入口,用于首页专题卡片跳转。 + */ + @At("/h5") + @SaCheckPermission(value = {"honor.manage", "h5.honor.manage"}, mode = SaMode.OR) + @Ok("beetl:/platform/zhghh5/dayofficework/honor/manage/index.html") + public void h5() { + + } + + /** + * 查询移动端劳模先进展示数据,只返回 H5 页面需要的基础展示字段。 + * + * @param pageForm 荣誉筛选和分页参数,H5 默认按当前年份和荣誉类别展示。 + * @return 当前年份、当前荣誉类别下的荣誉展示分页数据。 + */ + @At + @SaCheckPermission(value = {"honor.manage", "h5.honor.manage"}, mode = SaMode.OR) + public Result h5Data(HonorPageForm pageForm) { + return Result.success(honorViService.listH5ManagePage(pageForm)); + } + @At @SaCheckPermission("honor.manage") public Result pageData(HonorPageForm pageForm) { diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/models/Honor.java b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/models/Honor.java index c274048..bc1f497 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/models/Honor.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/models/Honor.java @@ -222,5 +222,10 @@ public class Honor extends BaseModel { @Comment("附件") private List files; + @Column + @ColDefine(type = ColType.MYSQL_JSON) + @Comment("荣誉照片") + private List photoFiles; + private String loginname; } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/HonorCommonService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/HonorCommonService.java index 153c969..c88eded 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/HonorCommonService.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/HonorCommonService.java @@ -1,8 +1,10 @@ package com.budwk.app.zhgh.dayofficework.honor.service; +import com.budwk.app.base.page.Pagination; import com.budwk.app.base.service.BaseService; import com.budwk.app.zhgh.dayofficework.honor.models.Honor; import com.budwk.app.zhgh.dayofficework.honor.models.HonorBasicSettings; +import com.budwk.app.zhgh.dayofficework.honor.param.HonorPageForm; import java.util.List; @@ -15,5 +17,13 @@ import java.util.List; */ public interface HonorCommonService extends BaseService { + /** + * 查询移动端劳模先进展示数据。 + * + * @param pageForm 荣誉筛选和分页参数,未传年份时默认查询当前年份。 + * @return 当前筛选条件下的移动端展示分页结果。 + */ + Pagination listH5ManagePage(HonorPageForm pageForm); + List getHonorBasicSettingsByQueryTypeCode(String queryTypeCode); } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/impl/HonorCommonServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/impl/HonorCommonServiceImpl.java index dcd909c..763e25e 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/impl/HonorCommonServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/honor/service/impl/HonorCommonServiceImpl.java @@ -1,14 +1,18 @@ package com.budwk.app.zhgh.dayofficework.honor.service.impl; +import com.budwk.app.base.page.Pagination; import com.budwk.app.base.service.impl.BaseServiceImpl; -import com.budwk.app.zhgh.dayofficework.honor.constant.HonorTypeOrigin; import com.budwk.app.zhgh.dayofficework.honor.models.Honor; import com.budwk.app.zhgh.dayofficework.honor.models.HonorBasicSettings; +import com.budwk.app.zhgh.dayofficework.honor.param.HonorPageForm; import com.budwk.app.zhgh.dayofficework.honor.service.HonorCommonService; 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.IocBean; +import java.util.Calendar; import java.util.List; /** @@ -26,6 +30,40 @@ public class HonorCommonServiceImpl extends BaseServiceImpl implements Ho } + /** + * 查询移动端劳模先进展示数据,只返回首页专题页需要的轻量字段。 + * + * @param pageForm 荣誉筛选和分页参数,未传年份时默认查询当前年份。 + * @return 移动端劳模先进展示分页结果。 + */ + @Override + public Pagination listH5ManagePage(HonorPageForm pageForm) { + Sql sql = Sqls.create(""" + SELECT + h.id, + h.userName, + h.applyUnionName, + h.unionName, + h.grantDate, + h.photoFiles, + prize.`name` AS prizeName, + type.`name` AS typeName, + type.queryTypeCode AS typeQueryTypeCode + FROM + `honor` h + LEFT JOIN honor_basic_settings prize ON prize.id = h.prize + LEFT JOIN honor_basic_settings type ON type.id = h.honorType + $condition + """); + Cnd cnd = Cnd.NEW(); + Integer year = pageForm.getYear() == null ? Calendar.getInstance().get(Calendar.YEAR) : pageForm.getYear(); + cnd.andEX("YEAR(h.grantDate)", "=", year); + cnd.andEX("h.honorType", "=", pageForm.getHonorType()); + cnd.desc("h.grantDate"); + sql.setCondition(cnd); + return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + } + @Override public List getHonorBasicSettingsByQueryTypeCode(String queryTypeCode) { HonorBasicSettings basicSettings = dao().fetch(HonorBasicSettings.class, Cnd.where("queryTypeCode", "=", queryTypeCode)); diff --git a/src/main/resources/db/honor_add_photo_files.sql b/src/main/resources/db/honor_add_photo_files.sql new file mode 100644 index 0000000..d890eb6 --- /dev/null +++ b/src/main/resources/db/honor_add_photo_files.sql @@ -0,0 +1,2 @@ +ALTER TABLE `honor` + ADD COLUMN `photoFiles` JSON NULL COMMENT '荣誉照片' AFTER `files`; diff --git a/src/main/resources/db/menu/init_honor_h5_menu.sql b/src/main/resources/db/menu/init_honor_h5_menu.sql new file mode 100644 index 0000000..50519e4 --- /dev/null +++ b/src/main/resources/db/menu/init_honor_h5_menu.sql @@ -0,0 +1,51 @@ +-- 劳模先进移动端菜单。 +-- 手机端接口使用 h5. 前缀权限,便于 H5 角色单独授权。 +INSERT INTO sys_menu (id, parentId, path, name, aliasName, type, href, target, icon, showit, disabled, permission, note, location, hasChildren, createdBy, createdAt, updatedBy, updatedAt, delFlag, platform, moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService) +SELECT + 'c3d7258d2a3540f4a7f0f15a3f6b1001', + '', + LPAD(IFNULL(MAX(CAST(path AS UNSIGNED)), 0) + 1, 4, '0'), + '劳模先进', + 'Honor H5', + 'menu', + '', + '', + 'medal-o', + 1, + 0, + 'h5.honor', + NULL, + 992, + 1, + '', + UNIX_TIMESTAMP(NOW()) * 1000, + '', + UNIX_TIMESTAMP(NOW()) * 1000, + 0, + 'H5', + NULL, + 'medal-o', + 'l', + 1, + 0 +FROM sys_menu +WHERE (parentId = '' OR parentId IS NULL) + AND CHAR_LENGTH(path) = 4 +HAVING NOT EXISTS (SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'h5.honor') t); + +INSERT INTO sys_menu (id, parentId, path, name, aliasName, type, href, target, icon, showit, disabled, permission, note, location, hasChildren, createdBy, createdAt, updatedBy, updatedAt, delFlag, platform, moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService) +SELECT 'c3d7258d2a3540f4a7f0f15a3f6b1002', p.id, CONCAT(p.path, '0001'), '劳模先进', 'Honor Manage H5', 'menu', '/platform/honor/manage/h5', 'data-pjax', '', 1, 0, 'h5.honor.manage', NULL, 1, 0, '', UNIX_TIMESTAMP(NOW()) * 1000, '', UNIX_TIMESTAMP(NOW()) * 1000, 0, 'H5', NULL, 'medal-o', 'l', 1, 0 +FROM sys_menu p +WHERE p.permission = 'h5.honor' + AND NOT EXISTS (SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'h5.honor.manage') t); + +INSERT INTO sys_role_menu (roleId, menuId) +SELECT r.id, m.id +FROM sys_role r +JOIN sys_menu m ON m.permission IN ( + 'h5.honor', + 'h5.honor.manage' +) +LEFT JOIN sys_role_menu rm ON rm.roleId = r.id AND rm.menuId = m.id +WHERE r.code = 'SYSADMIN' + AND rm.roleId IS NULL; diff --git a/src/main/resources/db/menu/init_tour_menu.sql b/src/main/resources/db/menu/init_tour_menu.sql index 0042dd6..f09ddca 100644 --- a/src/main/resources/db/menu/init_tour_menu.sql +++ b/src/main/resources/db/menu/init_tour_menu.sql @@ -120,3 +120,62 @@ JOIN sys_menu m ON m.permission IN ( LEFT JOIN sys_role_menu rm ON rm.roleId = r.id AND rm.menuId = m.id WHERE r.code = 'SYSADMIN' AND rm.roleId IS NULL; + +-- 普惠疗休养移动端菜单。 +-- 手机端接口使用 h5. 前缀权限,保留 PC 权限的同时支持单独分配 H5 角色。 +INSERT INTO sys_menu (id, parentId, path, name, aliasName, type, href, target, icon, showit, disabled, permission, note, location, hasChildren, createdBy, createdAt, updatedBy, updatedAt, delFlag, platform, moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService) +SELECT + 'b7c63f0c73a44a9a8c4f3d3bb1a11001', + '', + LPAD(IFNULL(MAX(CAST(path AS UNSIGNED)), 0) + 1, 4, '0'), + '普惠疗休养', + 'Tour H5', + 'menu', + '', + '', + 'map-marked', + 1, + 0, + 'h5.tour', + NULL, + 991, + 1, + '', + UNIX_TIMESTAMP(NOW()) * 1000, + '', + UNIX_TIMESTAMP(NOW()) * 1000, + 0, + 'H5', + NULL, + 'map-marked', + 'p', + 1, + 0 +FROM sys_menu +WHERE (parentId = '' OR parentId IS NULL) + AND CHAR_LENGTH(path) = 4 +HAVING NOT EXISTS (SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'h5.tour') t); + +INSERT INTO sys_menu (id, parentId, path, name, aliasName, type, href, target, icon, showit, disabled, permission, note, location, hasChildren, createdBy, createdAt, updatedBy, updatedAt, delFlag, platform, moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService) +SELECT 'b7c63f0c73a44a9a8c4f3d3bb1a11002', p.id, CONCAT(p.path, '0001'), '疗休养报名', 'Tour Signup H5', 'menu', '/platform/tour/signup/h5', 'data-pjax', '', 1, 0, 'h5.tour.signup', NULL, 1, 0, '', UNIX_TIMESTAMP(NOW()) * 1000, '', UNIX_TIMESTAMP(NOW()) * 1000, 0, 'H5', NULL, 'guide-o', 'l', 1, 0 +FROM sys_menu p +WHERE p.permission = 'h5.tour' + AND NOT EXISTS (SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'h5.tour.signup') t); + +INSERT INTO sys_menu (id, parentId, path, name, aliasName, type, href, target, icon, showit, disabled, permission, note, location, hasChildren, createdBy, createdAt, updatedBy, updatedAt, delFlag, platform, moduleId, picIcon, initialPinyinName, isRecommendApp, isRecommendService) +SELECT 'b7c63f0c73a44a9a8c4f3d3bb1a11003', p.id, CONCAT(p.path, '0002'), '我的疗休养', 'My Tour H5', 'menu', '/platform/tour/mysignup/h5', 'data-pjax', '', 1, 0, 'h5.tour.mysignup', NULL, 2, 0, '', UNIX_TIMESTAMP(NOW()) * 1000, '', UNIX_TIMESTAMP(NOW()) * 1000, 0, 'H5', NULL, 'records-o', 'w', 0, 0 +FROM sys_menu p +WHERE p.permission = 'h5.tour' + AND NOT EXISTS (SELECT 1 FROM (SELECT id FROM sys_menu WHERE permission = 'h5.tour.mysignup') t); + +INSERT INTO sys_role_menu (roleId, menuId) +SELECT r.id, m.id +FROM sys_role r +JOIN sys_menu m ON m.permission IN ( + 'h5.tour', + 'h5.tour.signup', + 'h5.tour.mysignup' +) +LEFT JOIN sys_role_menu rm ON rm.roleId = r.id AND rm.menuId = m.id +WHERE r.code = 'SYSADMIN' + AND rm.roleId IS NULL; diff --git a/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html b/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html index 37a8b3b..2de0ec4 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html @@ -202,12 +202,22 @@ layout("/layouts/platform.html"){ {{ viewData.awardMaterialsExcel }} + + + + + + 暂无 + + + - - + + 暂无 @@ -241,7 +251,7 @@ layout("/layouts/platform.html"){ } }, components: { - "file-upload": httpVueLoader("/components/plugins/FileUpload.vue") + "file-preview": httpVueLoader("/components/plugins/sysFilePreview/index.vue") }, methods: { dropdownCommand(command) { @@ -255,12 +265,30 @@ layout("/layouts/platform.html"){ } }, openView(row) { - if (row.files) { - row.files = JSON.parse(row.files) - } - this.viewData = row + const viewRow = Object.assign({}, row) + viewRow.files = this.parseJsonArray(viewRow.files) + viewRow.photoFiles = this.parseJsonArray(viewRow.photoFiles) + this.viewData = viewRow this.$refs.guava.view() }, + // 荣誉照片和附件可能是 JSON 字符串,详情预览前统一转换为数组。 + parseJsonArray(value) { + if (Array.isArray(value)) { + return value + } + if (!value) { + return [] + } + if (typeof value === "string") { + try { + const parsed = JSON.parse(value) + return Array.isArray(parsed) ? parsed : [] + } catch (e) { + return [] + } + } + return [] + }, doExport() { if(!this.pageForm.honorType) { this.$message.warning("请选择荣誉类型") @@ -304,7 +332,8 @@ layout("/layouts/platform.html"){ } }, async getHonorPrize(honorType) { - const res = await this.$axios.post("/platform/honor/basic/settings/getData", {parentId: honorType}) + const request = this.$axios.post("/platform/honor/basic/settings/getData", {parentId: honorType}) + const res = await request return res.data }, getHonorType() { diff --git a/src/main/resources/views/platform/zhgh/dayofficework/honor/registration/index.html b/src/main/resources/views/platform/zhgh/dayofficework/honor/registration/index.html index a3b061d..ff620c3 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/honor/registration/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/honor/registration/index.html @@ -267,6 +267,18 @@ layout("/layouts/platform.html"){ --> + + + + + { if (res.code === 0) { this.$message.success("操作成功,即将跳转至台账界面") @@ -354,7 +368,8 @@ layout("/layouts/platform.html"){ this.$set(this.formData, "political", user.political) }, async getUser(keyWord) { - const resp = await this.$axios.post("/platform/condolence/apply/listBeComfortedUser", {keyWord: keyWord}) + const request = this.$axios.post("/platform/condolence/apply/listBeComfortedUser", {keyWord: keyWord}) + const resp = await request return resp.data }, async honorTypeChange(val) { @@ -374,23 +389,27 @@ layout("/layouts/platform.html"){ } }, async getHonorPrize(honorType) { - const res = await this.$axios.post("/platform/honor/basic/settings/getData", {parentId: honorType}) + const request = this.$axios.post("/platform/honor/basic/settings/getData", {parentId: honorType}) + const res = await request return res.data }, async getHonorType() { - const res = await this.$axios.post("/platform/honor/basic/settings/getHonorType") + const request = this.$axios.post("/platform/honor/basic/settings/getHonorType") + const res = await request if (res.code === 0) { this.honorTypeList = res.data } }, async getHonorLevel() { - const res = await this.$axios.post("/platform/honor/basic/settings/getHonorLevel") + const request = this.$axios.post("/platform/honor/basic/settings/getHonorLevel") + const res = await request if (res.code === 0) { this.honorLevelList = res.data } }, async getHonorAwardType() { - const res = await this.$axios.post("/platform/honor/basic/settings/getHonorAwardType") + const request = this.$axios.post("/platform/honor/basic/settings/getHonorAwardType") + const res = await request if (res.code === 0) { this.honorAwardList = res.data } @@ -403,10 +422,32 @@ layout("/layouts/platform.html"){ } }) }, + // 荣誉照片和附件字段可能由后台以 JSON 字符串返回,统一转换为上传组件需要的数组。 + normalizeJsonArray(value) { + if (Array.isArray(value)) { + return value + } + if (!value) { + return [] + } + if (typeof value === "string") { + try { + const parsed = JSON.parse(value) + return Array.isArray(parsed) ? parsed : [] + } catch (e) { + return [] + } + } + return [] + }, async findData(id) { - const resp = await this.$axios.post(loc() + "/findData", {id: id}) + const request = this.$axios.post(loc() + "/findData", {id: id}) + const resp = await request const data1 = resp.data this.formData = resp.data + this.$set(this.formData, "awardMaterials", this.normalizeJsonArray(this.formData.awardMaterials)) + this.$set(this.formData, "files", this.normalizeJsonArray(this.formData.files)) + this.$set(this.formData, "photoFiles", this.normalizeJsonArray(this.formData.photoFiles)) if (this.formData.userId && this.formData.userId !== "") { await this.userRemoteMethod(this.formData.userName) } else { @@ -441,7 +482,10 @@ layout("/layouts/platform.html"){ if (this.honorTypeList && this.honorTypeList.length > 0) { this.formData = { honorType: this.honorTypeList[0].id, - queryTypeCode: this.honorTypeList[0].queryTypeCode + queryTypeCode: this.honorTypeList[0].queryTypeCode, + awardMaterials: [], + files: [], + photoFiles: [] } this.honorPrizeList = await this.getHonorPrize(this.formData.honorType) } diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/honor/manage/index.html b/src/main/resources/views/platform/zhghh5/dayofficework/honor/manage/index.html new file mode 100644 index 0000000..a01cf27 --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/dayofficework/honor/manage/index.html @@ -0,0 +1,495 @@ + + +
+
+ + +
+ + +
+ +
+
+
+

一份坚守,淬炼出奋斗的生命价值;一份专注,迸发不断创新的发展动力。

+

他们扎根岗位、追求卓越,以实干书写担当,用匠心点亮前行方向。

+

致敬劳模先进,礼赞奋斗精神。

+
+ + 加载中... + +
+
+
+ +
+
{{ getDisplayName(item) }}
+
劳模先进
+
+
{{ getDisplayName(item) }}
+
+
+
+
《{{ item.prizeName || '荣誉奖项' }}》
+
授予时间:{{ item.grantDate }}
+
+
+ + +
+
+
+ + + + + diff --git a/src/main/resources/views/platform/zhghh5/sys/home/home.js b/src/main/resources/views/platform/zhghh5/sys/home/home.js index 0e6d94c..1db37b7 100644 --- a/src/main/resources/views/platform/zhghh5/sys/home/home.js +++ b/src/main/resources/views/platform/zhghh5/sys/home/home.js @@ -145,14 +145,14 @@ const home = { desc: "先进风采展示", icon: "medal-o", className: "feature-card--model", - href: "" + href: "/platform/honor/manage/h5" }, { - name: "普惠信息", - desc: "普惠服务信息", + name: "普惠疗休养", + desc: "疗休养报名服务", icon: "bullhorn-o", className: "feature-card--inclusive", - href: "" + href: "/platform/tour/signup/h5" } ], appLogo: "",