Browse Source

修改数据质量查询的权限判断 (#10977)

Co-authored-by: fanwanlong <fanwanlong@kezaihui.com>
3.1.0-release
jackfanwan 2 years ago committed by GitHub
parent
commit
ccb7641468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DqExecuteResultServiceImpl.java
  2. 2
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DqExecuteResultServiceTest.java
  3. 5
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/DqExecuteResultMapper.java
  4. 4
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DqExecuteResultMapper.xml

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DqExecuteResultServiceImpl.java

@ -87,7 +87,7 @@ public class DqExecuteResultServiceImpl extends BaseServiceImpl implements DqExe
dqExecuteResultMapper.queryResultListPaging( dqExecuteResultMapper.queryResultListPaging(
page, page,
searchVal, searchVal,
loginUser.getId(), loginUser,
statusArray, statusArray,
ruleType, ruleType,
start, start,

2
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DqExecuteResultServiceTest.java

@ -85,7 +85,7 @@ public class DqExecuteResultServiceTest {
page.setTotal(1); page.setTotal(1);
page.setRecords(getExecuteResultList()); page.setRecords(getExecuteResultList());
when(dqExecuteResultMapper.queryResultListPaging( when(dqExecuteResultMapper.queryResultListPaging(
any(IPage.class), eq(""), eq(loginUser.getId()), any(),eq(ruleType), eq(start), eq(end))).thenReturn(page); any(IPage.class), eq(""), eq(loginUser), any(),eq(ruleType), eq(start), eq(end))).thenReturn(page);
Result result = dqExecuteResultService.queryResultListPaging( Result result = dqExecuteResultService.queryResultListPaging(
loginUser,searchVal,1,0,"2020-01-01 00:00:00","2020-01-02 00:00:00",1,10); loginUser,searchVal,1,0,"2020-01-01 00:00:00","2020-01-02 00:00:00",1,10);

5
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/DqExecuteResultMapper.java

@ -18,6 +18,7 @@
package org.apache.dolphinscheduler.dao.mapper; package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.DqExecuteResult; import org.apache.dolphinscheduler.dao.entity.DqExecuteResult;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -36,7 +37,7 @@ public interface DqExecuteResultMapper extends BaseMapper<DqExecuteResult> {
* *
* @param page page * @param page page
* @param searchVal searchVal * @param searchVal searchVal
* @param userId userId * @param user user
* @param statusArray states * @param statusArray states
* @param ruleType ruleType * @param ruleType ruleType
* @param startTime startTime * @param startTime startTime
@ -44,7 +45,7 @@ public interface DqExecuteResultMapper extends BaseMapper<DqExecuteResult> {
*/ */
IPage<DqExecuteResult> queryResultListPaging(IPage<DqExecuteResult> page, IPage<DqExecuteResult> queryResultListPaging(IPage<DqExecuteResult> page,
@Param("searchVal") String searchVal, @Param("searchVal") String searchVal,
@Param("userId") int userId, @Param("user") User user,
@Param("states") int[] statusArray, @Param("states") int[] statusArray,
@Param("ruleType") int ruleType, @Param("ruleType") int ruleType,
@Param("startTime") Date startTime, @Param("startTime") Date startTime,

4
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DqExecuteResultMapper.xml

@ -62,8 +62,8 @@
#{i} #{i}
</foreach> </foreach>
</if> </if>
<if test=" userId != 1"> <if test=" user.userType.code != 0">
and a.user_id = #{userId} and a.user_id = #{user.id}
</if> </if>
<if test=" ruleType != -1"> <if test=" ruleType != -1">
and a.rule_type = #{ruleType} and a.rule_type = #{ruleType}

Loading…
Cancel
Save