|
@@ -109,13 +109,18 @@ public class StudyFileServiceImpl implements StudyFileService {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public R cancelProcess(String id) {
|
|
|
- // 获取最新的学习文件信息
|
|
|
+ // 获取当前的学习文件信息
|
|
|
StudyFileDo currentFile = studyFileDao.selectById(id);
|
|
|
// 获取最新历史文件
|
|
|
StudyFileRecordDo historyFile = studyFileRecordService.selectLatestRecordByMainId(id);
|
|
|
+ // 如果没有历史文件则为新增流程,需要清空当前流程信息,将其变成“暂存状态”
|
|
|
if (historyFile == null) {
|
|
|
logger.info("文件:{},没有找到对应的历史文件", id);
|
|
|
+ currentFile.setProcessInstId("");
|
|
|
+ currentFile.setProcessInstStatus("");
|
|
|
+ studyFileDao.updateById(currentFile);
|
|
|
return R.ok("没有找到对应的历史文件");
|
|
|
}
|
|
|
// 恢复文件历史数据
|