liusheng
10 天以前 274d8e2950e79e73b14783e497cdaf97f7dbb8d3
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -21,6 +21,7 @@
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@@ -163,8 +164,19 @@
        return serviceSubtaskAnswerMapper.deleteServiceSubtaskAnswerById(id);
    }
    /**
     * 保存问卷答案 (异步处理,快速返回)
     *
     * @param serviceSubTaskAnswerReq 答案请求
     * @param flag 标志位
     * @return 结果
     */
    @Override
    @Async("threadPoolTaskExecutor")
    public Integer saveQuestionAnswer(ServiceSubTaskAnswerReq serviceSubTaskAnswerReq, Long flag) {
        String threadName = Thread.currentThread().getName();
        log.info("[{}] 开始异步处理保存问卷答案", threadName);
        try {
        //参数解密
        Long tid = null;
        Long pid = null;
@@ -401,9 +413,13 @@
            }
        }
        log.info("[{}] 完成异步处理保存问卷答案", Thread.currentThread().getName());
        return 1;
    } catch (Exception e) {
        log.error("[{}] 异步处理保存问卷答案发生异常 : {},请求的对象为:{}", Thread.currentThread().getName(), e.getMessage(), e,serviceSubTaskAnswerReq);
        throw new RuntimeException("保存问卷答案失败", e);
    }
}
    @Override
    public Integer saveQuestionDetail(ServiceSubTaskCacheReq serviceSubTaskCacheReq, Long flag) {
        Long tid = Long.valueOf(serviceSubTaskCacheReq.getParam1());
@@ -922,7 +938,6 @@
    }
    private Map<String, String> setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid, Long subid) {
        log.error("-----svyTaskTemplateScriptVO的值为:{}", svyTaskTemplateScriptVO);
        ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity();
        serviceSubtaskVO.setTaskid(taskid);
        serviceSubtaskVO.setPatid(patid);
@@ -971,7 +986,6 @@
    }
    private Map<String, String> setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid, Long subid, List<ServiceSubtask> selectServiceSubtaskList, ServiceTask serviceTask, Map<Long, Long> existingDetailIdMap, Map<Long, Long> existingTraceIdMap) {
        log.error("-----svyTaskTemplateScriptVO的值为:{}", svyTaskTemplateScriptVO);
        String score = "0";
        //下题跳转
        String nextScriptNo = null;
@@ -1057,7 +1071,6 @@
                //去除两端空白并处理特殊字符进行比较
                if (optionContent.trim().replaceAll("\\s+", "").equals(scriptResult.replaceAll("\\s+", ""))) {
                    stt = svyTaskTemplateTargetoption;
                    log.error("找到匹配的选项");
                    break; // 找到匹配项后跳出循环
                }
            }