[修改] 解决一些流程bug
This commit is contained in:
+14
-1
@@ -92,6 +92,7 @@ public class ReportManageConroller {
|
||||
|
||||
/**
|
||||
* 新增或编辑报告
|
||||
* 弃用
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@@ -116,6 +117,19 @@ public class ReportManageConroller {
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增或编辑报告
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("新增或编辑报告")
|
||||
@PostMapping("/saveOrUpdate")
|
||||
// @ReportLog(description = "新增或编辑")
|
||||
public ResponseMessage saveOrUpdate(@RequestBody ReportEntity reportEntity) throws IOException {
|
||||
|
||||
reportService.addOrUpdate(reportEntity);
|
||||
return Result.success();
|
||||
}
|
||||
/**
|
||||
* 判断报告名称是否被占用
|
||||
* @param vo
|
||||
@@ -123,7 +137,6 @@ public class ReportManageConroller {
|
||||
*/
|
||||
@ApiOperation("判断报告名称是否被占用")
|
||||
@PostMapping("/isReportNameOccupy")
|
||||
@ReportLog(description = "新增或编辑")
|
||||
public ResponseMessage isReportNameOccupy(@RequestBody ReportVo vo) throws IOException {
|
||||
|
||||
long count = reportDao.isReportNameOccupyByEO(vo);
|
||||
|
||||
@@ -64,7 +64,7 @@ public interface ReportDao extends BaseMapper<ReportEntity> {
|
||||
|
||||
long isReportNameOccupyByEO(@Param("Vo")ReportVo Vo);
|
||||
|
||||
long isReportNameOccupyByAct(ReportVo vo);
|
||||
long isReportNameOccupyByAct(@Param("Vo") ReportVo vo);
|
||||
|
||||
void saveReportAct(@Param("Vo") TtReportManageAct ttReportManageAct);
|
||||
|
||||
|
||||
@@ -106,4 +106,7 @@ public class ReportEntity {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> reportUserIdList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<List<String>> labelList;
|
||||
}
|
||||
|
||||
@@ -77,4 +77,6 @@ public interface IReportService {
|
||||
* @return 是否有下载权限
|
||||
*/
|
||||
Boolean isAllowDownload(String userId, String repostId);
|
||||
|
||||
void addOrUpdate(ReportEntity reportEntity);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.adc.da.util.utils.CollectionUtils;
|
||||
import com.adc.da.util.utils.FileUtil;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.adc.da.util.utils.UUID;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -118,6 +119,46 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
private UserEODao userEODao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void addOrUpdate(ReportEntity reportEntity) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if (StringUtils.isNotEmpty(reportEntity.getId())){
|
||||
reportDao.updateById(reportEntity);
|
||||
reportEntity.setUpdateDate(format.format(new Date()));
|
||||
}else {
|
||||
reportEntity.setId(UUID.randomUUID10());
|
||||
reportEntity.setCreateDate(format.format(new Date()));
|
||||
reportEntity.setCreateUserId(UserUtils.getUserId());
|
||||
reportEntity.setDelFlag("0");
|
||||
reportEntity.setUpdateDate(format.format(new Date()));
|
||||
reportDao.insert(reportEntity);
|
||||
}
|
||||
String reportId = reportEntity.getId();
|
||||
//插入报表标签关系表
|
||||
//修改报表标签关系表(先删后增)
|
||||
iReportLabelService.deleteReportLabelByReportId(new String[]{reportId});
|
||||
if (CollectionUtils.isNotEmpty(reportEntity.getLabelList())){
|
||||
List<ReportLabelEntity> labelList = new ArrayList<>();
|
||||
|
||||
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);
|
||||
labelList.add(reportLabelEntity);
|
||||
}
|
||||
iReportLabelService.saveBatch(labelList);
|
||||
//插入报表内容表
|
||||
try {
|
||||
iReportContentService.insertReportContent(reportId, reportEntity.getFileId());
|
||||
log.info("抽取报告内容");
|
||||
} catch (IOException e) {
|
||||
log.error("获取报告内容失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或编辑报告
|
||||
*
|
||||
@@ -172,12 +213,6 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
});
|
||||
}
|
||||
|
||||
//插入报表标签关系表
|
||||
labelList.forEach((label) -> {
|
||||
ReportLabelEntity reportLabelEntity = new ReportLabelEntity(UUID.randomUUID10(), entity.getId(), label);
|
||||
reportLabelDao.insert(reportLabelEntity);
|
||||
});
|
||||
|
||||
//插入报表内容表
|
||||
iReportContentService.insertReportContent(entity.getId(), entity.getFileId());
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public class ReportDetailVo {
|
||||
*/
|
||||
private String departmentId;
|
||||
|
||||
private String department;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@@ -68,6 +69,8 @@ public class ReportDetailVo {
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
|
||||
@@ -228,12 +228,11 @@
|
||||
ORDER BY updateDate desc
|
||||
</select>
|
||||
<select id="isAct" resultType="java.lang.String">
|
||||
SELECT rep.name FROM power_apply_act tt
|
||||
LEFT JOIN bus_process_name pro on tt.prc_id = pro.PRC_ID
|
||||
LEFT JOIN tt_report_manage rep on tt.report_id = rep.id
|
||||
WHERE tt.user_id = #{Vo.usid} and tt.del_flag != 1 and
|
||||
pro.SUBMIT_STATUS = 1
|
||||
and tt.report_id in
|
||||
SELECT rep.name FROM
|
||||
bus_process_name pro
|
||||
WHERE pro.CREAT_USER = #{Vo.usid}
|
||||
and pro.SUBMIT_STATUS = 1
|
||||
and pro.DATA_ID in
|
||||
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -268,7 +267,7 @@
|
||||
and rep.Name = #{Vo.name}
|
||||
and rep.del_flag = 0
|
||||
<if test="Vo.id != null and Vo.id != ''">
|
||||
and rep.report_id != #{Vo.id}
|
||||
and rep.data_id != #{Vo.id}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
@@ -282,13 +281,17 @@
|
||||
u.USNAME AS uploaderName,
|
||||
rm.keycontent AS keycontent,
|
||||
rm.maincontent AS maincontent,
|
||||
rm.department AS departmentName,
|
||||
rm.department AS department,
|
||||
org.org_name as departmentName,
|
||||
rm.`year` AS `year`,
|
||||
rm.fileId AS fileId,
|
||||
f.file_name as fileName,
|
||||
rm.confidentialLevel AS confidentialLevel,
|
||||
rm.privacyLevel AS privacyLevel
|
||||
FROM `tt_report_manage` AS rm
|
||||
LEFT JOIN ts_user AS u ON u.USID = rm.createUserId
|
||||
LEFT JOIN ts_org as org on org.id = rm.department
|
||||
LEFT JOIN ts_file as f on rm.fileId=f.file_id
|
||||
WHERE rm.id = #{reportId}
|
||||
AND rm.del_flag = 0
|
||||
</select>
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
<select id="list" parameterType="string" resultType="map">
|
||||
select * from(select t1.USID,t1.ACCOUNT,t1.USNAME,t1.CELLPHONE_NUMBER,t1.EMAIL,t3.NAME ROLENAME,t3.id ROLEID,
|
||||
date_format(t1.UPDATE_TIME,'%Y-%m-%d %H:%i:%S')CREATEDATE
|
||||
,org.ID as ORGID,org.org_name as ORGNAME
|
||||
date_format(t1.UPDATE_TIME,'%Y-%m-%d %H:%i:%S')CREATEDATE,
|
||||
GROUP_CONCAT( DISTINCT org.ID ) as ORGID,
|
||||
GROUP_CONCAT( DISTINCT org.org_name )as ORGNAME
|
||||
from TS_USER t1
|
||||
left join TR_USER_ROLE t2 on t1.USID=t2.USER_ID
|
||||
left JOIN TS_ROLE t3 on t2.ROLE_ID=t3.ID
|
||||
@@ -65,7 +66,7 @@
|
||||
<result column="remarks" property="remarks"/>
|
||||
</collection>
|
||||
<collection property="orgEOList" ofType="com.adc.da.sys.entity.OrgEO">
|
||||
<id column="id" property="orgCode"/>
|
||||
<id column="orgId" property="orgCode"/>
|
||||
<result column="org_name" property="orgName"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
+4
-3
@@ -637,8 +637,8 @@ public class TodoTaskController {
|
||||
public Wrapper<String> saveTaskFirst(@RequestBody ApproveDataVO approveDataVO) {
|
||||
String dataJson = approveDataVO.getDataJson();
|
||||
String submitJson = approveDataVO.getSubmitJson();
|
||||
// String reportId = approveDataVO.getReportId();
|
||||
String reportId = UUID.randomUUID().toString().replace("-","");
|
||||
String reportId = approveDataVO.getReportId();
|
||||
// String reportId = UUID.randomUUID().toString().replace("-","");
|
||||
String saveId = null;
|
||||
String dataId = null;
|
||||
if (approveDataVO.getId() != null && !approveDataVO.getId().equals("")) {
|
||||
@@ -719,7 +719,8 @@ public class TodoTaskController {
|
||||
for (ApproveDataVO approveDataVO : approveDataVOList) {
|
||||
String dataJson = approveDataVO.getDataJson();
|
||||
String submitJson = approveDataVO.getSubmitJson();
|
||||
String reportId = UUID.randomUUID().toString().replace("-","");
|
||||
String reportId = approveDataVO.getReportId();
|
||||
// String reportId = UUID.randomUUID().toString().replace("-","");
|
||||
String saveId = null;
|
||||
String dataId = null;
|
||||
if (approveDataVO.getId() != null && !approveDataVO.getId().equals("")) {
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user