流程重要操作限制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.bean.ResponseMsg;
import cn.palmte.work.service.ActModelService; import cn.palmte.work.service.ActModelService;
import cn.palmte.work.utils.InterfaceUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -33,6 +34,7 @@ public class ActModelController extends BaseController {
Map<String, Object> model) { Map<String, Object> model) {
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model); ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
model.put("pager", activitiModelService.list(searchInfo, pageNumber, pageSize)); model.put("pager", activitiModelService.list(searchInfo, pageNumber, pageSize));
model.put("userName", InterfaceUtil.getAdmin().getUserName());
return "/admin/act_model_list"; 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.bean.ResponseMsg;
import cn.palmte.work.service.ActProcDefService; import cn.palmte.work.service.ActProcDefService;
import cn.palmte.work.utils.ActUtil; import cn.palmte.work.utils.ActUtil;
import cn.palmte.work.utils.InterfaceUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; 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, @RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
Map<String, Object> model) { Map<String, Object> model) {
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model); ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
model.put("userName", InterfaceUtil.getAdmin().getUserName());
model.put("pager", actProcDefService.list(searchInfo, pageNumber, pageSize)); model.put("pager", actProcDefService.list(searchInfo, pageNumber, pageSize));
return "/admin/act_proc_def_list"; 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_"); 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"); String name = searchInfo.get("name");
queryHelper.addCondition(StringUtils.isNotEmpty(name), "(p.NAME_=? or p.KEY_=?)", name, 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); 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-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-toolbar">
<div class="am-btn-group am-btn-group-xs"> <div class="am-btn-group am-btn-group-xs">
<#--<@shiro.hasPermission name="ROLE_ADD">--> <#if userName! == 'admin'>
<button type="button" class="am-btn am-btn-default" <button type="button" class="am-btn am-btn-default"
onclick="location.href='${base}/actModel/add'"> onclick="location.href='${base}/actModel/add'">
<span class="am-icon-plus"></span> <span class="am-icon-plus"></span>
新增 新增
</button> </button>
<#-- </@shiro.hasPermission>
<@shiro.hasPermission name="ROLE_DELRTE">--> <button type="button" id="deleteButton" disabled="disabled"
<button type="button" id="deleteButton" disabled="disabled" class="am-btn am-btn-default"
class="am-btn am-btn-default" onclick="deleteAll('${base}/actModel/delete')"><span
onclick="deleteAll('${base}/actModel/delete')"><span class="am-icon-trash-o"></span> 删除
class="am-icon-trash-o"></span> 删除 </button>
</button> </#if>
<#--</@shiro.hasPermission>-->
</div> </div>
</div> </div>
</div> </div>
@ -75,22 +74,21 @@
<td> <td>
<div class="am-btn-toolbar"> <div class="am-btn-toolbar">
<div class="am-btn-group am-btn-group-xs"> <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" <button type="button"
class="am-btn am-btn-default am-btn-xs am-text-secondary" class="am-btn am-btn-default am-btn-xs am-text-secondary"
onclick="deploy(${list.id?c})"> onclick="deploy(${list.id?c})">
<span class="am-icon-pencil-square-o"></span> <span class="am-icon-pencil-square-o"></span>
部署 部署
</button> </button>
<#--</@shiro.hasPermission>--> </#if>
</div> </div>
</div> </div>

View File

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