修改导入的一些bug
This commit is contained in:
@ -9,9 +9,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.dw.domain.DwAnswer;
|
||||
import com.ruoyi.dw.service.IDwAnswerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
@ -91,11 +89,4 @@ public class DwAnswerController extends BaseController
|
||||
return toAjax(dwAnswerService.deleteDwAnswerByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "导入调查问卷", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importAnswer(MultipartFile file, int infoId) throws Exception{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -127,8 +127,8 @@ public class DwIndexConfigController extends BaseController
|
||||
return AjaxResult.error("请先选择展示调查问题");
|
||||
}
|
||||
String[] question_ids = dwIndexConfig.getQuestionId().split(",");
|
||||
if (question_ids.length > 1 && dwIndexConfig.getIndexType() == 0){
|
||||
return AjaxResult.error("饼状图只能选择一个问题");
|
||||
if (question_ids.length > 1){
|
||||
return AjaxResult.error("只能选择一个问题");
|
||||
}
|
||||
return toAjax(dwIndexConfigService.insertDwIndexConfig(dwIndexConfig));
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class DwIndexConfig extends BaseEntity
|
||||
@Excel(name = "展现形式")
|
||||
private Long indexType;
|
||||
|
||||
public void setId(Long id)
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ public interface DwIndexConfigMapper
|
||||
|
||||
/**
|
||||
* 根据问题id进行统计
|
||||
* @param questionIds
|
||||
* @param questionId
|
||||
* @return
|
||||
*/
|
||||
public List<AnswerCountVo> selectIndex(@Param("questionIds") String[] questionIds, @Param("infoId") Long infoId);
|
||||
public List<AnswerCountVo> selectIndex(@Param("questionId") Long questionId, @Param("infoId") Long infoId);
|
||||
|
||||
/**
|
||||
* 毕业年份折线图统计
|
||||
|
@ -6,16 +6,20 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.dw.domain.DwQuestion;
|
||||
import com.ruoyi.dw.domain.vo.AnswerCountVo;
|
||||
import com.ruoyi.dw.domain.vo.BynfVo;
|
||||
import com.ruoyi.dw.domain.vo.DwxzVo;
|
||||
import com.ruoyi.dw.domain.vo.SydVo;
|
||||
import com.ruoyi.dw.mapper.DwQuestionMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.dw.mapper.DwIndexConfigMapper;
|
||||
import com.ruoyi.dw.domain.DwIndexConfig;
|
||||
import com.ruoyi.dw.service.IDwIndexConfigService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 调查问卷统计展示Service业务层处理
|
||||
*
|
||||
@ -28,6 +32,9 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService
|
||||
@Autowired
|
||||
private DwIndexConfigMapper dwIndexConfigMapper;
|
||||
|
||||
@Resource
|
||||
private DwQuestionMapper dwQuestionMapper;
|
||||
|
||||
/**
|
||||
* 查询调查问卷统计展示
|
||||
*
|
||||
@ -110,7 +117,9 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService
|
||||
for (DwIndexConfig config: configs){
|
||||
result.put("id", config.getId());
|
||||
result.put("indexType", config.getIndexType());
|
||||
List<AnswerCountVo> list = dwIndexConfigMapper.selectIndex(config.getQuestionId().split(","), config.getInfoId());
|
||||
DwQuestion question = dwQuestionMapper.selectDwQuestionById(Long.valueOf(config.getQuestionId()));
|
||||
result.put("question", question.getQuestion());
|
||||
List<AnswerCountVo> list = dwIndexConfigMapper.selectIndex(Long.valueOf(config.getQuestionId()), config.getInfoId());
|
||||
result.put("data", list);
|
||||
}
|
||||
return result;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -90,12 +90,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<select id="selectIndex" resultType="com.ruoyi.dw.domain.vo.AnswerCountVo">
|
||||
select answer, count(0) as answer_count from dw_answer
|
||||
where indo_id = #{infoId}
|
||||
and question_id in
|
||||
<foreach item="questionId" collection="questionIds" open="(" separator="," close=")">
|
||||
#{questionId}
|
||||
</foreach>
|
||||
select answer, count(0) as answer_count
|
||||
from dw_answer
|
||||
where indo_id = #{infoId}
|
||||
and question_id = #{questionId}
|
||||
group by answer
|
||||
</select>
|
||||
|
||||
|
Reference in New Issue
Block a user