Merge remote-tracking branch 'origin/lixuetao' into lixuetao
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.report.constant;
|
||||
|
||||
/**
|
||||
* @author: CaiHaohan
|
||||
* @Date: 2023/5/9 14:50
|
||||
* @Description: power_apply表power字段对应的权限
|
||||
*/
|
||||
public class PowerApplyConstants {
|
||||
|
||||
/**
|
||||
* 无权限
|
||||
*/
|
||||
public static final Integer NONE = 0;
|
||||
|
||||
/**
|
||||
* 预览权限
|
||||
*/
|
||||
public static final Integer PREVIEW = 1;
|
||||
|
||||
/**
|
||||
* 预览 + 下载
|
||||
*/
|
||||
public static final Integer PREVIEW_DOWNLOAD = 2;
|
||||
|
||||
/**
|
||||
* 下载权限
|
||||
*/
|
||||
public static final Integer DOWNLOAD = 3;
|
||||
}
|
||||
@@ -13,4 +13,16 @@ public class ReportConstants {
|
||||
public static final String FILE_EXTENSIONS_PPTX = "pptx";
|
||||
public static final String FILE_EXTENSIONS_PDF = "pdf";
|
||||
|
||||
/**
|
||||
* 公开报告(内部公开)
|
||||
*/
|
||||
public static final String PUBLIC_REPORT = "公开";
|
||||
|
||||
/**
|
||||
* 不涉及用户隐私
|
||||
*/
|
||||
public static final String NO_USER_PRIVACY_INVOLVED = "不涉及用户隐私";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ public class ReportLogBookController {
|
||||
public ResponseMessage getThumbUpCount(String reportId){
|
||||
|
||||
//根据报告id和当前登录用户id获取点赞数
|
||||
ReportDetailThumbUpVo result = reportLogBookService.getThumbUpCount(reportId);
|
||||
ReportDetailThumbUpVo result = reportLogBookService.thumbUpCount(reportId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class ReportRatingController {
|
||||
/**
|
||||
* 获取报告评分
|
||||
*/
|
||||
@ApiOperation(value = "给报告评分")
|
||||
@ApiOperation(value = "获取报告评分")
|
||||
@GetMapping("/rating")
|
||||
public ResponseMessage getRating(String reportId) {
|
||||
return reportUserRatingService.getRating(reportId);
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface IReportLogBookService {
|
||||
* @param reportId
|
||||
* @return
|
||||
*/
|
||||
ReportDetailThumbUpVo getThumbUpCount(String reportId);
|
||||
ReportDetailThumbUpVo thumbUpCount(String reportId);
|
||||
|
||||
/**
|
||||
* 点赞或者取消点赞
|
||||
@@ -41,4 +41,34 @@ public interface IReportLogBookService {
|
||||
* @return
|
||||
*/
|
||||
ReportDetailThumbUpVo thumbUpOrDown(String reportId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取点击量
|
||||
* @param reportId
|
||||
* @return
|
||||
*/
|
||||
Integer getClickCount(String reportId);
|
||||
|
||||
/**
|
||||
* 获取下载量
|
||||
* @param reportId
|
||||
* @return
|
||||
*/
|
||||
Integer getDownloadCount(String reportId);
|
||||
|
||||
/**
|
||||
* 获取预览量
|
||||
* @param reportId
|
||||
* @return
|
||||
*/
|
||||
Integer getPreviewCount(String reportId);
|
||||
|
||||
/**
|
||||
* 获取点赞量
|
||||
* @param reportId
|
||||
* @return
|
||||
*/
|
||||
Integer getThumbUpCount(String reportId);
|
||||
|
||||
}
|
||||
|
||||
+23
-4
@@ -113,7 +113,7 @@ public class IReportLogBookServiceImpl extends ServiceImpl<ReportLogBookDao, Rep
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReportDetailThumbUpVo getThumbUpCount(String reportId) {
|
||||
public ReportDetailThumbUpVo thumbUpCount(String reportId) {
|
||||
//查找是否有点赞记录
|
||||
ReportLogBook entity = findThumbUpLog(reportId);
|
||||
ReportDetailThumbUpVo reportDetailThumbUpVo = new ReportDetailThumbUpVo();
|
||||
@@ -121,12 +121,31 @@ public class IReportLogBookServiceImpl extends ServiceImpl<ReportLogBookDao, Rep
|
||||
reportDetailThumbUpVo.setLogId(entity.getId());
|
||||
}
|
||||
//计算已有点赞数
|
||||
Integer count = thumbUpCount(reportId);
|
||||
Integer count = getThumbUpCount(reportId);
|
||||
reportDetailThumbUpVo.setThumbUpCount(count);
|
||||
return reportDetailThumbUpVo;
|
||||
}
|
||||
|
||||
private Integer thumbUpCount(String reportId) {
|
||||
@Override
|
||||
public Integer getClickCount(String reportId) {
|
||||
return query().eq("report_id", reportId)
|
||||
.eq("type", 4).count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDownloadCount(String reportId) {
|
||||
return query().eq("report_id", reportId)
|
||||
.eq("type", 2).count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getPreviewCount(String reportId) {
|
||||
return query().eq("report_id", reportId)
|
||||
.eq("type", 1).count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getThumbUpCount(String reportId) {
|
||||
return query().eq("report_id", reportId)
|
||||
.eq("type", 3).count();
|
||||
}
|
||||
@@ -163,7 +182,7 @@ public class IReportLogBookServiceImpl extends ServiceImpl<ReportLogBookDao, Rep
|
||||
thumbDown(entity.getId());
|
||||
}
|
||||
//计算已有点赞数
|
||||
Integer count = thumbUpCount(reportId);
|
||||
Integer count = getThumbUpCount(reportId);
|
||||
reportDetailThumbUpVo.setThumbUpCount(count);
|
||||
return reportDetailThumbUpVo;
|
||||
}
|
||||
|
||||
+182
-18
@@ -14,7 +14,9 @@ import com.adc.da.report.vo.ReportDetailVo;
|
||||
import com.adc.da.report.vo.ReportQueryVo;
|
||||
import com.adc.da.report.vo.ReportVo;
|
||||
import com.adc.da.sys.dao.mysql.RoleEODao;
|
||||
import com.adc.da.sys.dao.mysql.UserEODao;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.adc.da.util.utils.CollectionUtils;
|
||||
@@ -31,6 +33,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -43,6 +46,10 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.adc.da.report.constant.PowerApplyConstants.*;
|
||||
import static com.adc.da.report.constant.ReportConstants.NO_USER_PRIVACY_INVOLVED;
|
||||
import static com.adc.da.report.constant.ReportConstants.PUBLIC_REPORT;
|
||||
|
||||
/**
|
||||
* @Author doudxw
|
||||
* @Date 2021/11/9 08:37
|
||||
@@ -101,6 +108,16 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
@Resource
|
||||
private IPowerApplyService iPowerApplyService;
|
||||
|
||||
@Resource
|
||||
private IReportLogBookService reportLogBookService;
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private IReportUserRatingService reportUserRatingService;
|
||||
|
||||
@Resource
|
||||
private UserEODao userEODao;
|
||||
|
||||
|
||||
/**
|
||||
* 新增或编辑报告
|
||||
@@ -365,24 +382,83 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
return list;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public IPage<ReportVo> page(ReportQueryVo vo) {
|
||||
// IPage<ReportEntity> page = new Page<>();
|
||||
// page.setCurrent(vo.getPageNo());
|
||||
// page.setSize(vo.getPageSize());
|
||||
// //判断是不是管理员
|
||||
// boolean admin = false;
|
||||
// List<RoleEO> roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
|
||||
// for (RoleEO roleEO : roleEOList) {
|
||||
// if ("管理员".equals(roleEO.getName())){
|
||||
// admin= !admin;
|
||||
// }
|
||||
// }
|
||||
// if (admin) {
|
||||
// vo.setUsid(null);
|
||||
// } else {
|
||||
// vo.setUsid(UserUtils.getUserId());
|
||||
// }
|
||||
//
|
||||
// //按照labelId筛选
|
||||
// Set<String> idSet = new HashSet<>();
|
||||
// if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
|
||||
// LambdaQueryWrapper<ReportLabelEntity> reportLabelEntityWrapper = new LambdaQueryWrapper<>();
|
||||
// reportLabelEntityWrapper.in(ReportLabelEntity::getLabelId, vo.getLabelId());
|
||||
// List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
|
||||
// reportLabelEntities.forEach(reportLabelEntity -> {
|
||||
// idSet.add(reportLabelEntity.getReportId());
|
||||
// });
|
||||
// idSet.add("1");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// IPage<ReportVo> list = reportDao.page(page, vo,idSet);
|
||||
// //获取所有报告的labelId
|
||||
// list.getRecords().forEach((reportVo) -> {
|
||||
// reportVo.setLabelList(findLabelList(reportVo.getId()));
|
||||
// });
|
||||
// list.getRecords().forEach(c -> {
|
||||
// FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
|
||||
// if (StringUtils.isEmpty(fileEntity.getFileType())) {
|
||||
// c.setFileType(null);
|
||||
// }
|
||||
// //ppt文件
|
||||
// else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
|
||||
// ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||
// c.setFileType("1");
|
||||
// }
|
||||
// //excel文件
|
||||
// else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
|
||||
// ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||
// c.setFileType("2");
|
||||
// }
|
||||
// //pdf文件
|
||||
// else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||
// c.setFileType("3");
|
||||
// }
|
||||
// //word文件
|
||||
// else {
|
||||
// c.setFileType("4");
|
||||
// }
|
||||
//
|
||||
// //文件大小
|
||||
// c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
|
||||
// ? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
|
||||
// c.setFileName(fileEntity.getFileName());
|
||||
// List<String> userIdList = reportUserDao.selectList(
|
||||
// new QueryWrapper<ReportUserEntity>().eq("reportId", c.getId()))
|
||||
// .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
|
||||
// });
|
||||
// return list;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public IPage<ReportVo> page(ReportQueryVo vo) {
|
||||
IPage<ReportEntity> page = new Page<>();
|
||||
page.setCurrent(vo.getPageNo());
|
||||
page.setSize(vo.getPageSize());
|
||||
//判断是不是管理员
|
||||
boolean admin = false;
|
||||
List<RoleEO> roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
|
||||
for (RoleEO roleEO : roleEOList) {
|
||||
if ("管理员".equals(roleEO.getName())){
|
||||
admin= !admin;
|
||||
}
|
||||
}
|
||||
if (admin) {
|
||||
vo.setUsid(null);
|
||||
} else {
|
||||
vo.setUsid(UserUtils.getUserId());
|
||||
}
|
||||
|
||||
//按照labelId筛选
|
||||
Set<String> idSet = new HashSet<>();
|
||||
@@ -396,12 +472,81 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
idSet.add("1");
|
||||
}
|
||||
|
||||
|
||||
IPage<ReportVo> list = reportDao.page(page, vo,idSet);
|
||||
//获取所有报告的labelId
|
||||
list.getRecords().forEach((reportVo) -> {
|
||||
reportVo.setLabelList(findLabelList(reportVo.getId()));
|
||||
|
||||
//查询下载量
|
||||
list.getRecords().forEach(c -> {
|
||||
Integer downloadCount = reportLogBookService.getDownloadCount(c.getId());
|
||||
c.setDownload(downloadCount);
|
||||
});
|
||||
//查询点击量
|
||||
list.getRecords().forEach(c -> {
|
||||
Integer clickCount = reportLogBookService.getClickCount(c.getId());
|
||||
c.setClicks(clickCount);
|
||||
});
|
||||
//查询点赞量
|
||||
list.getRecords().forEach(c -> {
|
||||
Integer thumbUpCount = reportLogBookService.getThumbUpCount(c.getId());
|
||||
c.setThumbUp(thumbUpCount);
|
||||
});
|
||||
//查询报告评级
|
||||
list.getRecords().forEach(c -> {
|
||||
Double ratingAvg = reportUserRatingService.getRatingAvg(c.getId());
|
||||
c.setRating(ratingAvg);
|
||||
});
|
||||
//按查询条件排序
|
||||
//按时间排序
|
||||
if (vo.getOrderByTime() != null) {
|
||||
if (vo.getOrderByTime().equals(0)) {
|
||||
list.getRecords().sort(Comparator.comparing(ReportVo::getCreateDate).reversed());
|
||||
}
|
||||
if (vo.getOrderByTime().equals(1)) {
|
||||
list.getRecords().sort(Comparator.comparing(ReportVo::getCreateDate));
|
||||
}
|
||||
}
|
||||
|
||||
//按点击量排序
|
||||
if (vo.getOrderByClicks() != null) {
|
||||
if (vo.getOrderByClicks().equals(0)) {
|
||||
list.getRecords().sort(Comparator.comparing(ReportVo::getClicks).reversed());
|
||||
}
|
||||
if (vo.getOrderByClicks().equals(1)) {
|
||||
list.getRecords().sort(Comparator.comparing(ReportVo::getClicks));
|
||||
}
|
||||
}
|
||||
|
||||
//按下载量排序
|
||||
if (vo.getOrderByDownload() != null) {
|
||||
if (vo.getOrderByDownload().equals(0)) {
|
||||
list.getRecords().sort(Comparator.comparing(ReportVo::getDownload).reversed());
|
||||
}
|
||||
if (vo.getOrderByDownload().equals(1)) {
|
||||
list.getRecords().sort(Comparator.comparing(ReportVo::getDownload));
|
||||
}
|
||||
}
|
||||
|
||||
//设置权限
|
||||
UserEO userEo = userEODao.selectById(UserUtils.getUserId());
|
||||
String levelId = userEo.getLevelId() == null ? "1.0" : userEo.getLevelId();
|
||||
//用户级别
|
||||
double level = Double.parseDouble(levelId);
|
||||
//总监拥有全部报告的预览和下载权力
|
||||
if (level <= 0.5) {
|
||||
list.getRecords().forEach(reportVo -> {
|
||||
reportVo.setPower(PREVIEW_DOWNLOAD);
|
||||
});
|
||||
} 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
list.getRecords().forEach(c -> {
|
||||
FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
|
||||
if (StringUtils.isEmpty(fileEntity.getFileType())) {
|
||||
@@ -554,7 +699,26 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
if (reportDetailVo.getCreateUserId().equals(UserUtils.getUserId())) {
|
||||
reportDetailVo.setDownPower(1);
|
||||
} else {
|
||||
//TODO 写对应的查询权限逻辑
|
||||
reportDetailVo.setDownPower(0);
|
||||
//查看申请权限表的权限
|
||||
LambdaQueryWrapper<PowerApply> powerApplyLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
powerApplyLambdaQueryWrapper.eq(PowerApply::getPower, 3);
|
||||
powerApplyLambdaQueryWrapper.eq(PowerApply::getPower, 2);
|
||||
List<PowerApply> list = iPowerApplyService.list(powerApplyLambdaQueryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list.forEach(powerApply -> {
|
||||
if (powerApply.getUserId().equals(UserUtils.getUserId())) {
|
||||
reportDetailVo.setDownPower(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
UserEO userEo = userEODao.selectById(UserUtils.getUserId());
|
||||
String levelId = userEo.getLevelId() == null ? "1.0" : userEo.getLevelId();
|
||||
//用户级别
|
||||
double level = Double.parseDouble(levelId);
|
||||
if (level <= 0.5) {
|
||||
reportDetailVo.setDownPower(1);
|
||||
}
|
||||
}
|
||||
return Result.success(reportDetailVo);
|
||||
}
|
||||
|
||||
+4
@@ -62,8 +62,12 @@ public class IReportUserRatingServiceImpl extends ServiceImpl<ReportUserRatingDa
|
||||
@Override
|
||||
public Double getRatingAvg(String reportId) {
|
||||
QueryWrapper<ReportUserRatingEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("report_id", reportId);
|
||||
wrapper.select("AVG(user_rating) as user_rating");
|
||||
List<Map<String, Object>> result = reportUserRatingDao.selectMaps(wrapper);
|
||||
if (result.get(0) == null) {
|
||||
return 0.0;
|
||||
}
|
||||
BigDecimal userRating = (BigDecimal) result.get(0).get("user_rating");
|
||||
return userRating.doubleValue();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.adc.da.report.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -95,4 +92,9 @@ public class ReportDetailVo {
|
||||
* 下载权限(0没有1有)
|
||||
*/
|
||||
private Integer downPower;
|
||||
|
||||
/**
|
||||
* 用户权限级别
|
||||
*/
|
||||
private Double levelId;
|
||||
}
|
||||
|
||||
@@ -21,31 +21,47 @@ public class ReportQueryVo {
|
||||
*/
|
||||
private int pageSize;
|
||||
|
||||
/**
|
||||
* 报告名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 全文模糊检索的关键词
|
||||
*/
|
||||
private String keyContent;
|
||||
|
||||
/**
|
||||
* 标签集合
|
||||
*/
|
||||
private List<String> labelId;
|
||||
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
private List<String> year;
|
||||
|
||||
/**
|
||||
* 报告名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 标签集合
|
||||
*/
|
||||
private List<String> labelId;
|
||||
|
||||
/**
|
||||
* 按时间排序(0代表最新发布的排名最前 1相反)
|
||||
*/
|
||||
private Integer orderByTime;
|
||||
|
||||
/**
|
||||
* 按点击量排序(0代表点击量最多的报告排序在最前 1相反)
|
||||
*/
|
||||
private Integer orderByClicks;
|
||||
|
||||
/**
|
||||
* 按下载量排序(0代表下载量最多的报告排名最前 1相反)
|
||||
*/
|
||||
private Integer orderByDownload;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String usid;
|
||||
|
||||
|
||||
private List<String> ids;
|
||||
|
||||
//
|
||||
|
||||
@@ -30,6 +30,7 @@ public class ReportVo {
|
||||
* 权限
|
||||
*/
|
||||
private Integer power;
|
||||
|
||||
/**
|
||||
* 主要内容
|
||||
*/
|
||||
@@ -94,4 +95,30 @@ public class ReportVo {
|
||||
* 文件大小
|
||||
*/
|
||||
private String fileSize;
|
||||
|
||||
/**
|
||||
* 报告评级
|
||||
*/
|
||||
private Integer reportRating;
|
||||
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer thumbUp;
|
||||
|
||||
/**
|
||||
* 点击量
|
||||
*/
|
||||
private Integer clicks;
|
||||
|
||||
/**
|
||||
* 下载量
|
||||
*/
|
||||
private Integer download;
|
||||
|
||||
/**
|
||||
* 报告评级
|
||||
*/
|
||||
private Double rating;
|
||||
|
||||
}
|
||||
|
||||
@@ -103,22 +103,21 @@
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
eo.createUserId,
|
||||
tu.USNAME,
|
||||
eo.createDate,
|
||||
pa.report_id,
|
||||
pa.user_id,
|
||||
pa.power
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
INNER JOIN ts_report_label AS trl ON eo.id = trl.report_id
|
||||
LEFT JOIN ts_user tu ON tu.USID = eo.createUserId
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and (ru.userId = #{pageVO.usid}
|
||||
or eo.id in (
|
||||
SELECT tt.report_id from power_apply tt WHERE tt.user_id = #{pageVO.usid})
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
@@ -243,7 +242,7 @@
|
||||
rm.confidentialLevel AS confidentialLevel,
|
||||
rm.privacyLevel AS privacyLevel
|
||||
FROM `tt_report_manage` AS rm
|
||||
INNER JOIN ts_user AS u ON u.USID = rm.createUserId
|
||||
LEFT JOIN ts_user AS u ON u.USID = rm.createUserId
|
||||
WHERE rm.id = #{reportId}
|
||||
AND rm.del_flag = 0
|
||||
</select>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
<select id="page" resultType="com.adc.da.report.vo.ReportCommentVo">
|
||||
SELECT
|
||||
ruc.id AS id,
|
||||
ruc.user_id AS userId,
|
||||
u.USNAME AS userName,
|
||||
ruc.comment AS comment,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<License>
|
||||
<Data>
|
||||
<Products>
|
||||
<Product>Aspose.Total for Java</Product>
|
||||
<Product>Aspose.Words for Java</Product>
|
||||
</Products>
|
||||
<EditionType>Enterprise</EditionType>
|
||||
<SubscriptionExpiry>20991231</SubscriptionExpiry>
|
||||
<LicenseExpiry>20991231</LicenseExpiry>
|
||||
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
|
||||
</Data>
|
||||
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>
|
||||
</License>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.report.dao.mysql.LabelDao">
|
||||
|
||||
<select id="getMaxNum" parameterType="string" resultType="int">
|
||||
select max(t.orderNum) from TS_LABEL t where type=#{type}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,250 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.report.dao.mysql.ReportDao">
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="BaseColumnList">
|
||||
id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel,
|
||||
createUserId, createDate, updateDate, del_flag,secrecy_last
|
||||
</sql>
|
||||
|
||||
<sql id="BaseColumnValue">
|
||||
#{Vo.id},#{Vo.name},#{Vo.keycontent},#{Vo.maincontent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.del_flag},
|
||||
#{Vo.secrecyLast}
|
||||
</sql>
|
||||
|
||||
<insert id="saveReportAct">
|
||||
insert into TT_REPORT_MANAGE (<include refid="BaseColumnList"/>)
|
||||
value (
|
||||
#{Vo.dataId},#{Vo.name},#{Vo.keyContent},#{Vo.mainContent},#{Vo.department},#{Vo.year},#{Vo.fileId},
|
||||
#{Vo.confidentialLevel},#{Vo.privacyLevel},
|
||||
#{Vo.createUserId},
|
||||
#{Vo.createDate},#{Vo.updateDate},#{Vo.delFlag},
|
||||
#{Vo.secrecyLast})
|
||||
</insert>
|
||||
|
||||
<select id="getReportDateList" parameterType="string" resultType="string">
|
||||
select distinct year from TT_REPORT_MANAGE t1
|
||||
left join TR_REPORT_USER t2 on t1.id=t2.reportId
|
||||
where del_flag='0'
|
||||
<if test="usid !='' and usid !=null">
|
||||
and t2.userId=#{usid}
|
||||
</if>
|
||||
ORDER BY year DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getAddReportPage" resultType="com.adc.da.report.vo.ReportVo">
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
AND eo.id NOT IN ( SELECT ru.reportId FROM tr_report_user ru WHERE ru.userId = #{pageVO.usid} )
|
||||
AND eo.id NOT IN ( SELECT tt.report_id FROM power_apply tt WHERE tt.user_id = #{pageVO.usid} )
|
||||
AND eo.id NOT IN (SELECT tt.report_id FROM power_apply_act tt LEFT JOIN bus_process_name pro on tt.prc_id = pro.PRC_ID WHERE tt.user_id = #{pageVO.usid} and
|
||||
del_flag != 1 and pro.SUBMIT_STATUS = 1)
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
<!--年份搜索-->
|
||||
<if test="pageVO.year != null and pageVO.year.size() > 0">
|
||||
and year in
|
||||
<foreach collection="pageVO.year" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="page" resultType="com.adc.da.report.vo.ReportVo">
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id,
|
||||
pa.power
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
INNER JOIN ts_report_label AS trl ON eo.id = trl.report_id
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and (ru.userId = #{pageVO.usid}
|
||||
or eo.id in (
|
||||
SELECT tt.report_id from power_apply tt WHERE tt.user_id = #{pageVO.usid})
|
||||
)
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
<if test="pageVO.keyContent !='' and pageVO.keyContent != null">
|
||||
and keycontent like CONCAT(CONCAT('%',#{pageVO.keyContent}),'%')
|
||||
</if>
|
||||
<!--年份搜索-->
|
||||
<if test="pageVO.year != null and pageVO.year.size() > 0">
|
||||
and year in
|
||||
<foreach collection="pageVO.year" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--id搜索-->
|
||||
<if test="idSet !=null and idSet.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="idSet" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
</select>
|
||||
|
||||
<select id="reportManagerPage" parameterType="com.adc.da.report.vo.ReportQueryVo" resultType="com.adc.da.report.vo.ReportVo">
|
||||
SELECT DISTINCT
|
||||
trl.report_id AS id,
|
||||
t.year,
|
||||
t.name,
|
||||
t.keycontent,
|
||||
t.fileId,
|
||||
t.createDate,
|
||||
t.department,
|
||||
t.maincontent,
|
||||
t.confidentialLevel,
|
||||
t.privacyLevel
|
||||
FROM `tt_report_manage` AS t
|
||||
INNER JOIN ts_report_label AS trl ON t.id = trl.report_id
|
||||
WHERE t.del_flag = 0
|
||||
<!--报表名称搜索-->
|
||||
<if test="Vo.name != null and Vo.name != ''">
|
||||
and t.name like CONCAT(CONCAT('%',#{Vo.name}),'%')
|
||||
</if>
|
||||
|
||||
<!--年份搜索-->
|
||||
<if test="Vo.year != null and Vo.year.size() > 0">
|
||||
and t.year in
|
||||
<foreach collection="Vo.year" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--id搜索-->
|
||||
<if test="idSet !=null and idSet.size() > 0">
|
||||
and t.id in
|
||||
<foreach collection="idSet" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--id搜索-->
|
||||
<if test="Vo.ids !=null and Vo.ids.size() > 0">
|
||||
and t.id in
|
||||
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--用户搜索-->
|
||||
<if test="Vo.usid != null and Vo.usid != ''">
|
||||
and t.createUserId=#{Vo.usid}
|
||||
</if>
|
||||
|
||||
ORDER BY updateDate desc
|
||||
</select>
|
||||
<select id="isAct" resultType="java.lang.String">
|
||||
SELECT rep.name FROM power_apply_act tt
|
||||
LEFT JOIN bus_process_name pro on tt.prc_id = pro.PRC_ID
|
||||
LEFT JOIN tt_report_manage rep on tt.report_id = rep.id
|
||||
WHERE tt.user_id = #{Vo.usid} and tt.del_flag != 1 and
|
||||
pro.SUBMIT_STATUS = 1
|
||||
and tt.report_id in
|
||||
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
GROUP BY rep.id;
|
||||
</select>
|
||||
|
||||
<select id="selectByidAndName" resultType="java.lang.Long">
|
||||
select count(1) from tt_report_manage rep
|
||||
<where>
|
||||
rep.Name = #{Vo.name}
|
||||
and rep.del_flag = 0
|
||||
<if test="Vo.id != null and Vo.id != ''">
|
||||
and rep.id != #{Vo.id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="reportDetail" resultType="com.adc.da.report.vo.ReportDetailVo">
|
||||
SELECT
|
||||
rm.id AS id,
|
||||
rm.name AS `name`,
|
||||
rm.createUserId AS createUserId,
|
||||
u.USNAME AS uploaderName,
|
||||
rm.keycontent AS keycontent,
|
||||
rm.maincontent AS maincontent,
|
||||
rm.department AS departmentName,
|
||||
rm.`year` AS `year`,
|
||||
rm.fileId AS fileId,
|
||||
rm.confidentialLevel AS confidentialLevel,
|
||||
rm.privacyLevel AS privacyLevel
|
||||
FROM `tt_report_manage` AS rm
|
||||
INNER JOIN ts_user AS u ON u.USID = rm.createUserId
|
||||
WHERE rm.id = #{reportId}
|
||||
AND rm.del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user