Commit 4c02d490 authored by huyuchen's avatar huyuchen

菜单权限修改

parent 567d6873
......@@ -30,7 +30,7 @@ import java.util.List;
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysuserpermission")
@Tag(name = "新权限-用户权限表管理")
@Tag(name = "用户权限表管理")
public class SysUserPermissionController {
private final SysUserPermissionService sysUserPermissionService;
......@@ -66,12 +66,12 @@ public class SysUserPermissionController {
* @param sysUserPermission 新权限-用户权限表
* @return R
*/
@Operation(description = "新增新权限-用户权限表:hasPermission('permission_sysuserpermission_add')")
@SysLog("新增新权限-用户权限表")
@Operation(description = "新增用户权限表:hasPermission('permission_sysuserpermission_add')")
@SysLog("新增用户权限表")
@PostMapping
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission_add')")
public R<Boolean> save(@RequestBody SysUserPermission sysUserPermission) {
return R.ok(sysUserPermissionService.save(sysUserPermission));
public R save(@RequestBody SysUserPermission sysUserPermission) {
return sysUserPermissionService.savePermission(sysUserPermission);
}
/**
......@@ -80,8 +80,8 @@ public class SysUserPermissionController {
* @param sysUserPermission 新权限-用户权限表
* @return R
*/
@Operation(description = "修改新权限-用户权限表:hasPermission('permission_sysuserpermission_edit')")
@SysLog("修改新权限-用户权限表")
@Operation(description = "修改用户权限表:hasPermission('permission_sysuserpermission_edit')")
@SysLog("修改用户权限表")
@PutMapping
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission_edit')")
public R<Boolean> updateById(@RequestBody SysUserPermission sysUserPermission) {
......@@ -94,8 +94,8 @@ public class SysUserPermissionController {
* @param idList
* @return R
*/
@Operation(description = "通过id删除新权限-用户权限表:hasPermission('permission_sysuserpermission_del')")
@SysLog("通过id删除新权限-用户权限表")
@Operation(description = "通过id删除用户权限表:hasPermission('permission_sysuserpermission_del')")
@SysLog("通过id删除用户权限表")
@PostMapping("/deleteByIds")
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission_del')")
public R<Boolean> removeById(@RequestBody List<String> idList) {
......@@ -109,8 +109,8 @@ public class SysUserPermissionController {
* @date 2023-08-29 14:49:40
**/
@SneakyThrows
@Operation(description = "批量新增新权限-用户权限表 hasPermission('permission_sysuserpermission-batch-import')")
@SysLog("批量新增新权限-用户权限表")
@Operation(description = "批量新增用户权限表 hasPermission('permission_sysuserpermission-batch-import')")
@SysLog("批量新增用户权限表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
......@@ -123,8 +123,9 @@ public class SysUserPermissionController {
* @author hyc
* @date 2023-08-29 14:49:40
**/
@Operation(description = "导出新权限-用户权限表")
@Operation(description = "导出用户权限表")
@PostMapping("/export")
@SysLog("批量导出用户权限表")
public void export(HttpServletResponse response, @RequestBody SysUserPermissionSearchVo searchVo) {
sysUserPermissionService.listExport(response, searchVo);
}
......
......@@ -101,6 +101,68 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
*/
IPage<SysUserDeptVo> selectDeptVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据类型查询字典值
*
* @param type 类型
* @return
*/
List<SysDictVo> selectDictByType(@Param("type") String type);
/**
* 根据类型和名称判断字典值是否存在
*
* @param type 类型
* @return
*/
Integer selectDictByName(@Param("name") String name,@Param("type") String type);
/**
* 根据名称或者编码查询数据
* 单位权限
* @param name 名称
* @return
*/
Integer selectUnitCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 合同权限
* @param name 名称
* @return
*/
Integer selectContractCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 项目权限
* @param name 名称
* @return
*/
Integer selectSettleCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 商机权限
* @param name 名称
* @return
*/
Integer selectBusinessCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 报价单权限
* @param name 名称
* @return
*/
Integer selectQuotationCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 部门&&收入归属权限
* @param name 名称
* @return
*/
Integer selectDeptCount(@Param("name") String name);
}
......@@ -28,6 +28,12 @@ public interface SysUserPermissionService extends IService<SysUserPermission> {
*/
IPage<SysUserPermission> getSysUserPermissionPage(Page<SysUserPermission> page, SysUserPermissionSearchVo sysUserPermission);
/**
* 新增权限
* @param sysUserPermission 新权限-用户权限表
*/
R savePermission(SysUserPermission sysUserPermission);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, SysUserPermissionSearchVo searchVo);
......
......@@ -11,6 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -24,6 +25,7 @@ import java.util.List;
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
/**
......
......@@ -212,4 +212,55 @@
where a.dict_type = #{type}
</select>
<!--针对BU归属和条线类型时的存在判断-->
<select id="selectDictByName" resultType="java.lang.Integer">
SELECT
count(1)
from permission_type a
where a.dict_type = #{type} and a.name = #{name}
</select>
<!--判断对应维度的名称或者编码是否存在-->
<select id="selectUnitCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_05b7485fd444f95a6177 a
where a.fd_3a9d1d4d438bfc = #{name}
</select>
<select id="selectContractCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_0103c453b2848c3bb31c a
where a.fd_3ade33763baa0e = #{name}
</select>
<select id="selectSettleCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_24a8e6a7fc143bb8c48a a
where a.fd_3a37fe508071fe = #{name}
</select>
<select id="selectBusinessCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_2f8e08660c542d8a169f a
where a.fd_3b107f1084fd96 = #{name}
</select>
<select id="selectQuotationCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_2f8e08660c542d8a169f a
where a.fd_3b04b9dc64a9f4 = #{name}
</select>
<select id="selectDeptCount" resultType="java.lang.Integer">
SELECT
count(1)
from sys_org_element a
where a.fd_is_available = '1' and fd_org_type = 2 and a.fd_no = #{name}
</select>
</mapper>
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