feat:上传报告内容抽取&全文模糊查询
This commit is contained in:
+1
@@ -73,6 +73,7 @@ public class IReportContentServiceImpl extends ServiceImpl<ReportContentDao, Rep
|
||||
ReportContentEntity reportContentEntity = new ReportContentEntity(UUID.randomUUID10(), reportId, content);
|
||||
save(reportContentEntity);
|
||||
//将文件删除
|
||||
outputStream.close();
|
||||
FileUtil.deleteFile(path);
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -5,6 +5,7 @@ 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.TtReportManageAct;
|
||||
import com.adc.da.report.service.IReportContentService;
|
||||
import com.adc.da.report.service.ITtReportManageActService;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.TtReportManageActPageVO;
|
||||
@@ -17,6 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -36,6 +39,9 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
||||
@Autowired
|
||||
PowerApplyDao powerApplyDao;
|
||||
|
||||
@Resource
|
||||
private IReportContentService iReportContentService;
|
||||
|
||||
/**
|
||||
* @param ttReportManageActPageVO
|
||||
* @return <com.adc.da.report.entity.TtReportManageAct>
|
||||
@@ -120,6 +126,13 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
||||
|
||||
@Override
|
||||
public void saveReport(TtReportManageAct ttReportManageAct) {
|
||||
//插入报表内容表
|
||||
try {
|
||||
iReportContentService.insertReportContent(ttReportManageAct.getId(), ttReportManageAct.getFileId());
|
||||
log.info("抽取报告内容");
|
||||
} catch (IOException e) {
|
||||
log.error("获取报告内容失败", e);
|
||||
}
|
||||
//保存报告
|
||||
reportDao.saveReportAct(ttReportManageAct);
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
AVG( trur.user_rating ) AS reportRating
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
LEFT JOIN ts_report_content rc ON eo.id = rc.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 (SELECT report_id, COUNT(id) AS thumbUp FROM report_log_book WHERE type = 3 GROUP BY report_id) AS thumbUpCount ON eo.id = thumbUpCount.report_id
|
||||
@@ -123,13 +124,14 @@
|
||||
LEFT JOIN ts_report_user_rating AS trur ON eo.id = trur.report_id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
|
||||
<!--全文模糊搜索-->
|
||||
<if test="pageVO.keyContent !='' and pageVO.keyContent != null">
|
||||
and rc.report_content like CONCAT(CONCAT('%',#{pageVO.keyContent}),'%')
|
||||
</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
|
||||
|
||||
@@ -57,8 +57,7 @@ public class oneApplyAfter implements TaskListener {
|
||||
// 1: 同意 2:退回
|
||||
delegateTask.setVariable("flag",s);
|
||||
if ("1".equals(s)){
|
||||
// ttReportManageActService.saveReport(ttReportManageAct);
|
||||
reportDao.saveReportAct(ttReportManageAct);
|
||||
ttReportManageActService.saveReport(ttReportManageAct);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user