[修改] 多文件上传 上传流程
This commit is contained in:
@@ -8,5 +8,7 @@ public interface ReportFileDao extends BaseMapper<ReportFile> {
|
|||||||
|
|
||||||
void delByReportId(@Param("pageVO") ReportFile reportFile);
|
void delByReportId(@Param("pageVO") ReportFile reportFile);
|
||||||
|
|
||||||
void actEndDelReport(@Param("pageVO")ReportFile reportFile1);
|
void actEndDelReport(@Param("reportId")String reportId);
|
||||||
|
|
||||||
|
void updateState(@Param("reportId")String dataId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.adc.da.report.eo;
|
package com.adc.da.report.eo;
|
||||||
|
|
||||||
import com.adc.da.login.util.UserUtils;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
@@ -28,8 +27,6 @@ public class ReportFile {
|
|||||||
@TableField("state")
|
@TableField("state")
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
@TableField("user_id")
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -47,7 +44,6 @@ public class ReportFile {
|
|||||||
public ReportFile(String reportId,Integer state){
|
public ReportFile(String reportId,Integer state){
|
||||||
this.reportId = reportId;
|
this.reportId = reportId;
|
||||||
this.state = state;
|
this.state = state;
|
||||||
this.userId = UserUtils.getUserId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReportFile(){
|
public ReportFile(){
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
}
|
}
|
||||||
//插入报表内容表
|
//插入报表内容表
|
||||||
try {
|
try {
|
||||||
|
//TODO FILE
|
||||||
iReportContentService.insertReportContent(reportId, reportEntity.getFileId());
|
iReportContentService.insertReportContent(reportId, reportEntity.getFileId());
|
||||||
log.info("抽取报告内容");
|
log.info("抽取报告内容");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|||||||
+2
-17
@@ -9,7 +9,6 @@ import com.adc.da.report.dao.mysql.ReportFileDao;
|
|||||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||||
import com.adc.da.report.eo.LogEntity;
|
import com.adc.da.report.eo.LogEntity;
|
||||||
import com.adc.da.report.eo.ReportEntity;
|
import com.adc.da.report.eo.ReportEntity;
|
||||||
import com.adc.da.report.eo.ReportFile;
|
|
||||||
import com.adc.da.report.eo.TtReportManageAct;
|
import com.adc.da.report.eo.TtReportManageAct;
|
||||||
import com.adc.da.report.service.ILogService;
|
import com.adc.da.report.service.ILogService;
|
||||||
import com.adc.da.report.service.IReportContentService;
|
import com.adc.da.report.service.IReportContentService;
|
||||||
@@ -32,7 +31,6 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author bu
|
* @author bu
|
||||||
@@ -162,21 +160,8 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 文件
|
// 文件
|
||||||
ReportFile reportFile1 = new ReportFile();
|
reportFileDao.actEndDelReport(ttReportManageAct.getDataId());
|
||||||
reportFile1.setReportId(ttReportManageAct.getDataId());
|
reportFileDao.updateState(ttReportManageAct.getDataId());
|
||||||
reportFile1.setUserId(UserUtils.getUserId());
|
|
||||||
reportFileDao.actEndDelReport(reportFile1);
|
|
||||||
List<ReportFile> reportFiles = new ArrayList<>();
|
|
||||||
for (ReportFile reportFile : ttReportManageAct.getFileList()) {
|
|
||||||
reportFile.setId(UUID.randomUUID().toString().replace("-",""));
|
|
||||||
reportFile.setReportId(ttReportManageAct.getDataId());
|
|
||||||
// reportFile.setFileId(s);
|
|
||||||
reportFile.setState(2);
|
|
||||||
reportFile.setUserId(UserUtils.getUserId());
|
|
||||||
reportFiles.add(reportFile);
|
|
||||||
}
|
|
||||||
iReportFileService.saveBatch(reportFiles);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
iReportContentService.insertReportContent(ttReportManageAct.getDataId(), ttReportManageAct.getFileId());
|
iReportContentService.insertReportContent(ttReportManageAct.getDataId(), ttReportManageAct.getFileId());
|
||||||
log.info("抽取报告内容");
|
log.info("抽取报告内容");
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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.ReportFileDao">
|
<mapper namespace="com.adc.da.report.dao.mysql.ReportFileDao">
|
||||||
|
<update id="updateState">
|
||||||
|
update ts_report_file set state = 2
|
||||||
|
where report_id = #{reportId}
|
||||||
|
</update>
|
||||||
<delete id="actEndDelReport">
|
<delete id="actEndDelReport">
|
||||||
delete from ts_report_file
|
delete from ts_report_file
|
||||||
<where>
|
<where>
|
||||||
report_id = #{pageVO.reportId}
|
report_id = #{reportId}
|
||||||
and ( state = 2 or (state = 1 AND user_id = #{pageVO.userId} ) )
|
and state = 2
|
||||||
</where>
|
</where>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
@@ -16,9 +20,6 @@
|
|||||||
<if test="pageVO.reportId !=null and pageVO.reportId !=''">
|
<if test="pageVO.reportId !=null and pageVO.reportId !=''">
|
||||||
AND report_id = #{pageVO.reportId}
|
AND report_id = #{pageVO.reportId}
|
||||||
</if>
|
</if>
|
||||||
<if test="pageVO.userId !=null and pageVO.userId !=''">
|
|
||||||
AND user_id = #{pageVO.userId}
|
|
||||||
</if>
|
|
||||||
<if test="pageVO.state !=null">
|
<if test="pageVO.state !=null">
|
||||||
AND state = #{pageVO.state}
|
AND state = #{pageVO.state}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
-3
@@ -1,6 +1,5 @@
|
|||||||
package com.adc.da.wkflow.business_activiti.service;
|
package com.adc.da.wkflow.business_activiti.service;
|
||||||
|
|
||||||
import com.adc.da.login.util.UserUtils;
|
|
||||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||||
import com.adc.da.report.dao.mysql.ReportFileDao;
|
import com.adc.da.report.dao.mysql.ReportFileDao;
|
||||||
import com.adc.da.report.dao.mysql.ReportLabelDao;
|
import com.adc.da.report.dao.mysql.ReportLabelDao;
|
||||||
@@ -134,7 +133,6 @@ public class ActivitDefineService {
|
|||||||
reportFile.setReportId(ttReportManageAct.getDataId());
|
reportFile.setReportId(ttReportManageAct.getDataId());
|
||||||
// reportFile.setFileId(s);
|
// reportFile.setFileId(s);
|
||||||
reportFile.setState(1);
|
reportFile.setState(1);
|
||||||
reportFile.setUserId(UserUtils.getUserId());
|
|
||||||
reportFiles.add(reportFile);
|
reportFiles.add(reportFile);
|
||||||
}
|
}
|
||||||
iReportFileService.saveBatch(reportFiles);
|
iReportFileService.saveBatch(reportFiles);
|
||||||
@@ -169,7 +167,6 @@ public class ActivitDefineService {
|
|||||||
reportFile.setReportId(ttReportManageAct.getDataId());
|
reportFile.setReportId(ttReportManageAct.getDataId());
|
||||||
// reportFile.setFileId(s);
|
// reportFile.setFileId(s);
|
||||||
reportFile.setState(1);
|
reportFile.setState(1);
|
||||||
reportFile.setUserId(UserUtils.getUserId());
|
|
||||||
reportFiles.add(reportFile);
|
reportFiles.add(reportFile);
|
||||||
}
|
}
|
||||||
iReportFileService.saveBatch(reportFiles);
|
iReportFileService.saveBatch(reportFiles);
|
||||||
|
|||||||
Reference in New Issue
Block a user