科室问卷数量
This commit is contained in:
parent
2ff9acbd2f
commit
8d143cdfe6
@ -7,6 +7,7 @@ import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.dto.department.DepartmentCount;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -113,7 +114,7 @@ public class QuestionInfoController extends BaseController {
|
||||
* 科室问卷数量
|
||||
*/
|
||||
@GetMapping("/departmentQuestionCount")
|
||||
public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus, String questionType) {
|
||||
return questionInfoService.departmentQuestionCount(departmentName, questionnaireStatus, questionType);
|
||||
public AjaxResult departmentQuestionCount(DepartmentCount departmentCount) {
|
||||
return AjaxResult.success(questionInfoService.departmentQuestionCount(departmentCount));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package com.xinelu.manage.dto.department;
|
||||
|
||||
import com.xinelu.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 科室数量DTO
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class DepartmentCount extends BaseEntity {
|
||||
/**
|
||||
* 科室名称
|
||||
*/
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 问卷发布状态
|
||||
*/
|
||||
private String questionnaireStatus;
|
||||
|
||||
/**
|
||||
* 问卷类型
|
||||
*/
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 机构信息
|
||||
*/
|
||||
private Long agencyId;
|
||||
|
||||
/**
|
||||
* 科室信息
|
||||
*/
|
||||
private Long departmentId;
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
package com.xinelu.manage.mapper.questioninfo;
|
||||
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.dto.department.DepartmentCount;
|
||||
import com.xinelu.manage.vo.department.DepartmentVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -65,9 +65,8 @@ public interface QuestionInfoMapper {
|
||||
/**
|
||||
* 科室路径数量
|
||||
*
|
||||
* @param departmentName 科室名称
|
||||
* @param questionnaireStatus 问卷状态
|
||||
* @param departmentCount 科室信息
|
||||
* @return DepartmentVO
|
||||
*/
|
||||
List<DepartmentVO> departmentQuestionByDepartmentName(@Param("departmentName") String departmentName, @Param("questionnaireStatus") String questionnaireStatus, @Param("questionType") String questionType);
|
||||
List<DepartmentVO> departmentQuestionByDepartmentName(DepartmentCount departmentCount);
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package com.xinelu.manage.service.questioninfo;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.dto.department.DepartmentCount;
|
||||
import com.xinelu.manage.vo.department.DepartmentVO;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
|
||||
import java.util.List;
|
||||
@ -72,8 +74,8 @@ public interface IQuestionInfoService {
|
||||
/**
|
||||
* 科室问卷数量
|
||||
*
|
||||
* @param departmentName 科室名称
|
||||
* @param departmentCount 科室信息
|
||||
* @return AjaxResult
|
||||
*/
|
||||
AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus,String questionType);
|
||||
List<DepartmentVO> departmentQuestionCount(DepartmentCount departmentCount);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.service.questioninfo.impl;
|
||||
|
||||
import com.xinelu.common.annotation.DataScope;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
@ -7,6 +8,7 @@ import com.xinelu.common.utils.uuid.IdUtils;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.domain.questionsubject.QuestionSubject;
|
||||
import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption;
|
||||
import com.xinelu.manage.dto.department.DepartmentCount;
|
||||
import com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper;
|
||||
import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper;
|
||||
import com.xinelu.manage.mapper.questionsubjectoption.QuestionSubjectOptionMapper;
|
||||
@ -310,19 +312,20 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
|
||||
/**
|
||||
* 科室问卷数量
|
||||
*
|
||||
* @param departmentName 科室名称
|
||||
* @param departmentCount 科室名称
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@DataScope(agencyAlias = "dt", deptAlias = "qi")
|
||||
@Override
|
||||
public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus, String questionType) {
|
||||
public List<DepartmentVO> departmentQuestionCount(DepartmentCount departmentCount) {
|
||||
DepartmentVO departmentVO = new DepartmentVO();
|
||||
List<DepartmentVO> department = new ArrayList<>();
|
||||
departmentVO.setDepartmentName("全部");
|
||||
departmentVO.setCountNum(0);
|
||||
List<DepartmentVO> departmentVOS = questionInfoMapper.departmentQuestionByDepartmentName(departmentName, questionnaireStatus, questionType);
|
||||
List<DepartmentVO> departmentVOS = questionInfoMapper.departmentQuestionByDepartmentName(departmentCount);
|
||||
if (CollectionUtils.isNotEmpty(departmentVOS)) {
|
||||
Integer result = departmentVOS.stream().mapToInt(DepartmentVO::getCountNum).sum();
|
||||
if (StringUtils.isBlank(questionnaireStatus)) {
|
||||
if (StringUtils.isBlank(departmentCount.getQuestionnaireStatus())) {
|
||||
result = departmentVOS.get(0).getTotalNumber();
|
||||
}
|
||||
departmentVO.setCountNum(result);
|
||||
@ -331,6 +334,6 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
|
||||
} else {
|
||||
department.add(departmentVO);
|
||||
}
|
||||
return AjaxResult.success(department);
|
||||
return department;
|
||||
}
|
||||
}
|
||||
|
||||
@ -275,6 +275,8 @@
|
||||
<if test="questionType != null and questionType != ''">
|
||||
and qi.question_type = #{questionType}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</where>
|
||||
GROUP BY dt.id
|
||||
</select>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user