|
@@ -383,7 +383,7 @@ public class WpsController extends BaseSystemController {
|
|
JSONObject obj = sections.getJSONObject(i);
|
|
JSONObject obj = sections.getJSONObject(i);
|
|
JSONArray array = obj.getJSONArray("blocks");
|
|
JSONArray array = obj.getJSONArray("blocks");
|
|
if (array.size() > 0) {
|
|
if (array.size() > 0) {
|
|
- JSONArray delArray = new JSONArray();
|
|
|
|
|
|
+// JSONArray delArray = new JSONArray();
|
|
List<WpsAttachmentVo> wpsOperationFile = new ArrayList<>();
|
|
List<WpsAttachmentVo> wpsOperationFile = new ArrayList<>();
|
|
for (int j = 0; j < array.size(); j++) {
|
|
for (int j = 0; j < array.size(); j++) {
|
|
JSONObject arrayJSONObject = array.getJSONObject(j);
|
|
JSONObject arrayJSONObject = array.getJSONObject(j);
|
|
@@ -391,24 +391,35 @@ public class WpsController extends BaseSystemController {
|
|
String value = arrayJSONObject.getString("value");
|
|
String value = arrayJSONObject.getString("value");
|
|
if (Objects.nonNull(type) && Objects.equals(type.trim(), "file")) {
|
|
if (Objects.nonNull(type) && Objects.equals(type.trim(), "file")) {
|
|
wpsParamVo = JSONObject.parseObject(value, WpsParamVo.class);
|
|
wpsParamVo = JSONObject.parseObject(value, WpsParamVo.class);
|
|
- List<WpsAttachmentVo> attachmentVoList = wpsParamVo.getWpsOperationFile();
|
|
|
|
|
|
+ List<WpsAttachmentVo> attachmentVoList = wpsParamVo.getWpsSourceFile();
|
|
for (WpsAttachmentVo w : attachmentVoList) {
|
|
for (WpsAttachmentVo w : attachmentVoList) {
|
|
File sourceFile = new File(new File(workRoot), path + File.separator + w.getValue());
|
|
File sourceFile = new File(new File(workRoot), path + File.separator + w.getValue());
|
|
File destFile = new File(dirName, w.getValue());
|
|
File destFile = new File(dirName, w.getValue());
|
|
IOUtils.copy(new FileInputStream(sourceFile), new FileOutputStream(destFile));
|
|
IOUtils.copy(new FileInputStream(sourceFile), new FileOutputStream(destFile));
|
|
wpsOperationFile.add(w);
|
|
wpsOperationFile.add(w);
|
|
}
|
|
}
|
|
- delArray.add(arrayJSONObject);
|
|
|
|
|
|
+// delArray.add(arrayJSONObject);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- array.removeAll(delArray);
|
|
|
|
|
|
+// array.removeAll(delArray);
|
|
if (Objects.nonNull(wpsParamVo)) {
|
|
if (Objects.nonNull(wpsParamVo)) {
|
|
- wpsParamVo.getWpsOperationFile().clear();
|
|
|
|
- wpsParamVo.setWpsOperationFile(wpsOperationFile);
|
|
|
|
|
|
+ wpsParamVo.getWpsSourceFile().clear();
|
|
|
|
+ wpsParamVo.setWpsSourceFile(wpsOperationFile);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
wpsQuestionVo.setBody(object);
|
|
wpsQuestionVo.setBody(object);
|
|
|
|
+
|
|
|
|
+ JSONArray answers = json.getJSONArray("answers");
|
|
|
|
+ if (Objects.nonNull(answers) && answers.size() > 0) {
|
|
|
|
+ List<WpsAttachmentVo> attachmentVoList = new ArrayList<>(answers.size());
|
|
|
|
+ for (int j = 0; j < answers.size(); j++) {
|
|
|
|
+ JSONObject arrayJSONObject = answers.getJSONObject(j);
|
|
|
|
+ String fileName = arrayJSONObject.getString("fileName");
|
|
|
|
+ attachmentVoList.add(new WpsAttachmentVo(fileName));
|
|
|
|
+ }
|
|
|
|
+ wpsParamVo.setWpsOutputFile(attachmentVoList);
|
|
|
|
+ }
|
|
wpsQuestionVo.setParam(wpsParamVo);
|
|
wpsQuestionVo.setParam(wpsParamVo);
|
|
wpsDetailVo.setQuestions(wpsQuestionVoList);
|
|
wpsDetailVo.setQuestions(wpsQuestionVoList);
|
|
JSONObject newJson = JSONObject.parseObject(JacksonUtil.parseJson(wpsDetailVo));
|
|
JSONObject newJson = JSONObject.parseObject(JacksonUtil.parseJson(wpsDetailVo));
|