bug: 政策资料修改
This commit is contained in:
+15
-10
@@ -118,6 +118,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
|||||||
});
|
});
|
||||||
sarLawsInformation.setViewableBy(String.join(",", viewableBy));
|
sarLawsInformation.setViewableBy(String.join(",", viewableBy));
|
||||||
}
|
}
|
||||||
|
sarLawsInformation.setDownloadable(false);
|
||||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper2 = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SarLawsInformationAuth> wrapper2 = new LambdaQueryWrapper<>();
|
||||||
wrapper2.eq(SarLawsInformationAuth::getLawsInformationId, sarLawsInformation.getId());
|
wrapper2.eq(SarLawsInformationAuth::getLawsInformationId, sarLawsInformation.getId());
|
||||||
wrapper2.eq(SarLawsInformationAuth::getAuthType, "downloadableBy");
|
wrapper2.eq(SarLawsInformationAuth::getAuthType, "downloadableBy");
|
||||||
@@ -134,6 +135,16 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
sarLawsInformation.setDownloadableBy(String.join(",", downloadableBy));
|
sarLawsInformation.setDownloadableBy(String.join(",", downloadableBy));
|
||||||
|
} else {
|
||||||
|
sarLawsInformation.setDownloadable(true);
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<SarLawsInformationAuth> wrapper3 = new LambdaQueryWrapper<>();
|
||||||
|
wrapper3.eq(SarLawsInformationAuth::getLawsInformationId, sarLawsInformation.getId());
|
||||||
|
wrapper3.eq(SarLawsInformationAuth::getAuthType, "createAndApproveBy");
|
||||||
|
wrapper3.eq(SarLawsInformationAuth::getUserId, userId);
|
||||||
|
int count = authService.count(wrapper3);
|
||||||
|
if (count > 0) {
|
||||||
|
sarLawsInformation.setDownloadable(true);
|
||||||
}
|
}
|
||||||
return sarLawsInformation;
|
return sarLawsInformation;
|
||||||
}
|
}
|
||||||
@@ -147,6 +158,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
|||||||
// 查询有权限的资料ID
|
// 查询有权限的资料ID
|
||||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
||||||
|
wrapper.eq(SarLawsInformationAuth::getAuthType, "viewableBy");
|
||||||
|
wrapper.or().eq(SarLawsInformationAuth::getAuthType, "createAndApproveBy");
|
||||||
wrapper.select(SarLawsInformationAuth::getLawsInformationId);
|
wrapper.select(SarLawsInformationAuth::getLawsInformationId);
|
||||||
List<SarLawsInformationAuth> informationAuthList = authService.list(wrapper);
|
List<SarLawsInformationAuth> informationAuthList = authService.list(wrapper);
|
||||||
if (informationAuthList.size() > 0) {
|
if (informationAuthList.size() > 0) {
|
||||||
@@ -348,6 +361,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
|||||||
// 查询有权限的资料ID
|
// 查询有权限的资料ID
|
||||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
||||||
|
wrapper.eq(SarLawsInformationAuth::getAuthType, "viewableBy");
|
||||||
|
wrapper.or().eq(SarLawsInformationAuth::getAuthType, "createAndApproveBy");
|
||||||
wrapper.select(SarLawsInformationAuth::getLawsInformationId);
|
wrapper.select(SarLawsInformationAuth::getLawsInformationId);
|
||||||
List<SarLawsInformationAuth> informationAuthList = authService.list(wrapper);
|
List<SarLawsInformationAuth> informationAuthList = authService.list(wrapper);
|
||||||
if (informationAuthList.size() > 0) {
|
if (informationAuthList.size() > 0) {
|
||||||
@@ -683,16 +698,6 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
|||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equalsSet(Set<?> set1, Set<?> set2){
|
|
||||||
if(set1 == null || set2 ==null){//null就直接不比了
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(set1.size()!=set2.size()){//大小不同也不用比了
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return set1.containsAll(set2);//最后比containsAll
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user