|
|
@@ -1,6 +1,7 @@
|
|
|
package com.java110.user.bmo.questionAnswerTitle.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.java110.core.annotation.Java110Transactional;
|
|
|
import com.java110.core.factory.GenerateCodeFactory;
|
|
|
import com.java110.dto.questionAnswerTitle.QuestionAnswerTitleDto;
|
|
|
@@ -47,20 +48,24 @@ public class SaveQuestionAnswerTitleBMOImpl implements ISaveQuestionAnswerTitleB
|
|
|
return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
|
|
|
}
|
|
|
QuestionAnswerTitleValuePo questionAnswerTitleValuePo = null;
|
|
|
+ JSONObject value = null;
|
|
|
for (int titleValueIndex = 0; titleValueIndex < titleValues.size(); titleValueIndex++) {
|
|
|
questionAnswerTitleValuePo = new QuestionAnswerTitleValuePo();
|
|
|
+ value = titleValues.getJSONObject(titleValueIndex);
|
|
|
questionAnswerTitleValuePo.setQaValue(titleValues.getJSONObject(titleValueIndex).getString("qaValue"));
|
|
|
questionAnswerTitleValuePo.setSeq(titleValues.getJSONObject(titleValueIndex).getString("seq"));
|
|
|
questionAnswerTitleValuePo.setTitleId(questionAnswerTitlePo.getTitleId());
|
|
|
- questionAnswerTitleValuePo.setValueId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_valueId));
|
|
|
questionAnswerTitleValuePo.setObjId(questionAnswerTitlePo.getObjId());
|
|
|
questionAnswerTitleValuePo.setObjType(questionAnswerTitlePo.getObjType());
|
|
|
- questionAnswerTitleValueInnerServiceSMOImpl.saveQuestionAnswerTitleValue(questionAnswerTitleValuePo);
|
|
|
+ if(value.containsKey("valueId") && !value.getString("valueId").startsWith("-")){
|
|
|
+ questionAnswerTitleValuePo.setValueId(value.getString("valueId"));
|
|
|
+ questionAnswerTitleValueInnerServiceSMOImpl.updateQuestionAnswerTitleValue(questionAnswerTitleValuePo);
|
|
|
+ }else{
|
|
|
+ questionAnswerTitleValuePo.setValueId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_valueId));
|
|
|
+ questionAnswerTitleValueInnerServiceSMOImpl.saveQuestionAnswerTitleValue(questionAnswerTitleValuePo);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|