fix: 企标修改流程新增文件不生成docx
This commit is contained in:
+19
-3
@@ -97,6 +97,11 @@ public class ProcessESChangeEndListener implements ExecutionListener {
|
||||
|
||||
@Resource
|
||||
private IBusProcessModelHisService busProcessModelHisService;
|
||||
|
||||
@Resource
|
||||
private ILawsCommonService lawsCommonService;
|
||||
|
||||
private static final String MODULE_VALUE = TableNameEnum.ENTERPRISE_STANDARDS.getValue();
|
||||
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
@@ -111,12 +116,23 @@ public class ProcessESChangeEndListener implements ExecutionListener {
|
||||
// 根据标准编号找到标准Id
|
||||
LawsEnterpriseStandard es = esService.getOne(new LambdaQueryWrapper<LawsEnterpriseStandard>()
|
||||
.eq(LawsEnterpriseStandard::getStandardNumber, standNo));
|
||||
Map<String, Object> esDataMap = lawsCommonService.getByIdAndModule(es.getId(), MODULE_VALUE, "2", null);
|
||||
// 转换成Map 然后走commonEdit接口
|
||||
Map<String, Object> parameterMap = new HashMap<>();
|
||||
this.buildMap(parameterMap, change);
|
||||
// 替换相应文件的url
|
||||
if (StrUtil.isNotBlank(change.getReplaceFileId()) && StrUtil.isNotBlank(change.getOnEditFile())) {
|
||||
busProcessModelHisService.replaceFile(change.getOnEditFile(), change.getReplaceFileId());
|
||||
String onEditFileId = change.getOnEditFile();
|
||||
String replaceFileId = change.getReplaceFileId();
|
||||
if (StrUtil.isNotBlank(onEditFileId)) {
|
||||
if (StrUtil.isNotBlank(replaceFileId)) {
|
||||
busProcessModelHisService.replaceFile(onEditFileId, replaceFileId);
|
||||
} else {
|
||||
String fileId = busProcessModelHisService.saveProcessFileToOss(onEditFileId);
|
||||
String existFileIds = (String) esDataMap.get(FieldCommon.FILE_PUBLISH_OF_ORIGINAL);
|
||||
if (StrUtil.isNotBlank(existFileIds)) {
|
||||
fileId += "," + existFileIds;
|
||||
}
|
||||
parameterMap.put(FieldCommon.FILE_PUBLISH_OF_ORIGINAL, fileId);
|
||||
}
|
||||
}
|
||||
// 保存修改的文件
|
||||
commonService.commonEdit(parameterMap);
|
||||
|
||||
Reference in New Issue
Block a user