[修改] 标签问题

This commit is contained in:
bupengxiang
2023-05-26 10:55:17 +08:00
parent d7c6203393
commit 400d5bc28a
14 changed files with 122 additions and 21 deletions
@@ -14,6 +14,7 @@ import com.adc.da.report.util.OSSClientUtil;
import com.adc.da.report.util.ObsBootUtil;
import com.adc.da.report.util.WaterMarkUtil;
import com.adc.da.report.vo.ChangeUploaderVo;
import com.adc.da.report.vo.ReportFilePageVO;
import com.adc.da.report.vo.ReportQueryVo;
import com.adc.da.report.vo.ReportVo;
import com.adc.da.util.exception.AdcDaBaseException;
@@ -619,4 +620,17 @@ public class ReportManageConroller {
reportService.delFile(reportFile);
return Result.success();
}
/**
* 文件分页查询
* @return
* @throws ParseException
*/
@ApiOperation("文件分页查询")
@PostMapping("/filePage")
public ResponseMessage filePage(@RequestBody ReportFilePageVO reportFilePageVO) throws Exception {
IPage<ReportFile> reportFileIPage = reportService.filePage(reportFilePageVO);
return Result.success(reportFileIPage);
}
}
@@ -1,7 +1,9 @@
package com.adc.da.report.dao.mysql;
import com.adc.da.report.eo.ReportFile;
import com.adc.da.report.vo.ReportFilePageVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -15,4 +17,6 @@ public interface ReportFileDao extends BaseMapper<ReportFile> {
void updateState(@Param("reportId")String dataId);
List<ReportFile> selectByReport(@Param("pageVO")ReportFile reportFile);
IPage<ReportFile> filePage(IPage<ReportFilePageVO> page,@Param("pageVO") ReportFilePageVO reportFilePageVO);
}
@@ -2,6 +2,7 @@ package com.adc.da.report.dao.mysql;
import com.adc.da.report.eo.ReportLabelEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author ThinkBook
@@ -11,6 +12,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ReportLabelDao extends BaseMapper<ReportLabelEntity> {
void actEndDelReport(@Param("reportId")String dataId);
void updateState(@Param("reportId")String dataId);
}
@@ -2,6 +2,7 @@ package com.adc.da.report.dao.mysql;
import com.adc.da.report.eo.TreeLabelEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -20,7 +21,7 @@ public interface TreeLabelDao extends BaseMapper<TreeLabelEntity> {
*/
double getMaxNum(String parentId);
List<String> selectIdByReport(String reportId);
List<String> selectIdByReport(@Param("reportId") String reportId,@Param("state") Integer state);
}
@@ -4,13 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* @author Caihaohan
* @TableName ts_report_label
@@ -46,12 +46,19 @@ public class ReportLabelEntity implements Serializable {
@TableField(value = "last_label")
private String lastLabel;
/**
* 状态 1 流程中 ,2 非流程中
*/
@TableField("state")
private Integer state;
@TableField(exist = false)
private static final long serialVersionUID = 121348721347890417L;
public ReportLabelEntity(String id, String reportId, String labelId) {
public ReportLabelEntity(String id, String reportId, String labelId,Integer state) {
this.id = id;
this.reportId = reportId;
this.labelId = labelId;
this.state = state;
}
}
@@ -3,6 +3,7 @@ package com.adc.da.report.service;
import com.adc.da.report.eo.ReportEntity;
import com.adc.da.report.eo.ReportFile;
import com.adc.da.report.vo.ChangeUploaderVo;
import com.adc.da.report.vo.ReportFilePageVO;
import com.adc.da.report.vo.ReportQueryVo;
import com.adc.da.report.vo.ReportVo;
import com.adc.da.util.http.ResponseMessage;
@@ -100,4 +101,5 @@ public interface IReportService {
void delFile(ReportFile reportFile);
IPage<ReportFile> filePage(ReportFilePageVO ReportFilePageVO);
}
@@ -11,10 +11,7 @@ import com.adc.da.report.dao.mysql.ReportLabelDao;
import com.adc.da.report.eo.*;
import com.adc.da.report.service.*;
import com.adc.da.report.util.*;
import com.adc.da.report.vo.ChangeUploaderVo;
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.report.vo.*;
import com.adc.da.sys.dao.mysql.RoleEODao;
import com.adc.da.sys.dao.mysql.UserEODao;
import com.adc.da.sys.entity.MenuEO;
@@ -171,7 +168,7 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
for (List<String> list : reportEntity.getLabelList()) {
String lastLabel = list.get(list.size() - 1);
ReportLabelEntity reportLabelEntity = new ReportLabelEntity(com.adc.da.util.utils.UUID.randomUUID10()
,reportId, JSON.toJSONString(list),lastLabel);
,reportId, JSON.toJSONString(list),lastLabel,1);
labelList.add(reportLabelEntity);
}
iReportLabelService.saveBatch(labelList);
@@ -205,6 +202,15 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
reportFileDao.deleteBatchIds(reportFile.getRfIdList());
}
@Override
public IPage<ReportFile> filePage(ReportFilePageVO reportFilePageVO) {
IPage<ReportFilePageVO> page = new Page<>();
page.setCurrent(reportFilePageVO.getCurrent());
page.setSize(reportFilePageVO.getSize());
return reportFileDao.filePage(page,reportFilePageVO);
}
/**
* 新增或编辑报告
*
@@ -287,7 +293,8 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
//插入报表标签关系表
labelList.forEach((label) -> {
ReportLabelEntity reportLabelEntity = new ReportLabelEntity(UUID.randomUUID10(), entity.getId(), label);
ReportLabelEntity reportLabelEntity = new ReportLabelEntity(UUID.randomUUID10(), entity.getId(),
label,2);
reportLabelDao.insert(reportLabelEntity);
});
@@ -768,6 +775,7 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
//设置标签列表
LambdaQueryWrapper<ReportLabelEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ReportLabelEntity::getReportId, reportId);
wrapper.eq(ReportLabelEntity::getState, 2);
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(reportLabelEntities)) {
List<String> reportLabelIds = reportLabelEntities.stream().map(ReportLabelEntity::getLabelId).collect(Collectors.toList());
@@ -3,10 +3,7 @@ package com.adc.da.report.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.adc.da.login.util.UserUtils;
import com.adc.da.report.dao.mysql.PowerApplyDao;
import com.adc.da.report.dao.mysql.ReportDao;
import com.adc.da.report.dao.mysql.ReportFileDao;
import com.adc.da.report.dao.mysql.TtReportManageActDao;
import com.adc.da.report.dao.mysql.*;
import com.adc.da.report.eo.LogEntity;
import com.adc.da.report.eo.ReportEntity;
import com.adc.da.report.eo.TtReportManageAct;
@@ -58,6 +55,9 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
@Autowired
private ReportFileDao reportFileDao;
@Autowired
private ReportLabelDao reportLabelDao;
/**
* @param ttReportManageActPageVO
* @return <com.adc.da.report.entity.TtReportManageAct>
@@ -162,6 +162,9 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
// 文件
reportFileDao.actEndDelReport(ttReportManageAct.getDataId());
reportFileDao.updateState(ttReportManageAct.getDataId());
//标签
reportLabelDao.actEndDelReport(ttReportManageAct.getDataId());
reportLabelDao.updateState(ttReportManageAct.getDataId());
try {
iReportContentService.insertReportContent(ttReportManageAct.getDataId());
log.info("抽取报告内容");
@@ -0,0 +1,15 @@
package com.adc.da.report.vo;
public class ReportFilePageVO extends BasePageVO{
private String id;
private String reportId;
private String fileId;
/**
* 状态 1 流程中 ,2 非流程中
*/
private Integer state;
}
@@ -38,4 +38,16 @@
</if>
</where>
</select>
<select id="filePage" resultType="com.adc.da.report.eo.ReportFile">
select rf.*,f.file_name as fileName from ts_report_file rf
LEFT JOIN ts_file f on f.FILE_ID = rf.file_id
<where>
<if test="pageVO.reportId !=null and pageVO.reportId !=''">
AND report_id = #{pageVO.reportId}
</if>
<if test="pageVO.state !=null">
AND state = #{pageVO.state}
</if>
</where>
</select>
</mapper>
@@ -0,0 +1,17 @@
<?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.ReportLabelDao">
<update id="updateState">
update ts_report_label set state = 2
where report_id = #{reportId}
</update>
<delete id="actEndDelReport">
delete from ts_report_label
<where>
report_id = #{reportId}
and state = 2
</where>
</delete>
</mapper>
@@ -21,6 +21,6 @@
<select id="selectIdByReport" resultType="java.lang.String">
select rl.label_id from
ts_report_label rl
where rl.report_id = #{reportId}
where rl.report_id = #{reportId} and rl.state =#{state}
</select>
</mapper>
@@ -120,7 +120,7 @@ public class ActivitDefineService {
JSONArray objects = JSONObject.parseArray(label);
String lastLabel =(String)objects.get(objects.size()-1);
ReportLabelEntity reportLabelEntity = new ReportLabelEntity(com.adc.da.util.utils.UUID.randomUUID10()
,ttReportManageAct.getDataId(), label,lastLabel);
,ttReportManageAct.getDataId(), label,lastLabel,1);
labelList.add(reportLabelEntity);
}
iReportLabelService.saveBatch(labelList);
@@ -154,7 +154,7 @@ public class ActivitDefineService {
JSONArray objects = JSONObject.parseArray(label);
String lastLabel =(String)objects.get(objects.size()-1);
ReportLabelEntity reportLabelEntity = new ReportLabelEntity(com.adc.da.util.utils.UUID.randomUUID10()
,ttReportManageAct.getDataId(), label,lastLabel);
,ttReportManageAct.getDataId(), label,lastLabel,1);
labelList.add(reportLabelEntity);
}
iReportLabelService.saveBatch(labelList);
@@ -626,8 +626,15 @@ public class TodoTaskController {
reportFileDao.selectByReport(new ReportFile(ttReportManageAct.getDataId(),2));
ttReportManageAct.setFileList(reportFiles);
}
List<String> labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId());
ttReportManageAct.setLabelList(labelList);
List<String> labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId(),1);
if (labelList.size()>0){
//流程未结束
ttReportManageAct.setLabelList(labelList);
}else {
//流程已结束
labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId(),2);
ttReportManageAct.setLabelList(labelList);
}
String string = JSONArray.toJSONString(ttReportManageAct);
//去对应的 数据表查数据
busProcessNewVO.setDataJson(string);
@@ -646,8 +653,15 @@ public class TodoTaskController {
reportFileDao.selectByReport(new ReportFile(ttReportManageAct.getDataId(),2));
ttReportManageAct.setFileList(reportFiles);
}
List<String> labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId());
ttReportManageAct.setLabelList(labelList);
List<String> labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId(),1);
if (labelList.size()>0){
//流程未结束
ttReportManageAct.setLabelList(labelList);
}else {
//流程已结束
labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId(),2);
ttReportManageAct.setLabelList(labelList);
}
String string = JSONArray.toJSONString(ttReportManageAct);
//去对应的 数据表查数据
busProcessNewVO.setDataJson(string);