流程重要操作限制admin才能操作

master
pengqiang 2022-08-26 16:57:19 +08:00
parent 4aeaba32d3
commit 8e7e62cb03
5 changed files with 37 additions and 33 deletions

View File

@ -4,6 +4,7 @@ package cn.palmte.work.controller.backend;
import cn.palmte.work.bean.ResponseMsg;
import cn.palmte.work.service.ActModelService;
import cn.palmte.work.utils.InterfaceUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -33,6 +34,7 @@ public class ActModelController extends BaseController {
Map<String, Object> model) {
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
model.put("pager", activitiModelService.list(searchInfo, pageNumber, pageSize));
model.put("userName", InterfaceUtil.getAdmin().getUserName());
return "/admin/act_model_list";
}

View File

@ -4,6 +4,7 @@ package cn.palmte.work.controller.backend;
import cn.palmte.work.bean.ResponseMsg;
import cn.palmte.work.service.ActProcDefService;
import cn.palmte.work.utils.ActUtil;
import cn.palmte.work.utils.InterfaceUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -35,6 +36,7 @@ public class ActProcDefController extends BaseController {
@RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
Map<String, Object> model) {
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
model.put("userName", InterfaceUtil.getAdmin().getUserName());
model.put("pager", actProcDefService.list(searchInfo, pageNumber, pageSize));
return "/admin/act_proc_def_list";
}

View File

@ -41,7 +41,7 @@ public class ActProcDefService {
QueryHelper queryHelper = new QueryHelper(select, " act_re_procdef p LEFT JOIN act_re_deployment d on p.DEPLOYMENT_ID_ = d.ID_");
String name = searchInfo.get("name");
queryHelper.addCondition(StringUtils.isNotEmpty(name), "(p.NAME_=? or p.KEY_=?)", name, name);
queryHelper.addOrderProperty("p.KEY_,p.VERSION_", false);
queryHelper.addOrderProperty("p.VERSION_", false);
return pagination.paginate(queryHelper.getSql(), ActProcDef.class, pageNumber, pageSize);
}

View File

@ -15,20 +15,19 @@
<div class="am-u-sm-12 am-u-md-6" style="padding:0px 1.6rem 1.6rem 1rem;margin:0px;">
<div class="am-btn-toolbar">
<div class="am-btn-group am-btn-group-xs">
<#--<@shiro.hasPermission name="ROLE_ADD">-->
<button type="button" class="am-btn am-btn-default"
onclick="location.href='${base}/actModel/add'">
<span class="am-icon-plus"></span>
新增
</button>
<#-- </@shiro.hasPermission>
<@shiro.hasPermission name="ROLE_DELRTE">-->
<button type="button" id="deleteButton" disabled="disabled"
class="am-btn am-btn-default"
onclick="deleteAll('${base}/actModel/delete')"><span
class="am-icon-trash-o"></span> 删除
</button>
<#--</@shiro.hasPermission>-->
<#if userName! == 'admin'>
<button type="button" class="am-btn am-btn-default"
onclick="location.href='${base}/actModel/add'">
<span class="am-icon-plus"></span>
新增
</button>
<button type="button" id="deleteButton" disabled="disabled"
class="am-btn am-btn-default"
onclick="deleteAll('${base}/actModel/delete')"><span
class="am-icon-trash-o"></span> 删除
</button>
</#if>
</div>
</div>
</div>
@ -75,22 +74,21 @@
<td>
<div class="am-btn-toolbar">
<div class="am-btn-group am-btn-group-xs">
<#if userName! == 'admin'>
<button type="button"
class="am-btn am-btn-default am-btn-xs am-text-secondary"
onclick="design(${list.id?c})" >
<span class="am-icon-pencil-square-o"></span>
流程设计
</button>
<button type="button"
class="am-btn am-btn-default am-btn-xs am-text-secondary"
onclick="design(${list.id?c})" >
<span class="am-icon-pencil-square-o"></span>
流程设计
</button>
<#--<@shiro.hasPermission name="ROLE_EDIT">-->
<button type="button"
class="am-btn am-btn-default am-btn-xs am-text-secondary"
onclick="deploy(${list.id?c})">
<span class="am-icon-pencil-square-o"></span>
部署
</button>
<#--</@shiro.hasPermission>-->
</#if>
</div>
</div>

View File

@ -16,11 +16,13 @@
<div class="am-btn-toolbar">
<div class="am-btn-group am-btn-group-xs">
<button type="button" id="deleteButton" disabled="disabled"
class="am-btn am-btn-default"
onclick="deleteAll('${base}/actProcDef/delete')"><span
class="am-icon-trash-o"></span> 删除
</button>
<#if userName! == 'admin'>
<button type="button" id="deleteButton" disabled="disabled"
class="am-btn am-btn-default"
onclick="deleteAll('${base}/actProcDef/delete')"><span
class="am-icon-trash-o"></span> 删除
</button>
</#if>
</div>
@ -59,7 +61,7 @@
<th class="table-title">流程标识</th>
<th class="table-date">版本</th>
<th class="table-date">预览</th>
<th class="table-date">激活/挂起</th>
<#--<th class="table-date">激活/挂起</th>-->
<th class="table-date">部署时间</th>
<th class="table-set am-text-center">操作</th>
</tr>
@ -92,14 +94,14 @@
</button>
</td>
<td>
<#--<td>
<div class="switch-button">
<#--1激活 2挂起-->
&lt;#&ndash;1激活 2挂起&ndash;&gt;
<input id="${list.id}" type="checkbox" data-size='xs'
data-am-switch data-on-text="已激活" data-off-text="已挂起"
<#if list.suspensionState==1 >checked</#if>/>
</div>
</td>
</td>-->
<td><#if list.deployTime??>${list.deployTime?datetime}</#if></td>
<td>
<div class="am-btn-toolbar">