diff --git a/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java b/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java index b8f5dba..5d7c54a 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java +++ b/adc-da-report/src/main/java/com/adc/da/report/controller/ReportManageConroller.java @@ -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 reportFileIPage = reportService.filePage(reportFilePageVO); + return Result.success(reportFileIPage); + } + } diff --git a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportFileDao.java b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportFileDao.java index 13b42d8..feb115c 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportFileDao.java +++ b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportFileDao.java @@ -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 { void updateState(@Param("reportId")String dataId); List selectByReport(@Param("pageVO")ReportFile reportFile); + + IPage filePage(IPage page,@Param("pageVO") ReportFilePageVO reportFilePageVO); } diff --git a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportLabelDao.java b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportLabelDao.java index 59ffc96..fc73ffe 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportLabelDao.java +++ b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/ReportLabelDao.java @@ -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 { + void actEndDelReport(@Param("reportId")String dataId); + + void updateState(@Param("reportId")String dataId); } diff --git a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/TreeLabelDao.java b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/TreeLabelDao.java index f96fd9d..8701748 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/TreeLabelDao.java +++ b/adc-da-report/src/main/java/com/adc/da/report/dao/mysql/TreeLabelDao.java @@ -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 { */ double getMaxNum(String parentId); - List selectIdByReport(String reportId); + List selectIdByReport(@Param("reportId") String reportId,@Param("state") Integer state); } diff --git a/adc-da-report/src/main/java/com/adc/da/report/eo/ReportLabelEntity.java b/adc-da-report/src/main/java/com/adc/da/report/eo/ReportLabelEntity.java index 1609c06..4642098 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/eo/ReportLabelEntity.java +++ b/adc-da-report/src/main/java/com/adc/da/report/eo/ReportLabelEntity.java @@ -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; } } \ No newline at end of file diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java b/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java index 54a41fb..79c853a 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java +++ b/adc-da-report/src/main/java/com/adc/da/report/service/IReportService.java @@ -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 filePage(ReportFilePageVO ReportFilePageVO); } diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java index 255a4bb..6d74d76 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java +++ b/adc-da-report/src/main/java/com/adc/da/report/service/impl/IReportServiceImpl.java @@ -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 for (List 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 reportFileDao.deleteBatchIds(reportFile.getRfIdList()); } + @Override + public IPage filePage(ReportFilePageVO reportFilePageVO) { + IPage 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 //插入报表标签关系表 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 //设置标签列表 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(ReportLabelEntity::getReportId, reportId); + wrapper.eq(ReportLabelEntity::getState, 2); List reportLabelEntities = reportLabelDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(reportLabelEntities)) { List reportLabelIds = reportLabelEntities.stream().map(ReportLabelEntity::getLabelId).collect(Collectors.toList()); diff --git a/adc-da-report/src/main/java/com/adc/da/report/service/impl/ITtReportManageActServiceImpl.java b/adc-da-report/src/main/java/com/adc/da/report/service/impl/ITtReportManageActServiceImpl.java index 68011c9..92c57a3 100644 --- a/adc-da-report/src/main/java/com/adc/da/report/service/impl/ITtReportManageActServiceImpl.java +++ b/adc-da-report/src/main/java/com/adc/da/report/service/impl/ITtReportManageActServiceImpl.java @@ -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 @@ -162,6 +162,9 @@ public class ITtReportManageActServiceImpl extends ServiceImpl + diff --git a/adc-da-report/src/main/resources/mybatis/mapper/mysql/ReportLabelMapper.xml b/adc-da-report/src/main/resources/mybatis/mapper/mysql/ReportLabelMapper.xml new file mode 100644 index 0000000..98dbfd9 --- /dev/null +++ b/adc-da-report/src/main/resources/mybatis/mapper/mysql/ReportLabelMapper.xml @@ -0,0 +1,17 @@ + + + + + update ts_report_label set state = 2 + where report_id = #{reportId} + + + delete from ts_report_label + + report_id = #{reportId} + and state = 2 + + + + + diff --git a/adc-da-report/src/main/resources/mybatis/mapper/mysql/TreeLabelDao.xml b/adc-da-report/src/main/resources/mybatis/mapper/mysql/TreeLabelDao.xml index f261e1d..f40b1a7 100644 --- a/adc-da-report/src/main/resources/mybatis/mapper/mysql/TreeLabelDao.xml +++ b/adc-da-report/src/main/resources/mybatis/mapper/mysql/TreeLabelDao.xml @@ -21,6 +21,6 @@ diff --git a/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/service/ActivitDefineService.java b/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/service/ActivitDefineService.java index 0b5fe46..3eae4e1 100644 --- a/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/service/ActivitDefineService.java +++ b/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/service/ActivitDefineService.java @@ -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); diff --git a/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/task/TodoTaskController.java b/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/task/TodoTaskController.java index 41bbe1b..1231bb8 100644 --- a/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/task/TodoTaskController.java +++ b/report-activity/src/main/java/com/adc/da/wkflow/business_activiti/task/TodoTaskController.java @@ -626,8 +626,15 @@ public class TodoTaskController { reportFileDao.selectByReport(new ReportFile(ttReportManageAct.getDataId(),2)); ttReportManageAct.setFileList(reportFiles); } - List labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId()); - ttReportManageAct.setLabelList(labelList); + List 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 labelList = treeLableDao.selectIdByReport(ttReportManageAct.getDataId()); - ttReportManageAct.setLabelList(labelList); + List 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);