Commit 32eb377a authored by hongguangwu's avatar hongguangwu

EKP1.7.7-新增税务主体权限

parent faefe72f
......@@ -163,4 +163,10 @@ public class SysMenu extends BaseEntity {
@Schema(description = "查询字段维度,如果fdId超长,则使用本字段")
private String queryFields;
/**
* 税务主体字段ID
*/
@Schema(description = "税务主体字段ID")
private String taxId;
}
......@@ -53,7 +53,7 @@ public class SysUserPermission extends BaseEntity {
/**
* 权限类型 客户、商机、报价单、
* 1客户权限;2商机;3报价单;4合同;5项目;6BU;7条线;8部门;9收入归属
* 1客户权限;2商机;3报价单;4合同;5项目;6BU;7条线;8部门;9收入归属;10二级指标归属;11税务主体
*/
@Schema(description = "权限类型")
private String permissionType;
......
......@@ -94,4 +94,5 @@ public class SysMenuController {
public R<SysMenu> getById(@PathVariable("id") String id) {
return R.ok(sysMenuService.getById(id));
}
}
......@@ -22,6 +22,8 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
*/
IPage<SysMenu> getSysMenuPage(Page<SysMenu> page, @Param("sysMenu") SysMenuSearchVo sysMenu);
IPage<SysTaxVo> getSysTaxVoPage(Page<SysTaxVo> page, @Param("vo") SysTaxVo vo);
/**
* 判断是否存在此菜单
*
......
......@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionExportVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -117,6 +114,14 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
*/
IPage<SysUserDeptVo> selectTwoGsVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* @Description: 查找税务主体分页
* @Author: hgw
* @Date: 2024/1/10 16:27
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo>
**/
IPage<SysUserDeptVo> selectTaxVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据类型查询字典值
*
......@@ -197,6 +202,14 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
*/
Integer selectTwoGsCount(@Param("name") String name);
/**
* @Description: 查询税务主体是否存在
* @Author: hgw
* @Date: 2024/1/10 16:22
* @return: java.lang.Integer
**/
Integer selectTaxCount(@Param("name") String name);
/**
* @param userId
* @Description: 查找当前用户的所有权限
......
......@@ -35,4 +35,5 @@ public interface SysMenuService extends IService<SysMenu> {
* @return
*/
R<Boolean> updateMenu(SysMenu menu);
}
......@@ -72,7 +72,8 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
}
if (CommonConstants.SIX_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.SEVEN_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.TEN_STRING.equals(sysUserPermission.getPermissionType())) {
|| CommonConstants.TEN_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.TWELVE_STRING.equals(sysUserPermission.getPermissionType())) {
permission = this.getOne(Wrappers.<SysUserPermission>query().lambda()
.eq(SysUserPermission::getEmpLoginName, sysUserPermission.getEmpLoginName())
.eq(SysUserPermission::getPermissionType, sysUserPermission.getPermissionType())
......@@ -167,6 +168,9 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
} else if (CommonConstants.TEN_STRING.equals(searchVo.getType()) ) {
//二级指标归属权限
iPage = baseMapper.selectTwoGsVO(page, searchVo.getName());
} else if (CommonConstants.TWELVE_STRING.equals(searchVo.getType()) ) {
//税务主体
iPage = baseMapper.selectTaxVO(page, searchVo.getName());
} else {
//项目权限
if (Common.isNotNull(user.getId()) && CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
......@@ -310,7 +314,8 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
flag.append("_");
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType()) ||
CommonConstants.SEVEN_STRING.equals(insert.getPermissionType()) ||
CommonConstants.TEN_STRING.equals(insert.getPermissionType())) {
CommonConstants.TEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())) {
flag.append(excel.getName());
} else {
flag.append(excel.getCode());
......@@ -326,13 +331,16 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
//判断此登录名是否已经存在此权限维度
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType())
|| CommonConstants.SEVEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.TEN_STRING.equals(insert.getPermissionType())) {
|| CommonConstants.TEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())) {
//判断对应维度的名称是否存在
Integer count;
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectDictByName(excel.getName(), "bu");
} else if (CommonConstants.TEN_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectTwoGsCount(excel.getName());
} else if (CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectTaxCount(excel.getName());
} else {
count = baseMapper.selectDictByName(excel.getName(), "line");
}
......
......@@ -31,6 +31,7 @@
<result property="isOpen" column="IS_OPEN"/>
<result property="tableName" column="TABLE_NAME"/>
<result property="queryFields" column="QUERY_FIELDS"/>
<result property="taxId" column="TAX_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -55,7 +56,8 @@
a.VIEW_ID,
a.CREATE_TIME,
a.TABLE_NAME,
a.QUERY_FIELDS
a.QUERY_FIELDS,
a.TAX_ID
</sql>
<sql id="sysMenu_where">
<if test="sysMenu != null">
......
......@@ -217,6 +217,17 @@
</if>
</select>
<!-- 查找税务主体分页 -->
<select id="selectTaxVO" resultMap="nameAndCodeMap">
select a.fd_3afab4c6755286 AS name
from ekp_7e091e5e36848fb97451 a
where a.fd_3afab4c6755286 is not null
<if test="name != null and name.trim() != ''">
AND a.fd_3afab4c6755286 like concat('%',#{name},'%')
</if>
GROUP BY a.fd_3afab4c6755286 ORDER BY a.fd_3afab4c6755286 desc
</select>
<!--根据部门编码查询id-->
<select id="selectSettleByCode" resultType="java.lang.String">
SELECT
......@@ -298,6 +309,13 @@
where a.fd_3b1235d8f35c6c = #{name}
</select>
<select id="selectTaxCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_7e091e5e36848fb97451 a
where a.fd_3afab4c6755286 = #{name}
</select>
<!-- 查找当前用户的所有权限 -->
<select id="getUserPermissionByUserId" resultMap="sysUserPermissionMap">
select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment