慰问申请-校工会办公室审核:普通系统管理员不参与校工会办公室审核,超级管理员账号保留兜底权限;修复手机端首页‘我的待办’不显示‘校工会办公室审核’的待办提醒(慰问申请分工会审核未做兼容,保持手机端不显示待办提醒);
This commit is contained in:
@@ -186,14 +186,24 @@ public class MainPageNeedItemsController {
|
||||
//查询数据库中的待办事项
|
||||
List<NeedItems> needItemsList = dao.queryByJoin(NeedItems.class, "^needItemsSource$", Cnd.NEW());
|
||||
|
||||
// 普通系统管理员不参与校工会办公室审核,超级管理员账号保留兜底权限。
|
||||
boolean superadmin = "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"));
|
||||
if (!superadmin && ShiroUtil.hasRole("sysadmin") && !ShiroUtil.hasRole("condolence_office")) {
|
||||
needItemsList.removeIf(item -> ("condolence".equals(item.getQueryTable())
|
||||
&& "state_id".equals(item.getQueryColumn())
|
||||
&& Integer.valueOf(2020).equals(item.getStateId()))
|
||||
|| "/platform/fw/condolence/vcr".equals(item.getHref())
|
||||
|| "/platform/fw/condolence/vcr/school".equals(item.getHref()));
|
||||
}
|
||||
|
||||
//根据当前登录用户的角色查询可以看到哪些菜单
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
if (!superadmin && !ShiroUtil.hasRole("sysadmin")) {
|
||||
Sql sql = Sqls.create("""
|
||||
select menuId from sys_role_menu where roleId in (select roleId from sys_user_role where userId = @userId)
|
||||
""").setParam("userId", ShiroUtil.getPlatformUid());
|
||||
List<NutMap> menuIds = baseService.listMap(sql);
|
||||
List<String> menuId = menuIds.stream().map(o -> o.getString("menuId")).collect(Collectors.toList());
|
||||
List<String> menuId = menuIds.stream().map(o -> o.getString("menuid")).collect(Collectors.toList());
|
||||
cnd.and("id", "in", menuId);
|
||||
}
|
||||
List<Sys_menu> menus = dao.query(Sys_menu.class, cnd);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.v.nutz.mobile.condolence;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
@@ -44,6 +45,9 @@ public class CondolenceAuditControll {
|
||||
@Param(value = "searchKeyword", required = false) String searchKeyword, int pageNumber, int pageSize,
|
||||
@Param(value = "pageOrderName", required = false) String pageOrderName,
|
||||
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
|
||||
if (!hasAuditPermission()) {
|
||||
return Result.error("您没有慰问审核权限!");
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
con.*,
|
||||
@@ -73,11 +77,11 @@ public class CondolenceAuditControll {
|
||||
.and("sqr.unionid", "=", Vi.getUnionId()));
|
||||
hasAuditRole = true;
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("condolence_office,sysadmin")) {
|
||||
if (ShiroUtil.hasAnyRoles("condolence_office")) {
|
||||
group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2020));
|
||||
hasAuditRole = true;
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("xghkj,sysadmin")) {
|
||||
if (ShiroUtil.hasAnyRoles("xghkj")) {
|
||||
group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2012));
|
||||
hasAuditRole = true;
|
||||
}
|
||||
@@ -112,6 +116,14 @@ public class CondolenceAuditControll {
|
||||
return condolenceService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验手机端慰问审核权限,超级管理员账号保留兜底权限。
|
||||
*/
|
||||
private boolean hasAuditPermission() {
|
||||
return "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"))
|
||||
|| ShiroUtil.hasAnyRoles("gh01,sp01,condolence_office,xghkj");
|
||||
}
|
||||
|
||||
|
||||
@At("/auditHtml")
|
||||
@Ok("re")
|
||||
@@ -119,9 +131,9 @@ public class CondolenceAuditControll {
|
||||
boolean superadmin = "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"));
|
||||
if (state_id == 2000 && (superadmin || ShiroUtil.hasAnyRoles("gh01,sp01"))) {
|
||||
return "beetl:/mobile/condolence/union_Audit.html";
|
||||
} else if (state_id == 2012 && (superadmin || ShiroUtil.hasAnyRoles("gh03,xghkj,sysadmin"))) {
|
||||
} else if (state_id == 2012 && (superadmin || ShiroUtil.hasAnyRoles("gh03,xghkj"))) {
|
||||
return "beetl:/mobile/condolence/fr_Audit.html";
|
||||
} else if (state_id == 2020 && (superadmin || ShiroUtil.hasAnyRoles("condolence_office,sysadmin"))) {
|
||||
} else if (state_id == 2020 && (superadmin || ShiroUtil.hasAnyRoles("condolence_office"))) {
|
||||
return "beetl:/mobile/condolence/school_Audit.html";
|
||||
}
|
||||
return "beetl:/mobile/condolence/apply_info.html";
|
||||
|
||||
@@ -44,12 +44,64 @@ UPDATE `sys_menu`
|
||||
SET `name` = '校工会办公室审核',
|
||||
`aliasName` = 'CondolenceOfficeReview',
|
||||
`note` = '慰问申请校工会办公室审核',
|
||||
`href` = '/platform/fw/condolence/vcr/school',
|
||||
`showit` = 1,
|
||||
`disabled` = 0,
|
||||
`updatedAt` = UNIX_TIMESTAMP() * 1000,
|
||||
`delFlag` = 0
|
||||
WHERE `id` = @condolence_office_menu_id;
|
||||
|
||||
-- 首页待办按菜单地址精确匹配,同步原待办配置并补充手机端入口。
|
||||
SET @condolence_office_need_item_id := (
|
||||
SELECT `id`
|
||||
FROM `need_items`
|
||||
WHERE `menuId` = @condolence_office_menu_id
|
||||
OR `href` IN ('/platform/fw/condolence/vcr', '/platform/fw/condolence/vcr/school')
|
||||
OR (`queryTable` = 'condolence' AND `queryColumn` = 'state_id' AND `stateId` = 2020)
|
||||
LIMIT 1
|
||||
);
|
||||
SET @condolence_office_need_item_new_id := REPLACE(UUID(), '-', '');
|
||||
|
||||
INSERT INTO `need_items`
|
||||
(`id`, `menuId`, `title`, `name`, `code`, `href`, `mobileHref`, `iconClass`, `color`,
|
||||
`creatUser`, `creatTime`, `queryTable`, `queryColumn`, `stateId`, `userIdColumn`, `queryType`)
|
||||
SELECT
|
||||
@condolence_office_need_item_new_id,
|
||||
@condolence_office_menu_id,
|
||||
'【职工慰问】',
|
||||
'待校工会办公室审核',
|
||||
'condolence_office',
|
||||
'/platform/fw/condolence/vcr/school',
|
||||
'/mobile/condolence/audit',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%s'),
|
||||
'condolence',
|
||||
'state_id',
|
||||
2020,
|
||||
'',
|
||||
''
|
||||
WHERE @condolence_office_need_item_id IS NULL
|
||||
AND @condolence_office_menu_id IS NOT NULL;
|
||||
|
||||
SET @condolence_office_need_item_id := COALESCE(
|
||||
@condolence_office_need_item_id,
|
||||
@condolence_office_need_item_new_id
|
||||
);
|
||||
|
||||
UPDATE `need_items`
|
||||
SET `menuId` = @condolence_office_menu_id,
|
||||
`name` = '待校工会办公室审核',
|
||||
`href` = '/platform/fw/condolence/vcr/school',
|
||||
`mobileHref` = '/mobile/condolence/audit',
|
||||
`queryTable` = 'condolence',
|
||||
`queryColumn` = 'state_id',
|
||||
`stateId` = 2020,
|
||||
`userIdColumn` = '',
|
||||
`queryType` = ''
|
||||
WHERE `id` = @condolence_office_need_item_id;
|
||||
|
||||
-- 同步原审核节点的状态名称,不新增状态。
|
||||
UPDATE `state`
|
||||
SET `state_name` = CASE `state_id`
|
||||
|
||||
@@ -51,7 +51,7 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据">
|
||||
:description="permissionDenied ? '您没有慰问审核权限' : '暂无数据'">
|
||||
</van-empty>
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ layout("/mobile/platform.html"){
|
||||
{text: '已审核', value: true},
|
||||
],
|
||||
handle: true,
|
||||
permissionDenied: false,
|
||||
pageForm: {
|
||||
year: new Date().getFullYear(),
|
||||
isAudit: false,
|
||||
@@ -90,6 +91,11 @@ layout("/mobile/platform.html"){
|
||||
this.flushUnits()
|
||||
},
|
||||
pageData() {
|
||||
if (this.permissionDenied) {
|
||||
this.finished = true
|
||||
this.mLoading = false
|
||||
return
|
||||
}
|
||||
this.mLoading = true
|
||||
$.get(loc() + '/pageData', this.pageForm, (res) => {
|
||||
if (res.code === 0) {
|
||||
@@ -99,10 +105,13 @@ layout("/mobile/platform.html"){
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
} else {
|
||||
this.permissionDenied = true
|
||||
this.finished = true
|
||||
vant.Toast(res.msg || '您没有慰问审核权限!')
|
||||
}
|
||||
this.mLoading = false
|
||||
})
|
||||
this.mLoading = false
|
||||
|
||||
},
|
||||
async flushUnits() {
|
||||
//this.$set(this.pageForm, "unitId", "")
|
||||
|
||||
@@ -103,6 +103,7 @@ layout("/mobile/platform.html"){
|
||||
await this.$refs.signature.updateSign()
|
||||
const resp = await $.post("/platform/fw/condolence/vcr/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
await doCompletes();
|
||||
this.$toast.success('审核成功');
|
||||
setTimeout(() => {
|
||||
history.back()
|
||||
|
||||
@@ -405,7 +405,7 @@ layout("/layouts/platform.html"){
|
||||
occur_time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
jtzz: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
poszdw: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
// files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
goods_desc: [{required: true, message: '请输入慰问品名称、编号、规格等', trigger: ['blur', 'change']}],
|
||||
mobile: [
|
||||
{required: true, message: '请输入慰问对象联系电话', trigger: ['blur', 'change']},
|
||||
@@ -414,7 +414,7 @@ layout("/layouts/platform.html"){
|
||||
birthday: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
// job_title: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
birth_child_num: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
sign: [{required: true, message: '请扫码签字', trigger: ['blur', 'change']}],
|
||||
// sign: [{required: true, message: '请扫码签字', trigger: ['blur', 'change']}],
|
||||
payee: [{required: true, message: '请选择收款人', trigger: ['blur', 'change']}],
|
||||
payee_bank_number: [{required: true, message: '请填写收款人银行卡', trigger: ['blur', 'change']}],
|
||||
payee_bank_name: [{required: true, message: '请填写收款人开户行', trigger: ['blur', 'change']}],
|
||||
@@ -557,10 +557,10 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async doAdd() {
|
||||
// 签字由自定义组件回写,提交前单独判断,避免 Element 表单漏过空签字。
|
||||
if (!this.formData.sign) {
|
||||
/*if (!this.formData.sign) {
|
||||
this.$message.warning('请扫码签字')
|
||||
return
|
||||
}
|
||||
}*/
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const formData = JSON.parse(JSON.stringify(this.formData))
|
||||
|
||||
Reference in New Issue
Block a user