对接问题修改。

This commit is contained in:
wangzhijiang
2024-03-23 13:24:22 +08:00
parent 7aed34d06e
commit aabbd59ac2
@@ -461,58 +461,18 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
BusProcessModelHis bpmHis = this.baseMapper.selectById(fileId); BusProcessModelHis bpmHis = this.baseMapper.selectById(fileId);
if (ObjectUtils.isNotEmpty(bpmHis)) { if (ObjectUtils.isNotEmpty(bpmHis)) {
throw new JeroBootException("fileId已经存在,不能重复,请检查!");
}
BusProcessModelHis modelHis = new BusProcessModelHis();
modelHis.setId(fileId);
try {
String preUuid2 = UUID.randomUUID().toString();
String changUuid = preUuid2.substring(0, 8);
String taskId = "task_" + changUuid;
String topId = "top_" + changUuid;
String builderModel = "model" + "/";
File dir = new File(filePath + builderModel);
if (!dir.exists()) {
dir.mkdirs();
}
String fileName = model + ".docx";
modelHis.setFileName(fileName);
StringBuilder builder = new StringBuilder();
builder.append("model").append("/");
builder.append(taskId).append("/");
File file = new File(filePath + builder.toString());
if (!file.exists()) {
file.mkdirs();
}
String targetPath = builder.toString() + taskId + "_" + topId + "_node.docx";
File sourceFile = new File(sourceFilePath);
File targetFile = new File(filePath + targetPath);
FileUtils.copyFile(sourceFile, targetFile);
modelHis.setTaskId(taskId);
modelHis.setPId(topId);
modelHis.setEditFilePath(targetPath);
modelHis.setDownLoadUrl(downloadUrl + targetPath);
this.baseMapper.insert(modelHis);
resultSb.append(onlyOfficeEditorUrl); resultSb.append(onlyOfficeEditorUrl);
resultSb.append("fileId=").append(fileId).append("&"); resultSb.append("fileId=").append(fileId).append("&");
resultSb.append("pid=").append(modelHis.getPId()).append("&"); resultSb.append("pid=").append(bpmHis.getPId()).append("&");
resultSb.append("taskIds=").append(modelHis.getTaskId()).append("&"); resultSb.append("taskIds=").append(bpmHis.getTaskId()).append("&");
// resultSb.append("editType=").append("null").append("&"); // resultSb.append("editType=").append("null").append("&");
resultSb.append("oldFileName=").append(modelHis.getFileName()).append("&"); resultSb.append("oldFileName=").append(bpmHis.getFileName()).append("&");
// resultSb.append("fileType=").append("docx").append("&"); // resultSb.append("fileType=").append("docx").append("&");
resultSb.append("attId=").append(fileId).append("&"); resultSb.append("attId=").append(fileId).append("&");
resultSb.append("fileUrl=").append(modelHis.getDownLoadUrl()).append("&"); resultSb.append("fileUrl=").append(bpmHis.getDownLoadUrl()).append("&");
// resultSb.append("key=").append("key").append("&"); // resultSb.append("key=").append("key").append("&");
resultSb.append("filePath=").append(modelHis.getEditFilePath()).append("&"); resultSb.append("filePath=").append(bpmHis.getEditFilePath()).append("&");
resultSb.append("fileName=").append(modelHis.getFileName()).append("&"); resultSb.append("fileName=").append(bpmHis.getFileName()).append("&");
// resultSb.append("userId=").append("null").append("&"); // resultSb.append("userId=").append("null").append("&");
resultSb.append("userName=").append(userName).append("&"); resultSb.append("userName=").append(userName).append("&");
// resultSb.append("isEdit=").append("123").append("&"); // resultSb.append("isEdit=").append("123").append("&");
@@ -523,10 +483,75 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
// resultSb.append("assessor=").append("").append("&"); // resultSb.append("assessor=").append("").append("&");
// resultSb.append("focalUnit=").append("").append("&"); // resultSb.append("focalUnit=").append("").append("&");
resultSb.append("replaceStand=").append(replaceStand); resultSb.append("replaceStand=").append(replaceStand);
} catch (Exception e) {
logger.error(e.getMessage()); // throw new JeroBootException("fileId已经存在,不能重复,请检查!");
throw new JeroBootException("操作失败,请联系管理员!"); } else {
BusProcessModelHis modelHis = new BusProcessModelHis();
modelHis.setId(fileId);
try {
String preUuid2 = UUID.randomUUID().toString();
String changUuid = preUuid2.substring(0, 8);
String taskId = "task_" + changUuid;
String topId = "top_" + changUuid;
String builderModel = "model" + "/";
File dir = new File(filePath + builderModel);
if (!dir.exists()) {
dir.mkdirs();
}
String fileName = model + ".docx";
modelHis.setFileName(fileName);
StringBuilder builder = new StringBuilder();
builder.append("model").append("/");
builder.append(taskId).append("/");
File file = new File(filePath + builder.toString());
if (!file.exists()) {
file.mkdirs();
}
String targetPath = builder.toString() + taskId + "_" + topId + "_node.docx";
File sourceFile = new File(sourceFilePath);
File targetFile = new File(filePath + targetPath);
FileUtils.copyFile(sourceFile, targetFile);
modelHis.setTaskId(taskId);
modelHis.setPId(topId);
modelHis.setEditFilePath(targetPath);
modelHis.setDownLoadUrl(downloadUrl + targetPath);
this.baseMapper.insert(modelHis);
resultSb.append(onlyOfficeEditorUrl);
resultSb.append("fileId=").append(fileId).append("&");
resultSb.append("pid=").append(modelHis.getPId()).append("&");
resultSb.append("taskIds=").append(modelHis.getTaskId()).append("&");
// resultSb.append("editType=").append("null").append("&");
resultSb.append("oldFileName=").append(modelHis.getFileName()).append("&");
// resultSb.append("fileType=").append("docx").append("&");
resultSb.append("attId=").append(fileId).append("&");
resultSb.append("fileUrl=").append(modelHis.getDownLoadUrl()).append("&");
// resultSb.append("key=").append("key").append("&");
resultSb.append("filePath=").append(modelHis.getEditFilePath()).append("&");
resultSb.append("fileName=").append(modelHis.getFileName()).append("&");
// resultSb.append("userId=").append("null").append("&");
resultSb.append("userName=").append(userName).append("&");
// resultSb.append("isEdit=").append("123").append("&");
resultSb.append("standCode=").append(serialNumber).append("&");
resultSb.append("standName=").append(standName).append("&");
resultSb.append("draftingDepartment=").append(estDepart).append("&");
resultSb.append("draftsman=").append(drafts).append("&");
// resultSb.append("assessor=").append("").append("&");
// resultSb.append("focalUnit=").append("").append("&");
resultSb.append("replaceStand=").append(replaceStand);
} catch (Exception e) {
logger.error(e.getMessage());
throw new JeroBootException("操作失败,请联系管理员!");
}
} }
return resultSb.toString(); return resultSb.toString();
} }