bug
This commit is contained in:
parent
c4dda44f15
commit
c25d20b87b
@ -70,7 +70,11 @@
|
|||||||
<el-table-column label="角色类型" prop="type" :show-overflow-tooltip="true" width="200" />
|
<el-table-column label="角色类型" prop="type" :show-overflow-tooltip="true" width="200" />
|
||||||
<el-table-column label="状态" align="center" width="200">
|
<el-table-column label="状态" align="center" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<span v-if="roleList.length==3">
|
||||||
|
{{scope.row.status=='A'?'启用':'禁用'}}
|
||||||
|
</span>
|
||||||
<el-switch
|
<el-switch
|
||||||
|
v-else
|
||||||
v-model="scope.row.status"
|
v-model="scope.row.status"
|
||||||
active-value="A"
|
active-value="A"
|
||||||
inactive-value="N"
|
inactive-value="N"
|
||||||
@ -110,22 +114,23 @@
|
|||||||
<el-dialog :title="title" :visible.sync="open" width="700px" class="common-dialog" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="700px" class="common-dialog" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="角色名称" prop="roleName">
|
<el-form-item label="角色名称" prop="roleName">
|
||||||
<el-input v-model="form.roleName" style="width: 300px" placeholder="请输入角色名称" />
|
<el-input :disabled="roleList.length==3" v-model="form.roleName" style="width: 300px" placeholder="请输入角色名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色类型" prop="roleType">
|
<el-form-item label="角色类型" prop="roleType">
|
||||||
<el-select
|
<el-select
|
||||||
|
:disabled="roleList.length==3"
|
||||||
v-model="form.roleType"
|
v-model="form.roleType"
|
||||||
placeholder="角色类型"
|
placeholder="角色类型"
|
||||||
style="width: 300px"
|
style="width: 300px"
|
||||||
>
|
>
|
||||||
<el-option key="1" label="超级管理员" value="1"/>
|
<el-option key="1" label="超级管理员" value="1"/>
|
||||||
<el-option key="2" label="普通管理员" value="2"/>
|
<el-option key="2" label="普通管理员" value="2"/>
|
||||||
<!-- <el-option key="3" label="用户角色" value="3"/> -->
|
<el-option key="3" label="用户角色" value="3"/>
|
||||||
<el-option key="3" label="员工角色" value="3"/>
|
<el-option key="4" label="员工角色" value="4"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status" :disabled="roleList.length==3">
|
||||||
<el-radio key="A" label="A" value="A">启用</el-radio>
|
<el-radio key="A" label="A" value="A">启用</el-radio>
|
||||||
<el-radio key="N" label="N" value="N">禁用</el-radio>
|
<el-radio key="N" label="N" value="N">禁用</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
@ -9,7 +9,8 @@ package com.fuint.common.enums;
|
|||||||
public enum AdminRoleEnum {
|
public enum AdminRoleEnum {
|
||||||
ADMIN("1", "超级管理员","admin"),
|
ADMIN("1", "超级管理员","admin"),
|
||||||
COMMON("2", "普通管理员","common"),
|
COMMON("2", "普通管理员","common"),
|
||||||
USER("3", "用户角色","user");
|
USER("3", "用户角色","user"),
|
||||||
|
STAFF("4", "员工角色","staff");
|
||||||
|
|
||||||
private String key;
|
private String key;
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -23,6 +23,13 @@ public interface SourceService extends IService<TSource> {
|
|||||||
*/
|
*/
|
||||||
List<TSource> getAvailableSources(Integer merchantId);
|
List<TSource> getAvailableSources(Integer merchantId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取有效的菜单集合
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TSource> getAvailableSources1(Integer merchantId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取菜单的属性结构
|
* 获取菜单的属性结构
|
||||||
*
|
*
|
||||||
|
@ -2,8 +2,10 @@ package com.fuint.common.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuint.common.domain.TreeSelect;
|
import com.fuint.common.domain.TreeSelect;
|
||||||
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.enums.StatusEnum;
|
import com.fuint.common.enums.StatusEnum;
|
||||||
import com.fuint.common.service.SourceService;
|
import com.fuint.common.service.SourceService;
|
||||||
|
import com.fuint.common.util.TokenUtil;
|
||||||
import com.fuint.common.vo.MetaVo;
|
import com.fuint.common.vo.MetaVo;
|
||||||
import com.fuint.common.vo.RouterVo;
|
import com.fuint.common.vo.RouterVo;
|
||||||
import com.fuint.framework.annoation.OperationServiceLog;
|
import com.fuint.framework.annoation.OperationServiceLog;
|
||||||
@ -42,6 +44,11 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
|
|||||||
return tSourceMapper.findByStatus(merchantId, StatusEnum.ENABLED.getKey());
|
return tSourceMapper.findByStatus(merchantId, StatusEnum.ENABLED.getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TSource> getAvailableSources1(Integer merchantId) {
|
||||||
|
return tSourceMapper.findByStatus1(merchantId, StatusEnum.ENABLED.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取菜单的属性结构
|
* 获取菜单的属性结构
|
||||||
*
|
*
|
||||||
@ -49,7 +56,9 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TreeNode> getSourceTree(Integer merchantId) {
|
public List<TreeNode> getSourceTree(Integer merchantId) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
List<TSource> tSources = getAvailableSources(merchantId);
|
List<TSource> tSources = getAvailableSources(merchantId);
|
||||||
|
if (nowAccountInfo.getRoleIds().equals("14")) tSources = getAvailableSources1(1);
|
||||||
List<TreeNode> trees = new ArrayList<>();
|
List<TreeNode> trees = new ArrayList<>();
|
||||||
if (tSources != null && tSources.size() > 0) {
|
if (tSources != null && tSources.size() > 0) {
|
||||||
TreeNode sourceTreeNode = null;
|
TreeNode sourceTreeNode = null;
|
||||||
@ -100,7 +109,7 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
|
|||||||
@Override
|
@Override
|
||||||
public List<TSource> getMenuListByUserId(Integer merchantId, Integer accountId) {
|
public List<TSource> getMenuListByUserId(Integer merchantId, Integer accountId) {
|
||||||
if (merchantId == null) {
|
if (merchantId == null) {
|
||||||
merchantId = 0;
|
merchantId = 1;
|
||||||
}
|
}
|
||||||
List<TSource> sourceList = tSourceMapper.findSourcesByAccountId(merchantId, accountId);
|
List<TSource> sourceList = tSourceMapper.findSourcesByAccountId(merchantId, accountId);
|
||||||
return delRepeated(sourceList);
|
return delRepeated(sourceList);
|
||||||
|
@ -86,6 +86,7 @@ public class BackendDutyController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
paginationRequest.setSearchParams(searchParams);
|
paginationRequest.setSearchParams(searchParams);
|
||||||
|
paginationRequest.setRoleIds(accountInfo.getRoleIds());
|
||||||
PaginationResponse<TDuty> paginationResponse = tDutyService.findDutiesByPagination(paginationRequest);
|
PaginationResponse<TDuty> paginationResponse = tDutyService.findDutiesByPagination(paginationRequest);
|
||||||
List<RoleDto> content = new ArrayList<>();
|
List<RoleDto> content = new ArrayList<>();
|
||||||
if (paginationResponse.getContent().size() > 0) {
|
if (paginationResponse.getContent().size() > 0) {
|
||||||
|
@ -252,7 +252,17 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
lambdaQueryWrapper.orderByDesc(TDuty::getDutyId);
|
lambdaQueryWrapper.orderByDesc(TDuty::getDutyId);
|
||||||
List<TDuty> dataList = tDutyMapper.selectList(lambdaQueryWrapper);
|
List<TDuty> dataList1 = tDutyMapper.selectList(lambdaQueryWrapper);
|
||||||
|
List<TDuty> dataList = new ArrayList<>();
|
||||||
|
if (paginationRequest.getRoleIds().equals("14")){
|
||||||
|
for (TDuty tDuty : dataList1) {
|
||||||
|
if (tDuty.getDutyId()==12) dataList.add(tDuty);
|
||||||
|
if (tDuty.getDutyId()==15) dataList.add(tDuty);
|
||||||
|
if (tDuty.getDutyId()==16) dataList.add(tDuty);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
dataList = dataList1;
|
||||||
|
}
|
||||||
|
|
||||||
PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
|
PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
|
||||||
PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());
|
PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.fuint.framework.pagination;
|
package com.fuint.framework.pagination;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -9,6 +11,7 @@ import java.util.Map;
|
|||||||
* Created by FSQ
|
* Created by FSQ
|
||||||
* CopyRight https://www.fuint.cn
|
* CopyRight https://www.fuint.cn
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class PaginationRequest implements Serializable {
|
public class PaginationRequest implements Serializable {
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
@ -33,6 +36,10 @@ public class PaginationRequest implements Serializable {
|
|||||||
* 分页查询参数
|
* 分页查询参数
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> searchParams;
|
private Map<String, Object> searchParams;
|
||||||
|
/**
|
||||||
|
* 角色id
|
||||||
|
*/
|
||||||
|
private String roleIds;
|
||||||
|
|
||||||
public int getCurrentPage() {
|
public int getCurrentPage() {
|
||||||
return currentPage;
|
return currentPage;
|
||||||
|
@ -19,4 +19,6 @@ public interface TSourceMapper extends BaseMapper<TSource> {
|
|||||||
|
|
||||||
List<TSource> findByStatus(@Param("merchantId") Integer merchantId, @Param("status") String status);
|
List<TSource> findByStatus(@Param("merchantId") Integer merchantId, @Param("status") String status);
|
||||||
|
|
||||||
|
List<TSource> findByStatus1(@Param("merchantId") Integer merchantId, @Param("status") String status);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,15 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.fuint.repository.mapper.TSourceMapper">
|
<mapper namespace="com.fuint.repository.mapper.TSourceMapper">
|
||||||
<select id="findSourcesByAccountId" resultType="com.fuint.repository.model.TSource">
|
<select id="findSourcesByAccountId" resultType="com.fuint.repository.model.TSource">
|
||||||
SELECT s.* FROM `t_source` s WHERE s.status='A' AND (s.merchant_id = 0 OR s.merchant_id = #{merchantId}) AND source_id IN(SELECT source_id FROM `t_duty_source` WHERE duty_id IN(SELECT duty_id FROM `t_account_duty` WHERE acct_id = #{accountId})) ORDER BY s.source_style ASC
|
SELECT s.* FROM `t_source` s
|
||||||
|
WHERE s.status='A'
|
||||||
|
<if test="merchantId != null and merchantId > 0">
|
||||||
|
AND (s.merchant_id = 0 OR s.merchant_id = #{merchantId})
|
||||||
|
</if>
|
||||||
|
AND source_id IN(SELECT source_id FROM `t_duty_source`
|
||||||
|
WHERE duty_id IN(SELECT duty_id FROM `t_account_duty`
|
||||||
|
WHERE acct_id = #{accountId}))
|
||||||
|
ORDER BY s.source_style ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findByIdIn" resultType="com.fuint.repository.model.TSource">
|
<select id="findByIdIn" resultType="com.fuint.repository.model.TSource">
|
||||||
@ -21,4 +29,12 @@
|
|||||||
</if>
|
</if>
|
||||||
order by source_style asc
|
order by source_style asc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findByStatus1" resultType="com.fuint.repository.model.TSource">
|
||||||
|
select * from t_source s
|
||||||
|
where s.status = #{status}
|
||||||
|
<if test="merchantId != null and merchantId > 0">
|
||||||
|
and s.merchant_id = #{merchantId}
|
||||||
|
</if>
|
||||||
|
order by source_style asc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user