资产授权
parent
8ed8f6ebcf
commit
c483b034c2
|
@ -177,4 +177,30 @@ public class DataRunNameController {
|
|||
int i = assetAuthorizationService.delDeptAssetAccredit(req);
|
||||
return i>0?Result.success():Result.error();
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询资产赋权用户信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
@PostMapping("/findUserIdList")
|
||||
@Operation(summary = "查询资产赋权用户信息",
|
||||
description = "查询资产赋权用户信息")
|
||||
public Result findUserIdList(@RequestBody AssetAuthorization req){
|
||||
List<Long> list = assetAuthorizationService.findUserIdList(req);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产赋权部门的信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
@PostMapping("/findDeptIdList")
|
||||
@Operation(summary = "查询资产赋权部门的信息",
|
||||
description = "查询资产赋权部门的信息")
|
||||
public Result findDeptIdList(@RequestBody AssetAuthorization req){
|
||||
List<Long> list = assetAuthorizationService.findDeptIdList(req);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,4 +59,18 @@ public interface DataRunNameMapper {
|
|||
* @return 返回结果
|
||||
*/
|
||||
Integer addDeptAssetAuthorization(AssetAuthorization authorization);
|
||||
|
||||
/**
|
||||
* 查询资产赋权用户信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
List<Long> findUserIdList(AssetAuthorization req);
|
||||
|
||||
/**
|
||||
* 查询资产赋权部门的信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
List<Long> findDeptIdList(AssetAuthorization req);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.server.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.domain.AssetAuthorization;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.service
|
||||
|
@ -24,4 +26,18 @@ public interface AssetAuthorizationService extends IService<AssetAuthorization>
|
|||
* @return 返回结果
|
||||
*/
|
||||
int delDeptAssetAccredit(AssetAuthorization req);
|
||||
|
||||
/**
|
||||
* 查询资产赋权用户信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
List<Long> findUserIdList(AssetAuthorization req);
|
||||
|
||||
/**
|
||||
* 查询资产赋权部门的信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
List<Long> findDeptIdList(AssetAuthorization req);
|
||||
}
|
||||
|
|
|
@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.domain.AssetAuthorization;
|
||||
import com.muyu.server.mapper.AssetAuthorizationMapper;
|
||||
import com.muyu.server.mapper.DataRunNameMapper;
|
||||
import com.muyu.server.service.AssetAuthorizationService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.service.impl
|
||||
|
@ -22,6 +25,7 @@ public class AssetAuthorizationServiceImpl
|
|||
implements AssetAuthorizationService {
|
||||
|
||||
private final AssetAuthorizationMapper assetAuthorizationMapper;
|
||||
private final DataRunNameMapper dataRunNameMapper;
|
||||
|
||||
/**
|
||||
* 删除用户权限方法
|
||||
|
@ -57,4 +61,26 @@ public class AssetAuthorizationServiceImpl
|
|||
int delete = assetAuthorizationMapper.delete(queryWrapper);
|
||||
return delete;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产赋权用户信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
@Override
|
||||
public List<Long> findUserIdList(AssetAuthorization req) {
|
||||
List<Long> userIdList = dataRunNameMapper.findUserIdList(req);
|
||||
return userIdList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产赋权部门的信息
|
||||
* @param req 响应参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
@Override
|
||||
public List<Long> findDeptIdList(AssetAuthorization req) {
|
||||
List<Long> deptIdList = dataRunNameMapper.findDeptIdList(req);
|
||||
return deptIdList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,4 +111,34 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="findUserIdList" resultType="java.lang.Long">
|
||||
SELECT
|
||||
su.user_id
|
||||
FROM
|
||||
h6_cloud_server.sys_user su
|
||||
LEFT JOIN asset_impower aa ON su.user_id = aa.user_id
|
||||
<where>
|
||||
<if test="tableId!=null">
|
||||
and aa.table_id = #{tableId}
|
||||
</if>
|
||||
<if test="basicId!=null">
|
||||
and aa.basic_id = #{basicId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="findDeptIdList" resultType="java.lang.Long">
|
||||
SELECT
|
||||
sd.dept_id
|
||||
FROM
|
||||
h6_cloud_server.sys_dept sd
|
||||
LEFT JOIN asset_impower aa on sd.dept_id = aa.dept_id
|
||||
<where>
|
||||
<if test="tableId!=null">
|
||||
and aa.table_id = #{tableId}
|
||||
</if>
|
||||
<if test="basicId!=null">
|
||||
and aa.basic_id = #{basicId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue