Search in sources :

Example 1 with AnswerQuery

use of cn.surveyking.server.domain.dto.AnswerQuery in project SurveyKing by javahuang.

the class AbstractTaskHandler method updateTaskAnswer.

protected void updateTaskAnswer(ApprovalTaskRequest request) {
    if (request.getAnswer() == null) {
        return;
    }
    FlowEntryNode flowElement = entryNodeService.getById(request.getActivityId());
    AnswerQuery answerQuery = new AnswerQuery();
    answerQuery.setId(request.getAnswerId());
    AnswerView answerView = answerService.getAnswer(answerQuery);
    LinkedHashMap mergedAnswer = mergeAnswer(request.getAnswer(), answerView.getAnswer(), flowElement.getFieldPermission());
    AnswerRequest answerRequest = new AnswerRequest();
    answerRequest.setId(request.getAnswerId());
    answerRequest.setAnswer(mergedAnswer);
    answerService.updateAnswer(answerRequest);
}
Also used : AnswerView(cn.surveyking.server.domain.dto.AnswerView) AnswerRequest(cn.surveyking.server.domain.dto.AnswerRequest) FlowEntryNode(cn.surveyking.server.flow.domain.model.FlowEntryNode) AnswerQuery(cn.surveyking.server.domain.dto.AnswerQuery) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

AnswerQuery (cn.surveyking.server.domain.dto.AnswerQuery)1 AnswerRequest (cn.surveyking.server.domain.dto.AnswerRequest)1 AnswerView (cn.surveyking.server.domain.dto.AnswerView)1 FlowEntryNode (cn.surveyking.server.flow.domain.model.FlowEntryNode)1 LinkedHashMap (java.util.LinkedHashMap)1