From 4754affaa8840a803993eb5a1524aa2f9e56f4d3 Mon Sep 17 00:00:00 2001 From: Paidax Date: Thu, 10 Oct 2024 15:34:42 +0800 Subject: [PATCH] commit --- .../lxy/controller/LxyFghShController.java | 2 +- .../lxy/controller/LxyHdTjController.java | 35 +++++-- .../components/plugins/CustomMessage.vue | 91 +++++++++++++++++++ .../resources/views/layouts/platform.html | 1 + .../platform/wakeshome/declaration/apply.html | 4 +- .../views/platform/wakeshome/info/apply.html | 8 +- .../views/platform/zgfw/lxy/HdTj.html | 6 +- 7 files changed, 131 insertions(+), 16 deletions(-) create mode 100644 src/main/resources/static/components/plugins/CustomMessage.vue diff --git a/src/main/java/io/v/nutz/lxy/controller/LxyFghShController.java b/src/main/java/io/v/nutz/lxy/controller/LxyFghShController.java index 0789aa7..9dca052 100644 --- a/src/main/java/io/v/nutz/lxy/controller/LxyFghShController.java +++ b/src/main/java/io/v/nutz/lxy/controller/LxyFghShController.java @@ -141,7 +141,7 @@ public class LxyFghShController { @At @ViReturn - @RequiresPermissions(value = {"zgfw.lxy.xghsh", "zgfw.lxy.fghsh"}, logical = Logical.OR) + @RequiresPermissions(value = {"zgfw.lxy.xghsh", "zgfw.lxy.fghsh", "zgfw.lxy.hdtj"}, logical = Logical.OR) public Object getBmInfo(String id) { Lxy_grxx grxx = lxyGrxxService.fetch(id); List files = baseService.dao().query(Sys_file.class, Cnd.where("reid", "=", id)); diff --git a/src/main/java/io/v/nutz/lxy/controller/LxyHdTjController.java b/src/main/java/io/v/nutz/lxy/controller/LxyHdTjController.java index 0e11c99..38e98d2 100644 --- a/src/main/java/io/v/nutz/lxy/controller/LxyHdTjController.java +++ b/src/main/java/io/v/nutz/lxy/controller/LxyHdTjController.java @@ -11,6 +11,7 @@ import io.v.nutz.base.utils.Vi; import io.v.nutz.lxy.model.Lxy_bm; import io.v.nutz.lxy.service.LxyGrxxService; import io.v.nutz.lxy.service.LxyHdService; +import io.v.nutz.util.ShiroUtil; import io.v.nutz.util.ViTool; import org.apache.poi.ss.usermodel.Workbook; import org.apache.shiro.authz.annotation.RequiresAuthentication; @@ -75,15 +76,31 @@ public class LxyHdTjController { @Param(value = "searchKey", required = false) String searchKey, @Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize) { Cnd cnd = Cnd.NEW(); - Sql sql = Sqls.create("SELECT gr.* ,u.unionname,u.unioncode,u.unitname unitname,u.unitcode FROM `lxy_grxx` gr \n" + + Sql sql = Sqls.create(""" + SELECT + gr.*, + u.unionname, + u.unioncode, + u.unitname unitname, + u.unitcode + FROM + `lxy_grxx` gr + LEFT JOIN lxy_bm bm ON bm.userid = gr.userid + LEFT JOIN `user` u ON u.id = bm.userid + $condition + """); + /*Sql sql = Sqls.create("SELECT gr.* ,u.unionname,u.unioncode,u.unitname unitname,u.unitcode FROM `lxy_grxx` gr \n" + "LEFT JOIN lxy_bm bm ON bm.userid = gr.userid \n" + - "LEFT JOIN `user` u ON u.id=bm.userid $condition"); + "LEFT JOIN `user` u ON u.id=bm.userid $condition");*/ - cnd.and(new Static("bm.bmzt = 5")); + cnd.and("bm.bmzt","=",5); +// cnd.and(new Static("bm.bmzt = 5")); cnd.and("gr.hdid", "=", hdid); - if (Strings.isNotBlank(ghid)) { - cnd.and("gr.ghid", "=", ghid); + if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { + cnd.and("gr.ghid","=", Vi.getUnionId()); + } else { + cnd.andEX("gr.ghid", "=", ghid); } if (Strings.isNotBlank(searchKey)) { cnd.where().andLike("u.loginname", searchKey).orLike("u.username", searchKey); @@ -125,8 +142,10 @@ public class LxyHdTjController { cnd.and(new Static("bm.bmzt = 5")); cnd.and("gr.hdid", "=", hdid); - if (Strings.isNotBlank(ghid)) { - cnd.and("gr.ghid", "=", ghid); + if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { + cnd.and("gr.ghid","=", Vi.getUnionId()); + } else { + cnd.andEX("gr.ghid", "=", ghid); } cnd.groupBy("bm.userid"); cnd.asc("bm.unionname").asc("bm.unitname").asc("gr.age"); @@ -145,12 +164,12 @@ public class LxyHdTjController { entities.add(new ExcelExportEntity("序号", "index", 10)); entities.add(new ExcelExportEntity("工号", "loginname", 20)); entities.add(new ExcelExportEntity("姓名", "username", 20)); + entities.add(new ExcelExportEntity("性别", "sex", 20)); entities.add(new ExcelExportEntity("年龄", "age", 20)); entities.add(new ExcelExportEntity("手机号", "mobile", 20)); entities.add(new ExcelExportEntity("身份证号", "idcard", 20)); entities.add(new ExcelExportEntity("工会", "unionname", 20)); entities.add(new ExcelExportEntity("单位", "unitname", 20)); - entities.add(new ExcelExportEntity("单位", "unitname", 20)); entities.add(new ExcelExportEntity("获奖名称", "zyhj", 20)); entities.add(new ExcelExportEntity("备注", "bz", 20)); diff --git a/src/main/resources/static/components/plugins/CustomMessage.vue b/src/main/resources/static/components/plugins/CustomMessage.vue new file mode 100644 index 0000000..5ae6128 --- /dev/null +++ b/src/main/resources/static/components/plugins/CustomMessage.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/src/main/resources/views/layouts/platform.html b/src/main/resources/views/layouts/platform.html index 1202590..f1ce32d 100644 --- a/src/main/resources/views/layouts/platform.html +++ b/src/main/resources/views/layouts/platform.html @@ -139,6 +139,7 @@ Vue.component('text-editor', httpVueLoader('/components/plugins/textEditor.vue')) Vue.component('border-table', httpVueLoader('/components/plugins/BorderTable.vue')) Vue.component('image-upload', httpVueLoader('/components/plugins/ImageUpload.vue')) + Vue.component('custom-message', httpVueLoader('/components/plugins/CustomMessage.vue')) diff --git a/src/main/resources/views/platform/wakeshome/declaration/apply.html b/src/main/resources/views/platform/wakeshome/declaration/apply.html index 7ac4791..0c52537 100644 --- a/src/main/resources/views/platform/wakeshome/declaration/apply.html +++ b/src/main/resources/views/platform/wakeshome/declaration/apply.html @@ -31,7 +31,7 @@ layout("/layouts/platform.html"){ - + @@ -77,7 +77,7 @@ layout("/layouts/platform.html"){ - + diff --git a/src/main/resources/views/platform/wakeshome/info/apply.html b/src/main/resources/views/platform/wakeshome/info/apply.html index 091b0bc..1eb4b0f 100644 --- a/src/main/resources/views/platform/wakeshome/info/apply.html +++ b/src/main/resources/views/platform/wakeshome/info/apply.html @@ -34,7 +34,7 @@ layout("/layouts/platform.html"){ - + @@ -74,7 +74,7 @@ layout("/layouts/platform.html"){ - + @@ -109,7 +109,7 @@ layout("/layouts/platform.html"){ - + @@ -177,7 +177,7 @@ layout("/layouts/platform.html"){ - + diff --git a/src/main/resources/views/platform/zgfw/lxy/HdTj.html b/src/main/resources/views/platform/zgfw/lxy/HdTj.html index c7312e8..64bfb20 100644 --- a/src/main/resources/views/platform/zgfw/lxy/HdTj.html +++ b/src/main/resources/views/platform/zgfw/lxy/HdTj.html @@ -355,7 +355,11 @@ display: -webkit-box; async created() { this.pageForm.year = new Date().getFullYear() + "" await this.getLxyHd() - this.ghList = await getUnions() + if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" == true){ + this.ghList = await getUnionList() + } else { + this.ghList = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}") + } this.pageData() } })