陈昶聿
4 天以前 4383c73ce1c6f7886fbc19e0e8dfa71da8ff9283
【市一】随访满意度明细调整
已修改3个文件
58 ■■■■■ 文件已修改
smartor/src/main/java/com/smartor/domain/ServiceSubtaskScriptCount.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskScriptCount.java
@@ -25,6 +25,12 @@
    private Long scriptid;
    /**
     * 模板ID
     */
    @ApiModelProperty(name = "模板ID")
    private Long templateid;
    /**
     * 问题内容
     */
    @ApiModelProperty("问题内容")
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -3049,27 +3049,29 @@
            allItemCounts = serviceSubtaskMapper.getSfStatisticsScriptItemDetails(serviceSubtaskCountReq);
        }
        for(ServiceSubtaskScriptCount count : allCounts){
            Map<String, ServiceSubtaskScriptCount> itemCountMap = new HashMap<>();
            if(ObjectUtils.isNotEmpty(count.getOptions())){
                String[] optionsArray = count.getOptions().split(",");
                List<String> optionsList = Arrays.stream(optionsArray).map(String::valueOf).collect(Collectors.toList());
                if(ObjectUtils.isNotEmpty(optionsList)){
                    //填入空白信息
                    optionsList.forEach(option ->{
                        ServiceSubtaskScriptCount emptyCount = new ServiceSubtaskScriptCount();
                        emptyCount.setScriptContent(count.getScriptContent());
                        emptyCount.setScriptType(count.getScriptType());
                        emptyCount.setCompletedQuantity(count.getCompletedQuantity());
                        emptyCount.setAllQuantity(count.getAllQuantity());
                        emptyCount.setChosenQuantity(0);
                        emptyCount.setChosenPercentage("0.0");
                        itemCountMap.put(option,emptyCount);
                    });
            if(ObjectUtils.isNotEmpty(count.getTemplateid())){
                SvyTaskTemplateVO svyTaskTemplateVO = new SvyTaskTemplateVO();
                svyTaskTemplateVO.setId(count.getTemplateid());
                SvyTaskTemplateVO svyTaskTemplateResultVo = svyTaskTemplateService.selectInfoByCondition(svyTaskTemplateVO);
                if(ObjectUtils.isNotEmpty(svyTaskTemplateResultVo)){
                    List<SvyTaskTemplateScriptVO> templateScriptVOS = svyTaskTemplateResultVo.getSvyTaskTemplateScriptVOS();
                    if(ObjectUtils.isNotEmpty(templateScriptVOS)){
                        //填入空白信息
                        templateScriptVOS.forEach(templateScriptVO ->{
                            ServiceSubtaskScriptCount emptyCount = new ServiceSubtaskScriptCount();
                            emptyCount.setScriptContent(count.getScriptContent());
                            emptyCount.setScriptType(count.getScriptType());
                            emptyCount.setCompletedQuantity(count.getCompletedQuantity());
                            emptyCount.setAllQuantity(count.getAllQuantity());
                            emptyCount.setChosenQuantity(0);
                            emptyCount.setChosenPercentage("0.0");
                            itemCountMap.put(templateScriptVO.getScriptResult(),emptyCount);
                        });
                    }
                }
            }
            List<ServiceSubtaskScriptCount> itemCounts = new ArrayList<>();
            allItemCounts.forEach(itemCount ->{
                if(ObjectUtils.isNotEmpty(count.getScriptid()) && ObjectUtils.isNotEmpty(itemCount.getScriptid())){
                    if(count.getScriptid().equals(itemCount.getScriptid())){
@@ -3089,7 +3091,7 @@
                    }
                }
            });
            itemCounts = new ArrayList<>(itemCountMap.values());
            List<ServiceSubtaskScriptCount> itemCounts = new ArrayList<>(itemCountMap.values());
            count.setDetails(itemCounts);
            result.put(count.getScriptid().toString(),count);
        }
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -1361,12 +1361,6 @@
        a.script_content,
        b.completed_quantity,
        b.all_quantity,
        <if test="type == 1">
            '' as options,
        </if>
        <if test="type == 2">
            c.options,
        </if>
        ROUND(b.completed_quantity/b.all_quantity,2) as completed_percentage
        FROM
        <if test="type == 1">
@@ -1425,14 +1419,6 @@
        </if>
        group by ssd.scriptid) b
        ON a.id = b.scriptid
        <!-- 统计问卷 -->
        <if test="type == 2">
            LEFT JOIN (
            SELECT target.scriptid,GROUP_CONCAT(optioncontent) as options
            FROM svy_task_template_targetoption target
            group by target.scriptid
            ) c ON a.scriptid = c.scriptid
        </if>
    </select>
    <select id="getSfStatisticsScriptItemDetails" parameterType="com.smartor.domain.ServiceSubtaskCountReq"