Merge remote-tracking branch 'origin/lixuetao' into lixuetao

This commit is contained in:
bupengxiang
2023-05-09 18:10:20 +08:00
2 changed files with 17 additions and 9 deletions
@@ -10,6 +10,7 @@ import com.adc.da.report.vo.ReportDetailThumbUpVo;
import com.adc.da.report.vo.ReportLogPageVO;
import com.adc.da.util.utils.StringUtils;
import com.adc.da.util.utils.UUID;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
@@ -167,8 +168,12 @@ public class IReportLogBookServiceImpl extends ServiceImpl<ReportLogBookDao, Rep
return reportLogBook.getId();
}
private void thumbDown(String logId) {
removeById(logId);
private void thumbDown(String reportId) {
LambdaQueryWrapper<ReportLogBook> reportLogBookLambdaQueryWrapper = new LambdaQueryWrapper<>();
reportLogBookLambdaQueryWrapper.eq(ReportLogBook::getReportId, reportId);
reportLogBookLambdaQueryWrapper.eq(ReportLogBook::getType, 3);
reportLogBookLambdaQueryWrapper.eq(ReportLogBook::getUserId, UserUtils.getUserId());
remove(reportLogBookLambdaQueryWrapper);
}
@Override
@@ -179,7 +184,7 @@ public class IReportLogBookServiceImpl extends ServiceImpl<ReportLogBookDao, Rep
String logId = thumbUp(reportId);
reportDetailThumbUpVo.setLogId(logId);
} else {
thumbDown(entity.getId());
thumbDown(reportId);
}
//计算已有点赞数
Integer count = getThumbUpCount(reportId);
@@ -537,12 +537,15 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
});
} else {
list.getRecords().forEach(reportVo -> {
//其余人员只能预览公开报告(涉密等级:公开(内部公开)、隐私等级:不涉及用户隐私)
if (reportVo.getConfidentialLevel().equals(PUBLIC_REPORT) &&
reportVo.getPrivacyLevel().equals(NO_USER_PRIVACY_INVOLVED)) {
reportVo.setPower(PREVIEW);
} else {
reportVo.setPower(NONE);
//只有用户没有权限的时候才给默认权限
if (reportVo.getPower() == null) {
//其余人员只能预览公开报告(涉密等级:公开(内部公开)、隐私等级:不涉及用户隐私)
if (reportVo.getConfidentialLevel().equals(PUBLIC_REPORT) &&
reportVo.getPrivacyLevel().equals(NO_USER_PRIVACY_INVOLVED)) {
reportVo.setPower(PREVIEW);
} else {
reportVo.setPower(NONE);
}
}
});
}