[修改] 流程重复发起问题

This commit is contained in:
bupengxiang
2023-05-11 17:42:21 +08:00
parent 8d5456d53c
commit 0062d75e59
33 changed files with 65 additions and 16 deletions
@@ -19,5 +19,5 @@ public interface ITtReportManageActService {
void deleteById(DeleteParamRequestVO deleteParamVO);
void saveReport(TtReportManageAct ttReportManageAct);
void saveOrUpdataReport(TtReportManageAct ttReportManageAct);
}
@@ -1,9 +1,11 @@
package com.adc.da.report.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.adc.da.report.dao.mysql.PowerApplyDao;
import com.adc.da.report.dao.mysql.ReportDao;
import com.adc.da.report.dao.mysql.TtReportManageActDao;
import com.adc.da.report.eo.ReportEntity;
import com.adc.da.report.eo.TtReportManageAct;
import com.adc.da.report.service.IReportContentService;
import com.adc.da.report.service.ITtReportManageActService;
@@ -125,7 +127,7 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
}
@Override
public void saveReport(TtReportManageAct ttReportManageAct) {
public void saveOrUpdataReport(TtReportManageAct ttReportManageAct) {
//插入报表内容表
try {
iReportContentService.insertReportContent(ttReportManageAct.getDataId(), ttReportManageAct.getFileId());
@@ -133,7 +135,18 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
} catch (IOException e) {
log.error("获取报告内容失败", e);
}
//保存报告
reportDao.saveReportAct(ttReportManageAct);
ReportEntity reportEntity = reportDao.selectById(ttReportManageAct.getDataId());
if (reportEntity == null){
//保存报告
reportDao.saveReportAct(ttReportManageAct);
}else {
//更改
ReportEntity reportEntity1 = new ReportEntity();
BeanUtil.copyProperties(ttReportManageAct,reportEntity1);
reportEntity1.setId(ttReportManageAct.getDataId());
reportDao.updateById(reportEntity);
}
}
}
@@ -128,4 +128,10 @@ public class ReportVo {
*/
private String uploader;
/**
* 0 在流程中
* 1 不在流程中
*/
private Integer isAct;
}
@@ -112,7 +112,10 @@
thumbUpCount.thumbUp AS thumbUp,
clicksCount.clicks AS clicks,
downloadCount.download AS download,
AVG( trur.user_rating ) AS reportRating
AVG( trur.user_rating ) AS reportRating,
IF(bpn.id is null,1,
IF(bpn.end_time is null,0,1)
) as isAct
FROM
TT_REPORT_MANAGE eo
LEFT JOIN ts_report_content rc ON eo.id = rc.report_id
@@ -122,6 +125,7 @@
LEFT JOIN (SELECT report_id, COUNT(id) AS clicks FROM report_log_book WHERE type = 1 GROUP BY report_id) AS clicksCount ON eo.id = clicksCount.report_id
LEFT JOIN (SELECT report_id, COUNT(id) AS download FROM report_log_book WHERE type = 2 GROUP BY report_id) AS downloadCount ON eo.id = downloadCount.report_id
LEFT JOIN ts_report_user_rating AS trur ON eo.id = trur.report_id
LEFT JOIN bus_process_name as bpn on bpn.data_id = eo.id and bpn.prc_type != '5'
WHERE
eo.DEL_FLAG = 0
<!--全文模糊搜索-->
@@ -180,8 +184,12 @@
t.department,
t.maincontent,
t.confidentialLevel,
t.privacyLevel
t.privacyLevel,
IF(bpn.id is null,1,
IF(bpn.end_time is null,0,1)
) as isAct
FROM `tt_report_manage` AS t
LEFT JOIN bus_process_name as bpn on bpn.data_id = t.id and bpn.prc_type = '5'
WHERE t.del_flag = 0
<!--报表名称搜索-->
<if test="Vo.name != null and Vo.name != ''">