|
|
|
@ -1,6 +1,8 @@ |
|
|
|
package com.ccsens.admin.controller; |
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.ccsens.common.annotation.Anonymous; |
|
|
|
import com.ccsens.common.constant.WebConstant; |
|
|
|
import com.ccsens.common.core.domain.JsonResponse; |
|
|
|
import com.ccsens.system.domain.dto.StatisticsDto; |
|
|
|
import com.ccsens.system.domain.vo.HomeDpVo; |
|
|
|
@ -13,8 +15,11 @@ import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
@ -37,6 +42,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("获取疾病统计信息") |
|
|
|
@PostMapping("/nntotal") |
|
|
|
public JsonResponse<HomeDpVo.Zhsjgl> nntotal(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nntotal(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -44,6 +58,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("BMI") |
|
|
|
@PostMapping("/nnbmihjxy") |
|
|
|
public JsonResponse<HomeDpVo.Bmi> nnbmihjxy(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nnbmihjxy(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -51,6 +74,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("评估情况") |
|
|
|
@PostMapping("/nnlast") |
|
|
|
public JsonResponse<List<HomeDpVo.Pgqk>> nnlast(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nnlast(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -58,6 +90,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("年龄") |
|
|
|
@PostMapping("/nnage") |
|
|
|
public JsonResponse<HomeDpVo.Nlfb> nnage(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nnage(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -65,6 +106,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("T值") |
|
|
|
@PostMapping("/nntgb") |
|
|
|
public JsonResponse<HomeDpVo.Tz> nntgb(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nntgb(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -72,6 +122,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("疾病排行") |
|
|
|
@PostMapping("/nnicd") |
|
|
|
public JsonResponse<List<HomeDpVo.Jbph>> nnicd(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nnicd(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -79,6 +138,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("地图") |
|
|
|
@PostMapping("/nnmap") |
|
|
|
public JsonResponse<List<HomeDpVo.Dt>> nnmap(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nnmap(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -86,6 +154,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("评估结果") |
|
|
|
@PostMapping("/nnscale") |
|
|
|
public JsonResponse<List<HomeDpVo.Pgjg>> nnscale(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.nnscale(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -93,6 +170,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("学历统计") |
|
|
|
@PostMapping("/qualificationStatistics") |
|
|
|
public JsonResponse<List<HomeDpVo.QualificationStatistics>> qualificationStatistics(@RequestBody StatisticsDto.Query dto) { |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.qualificationStatistics(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -100,6 +186,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("就诊数量统计") |
|
|
|
@PostMapping("/jzStatistics") |
|
|
|
public JsonResponse<HomeDpVo.JzStatistics> jzStatistics(@RequestBody StatisticsDto.Query dto){ |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.jzStatistics(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -107,6 +202,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("测评量表统计") |
|
|
|
@PostMapping("/scaleStatistics") |
|
|
|
public JsonResponse<List<HomeDpVo.ScaleStatistics>> scaleStatistics(@RequestBody StatisticsDto.Query dto){ |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.scaleStatistics(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -114,6 +218,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("测评版本统计") |
|
|
|
@PostMapping("/versionStatistics") |
|
|
|
public JsonResponse<List<HomeDpVo.VersionStatistics>> versionStatistics(@RequestBody StatisticsDto.Query dto){ |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.versionStatistics(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -121,6 +234,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("测评师测评统计") |
|
|
|
@PostMapping("/userStatistics") |
|
|
|
public JsonResponse<List<HomeDpVo.UserStatistics>> userStatistics(@RequestBody StatisticsDto.Query dto){ |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.userStatistics(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -128,6 +250,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("性别统计") |
|
|
|
@PostMapping("/sexStatistics") |
|
|
|
public JsonResponse<HomeDpVo.SexStatistics> sexStatistics(@RequestBody StatisticsDto.Query dto){ |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.sexStatistics(dto)); |
|
|
|
} |
|
|
|
|
|
|
|
@ -135,6 +266,15 @@ public class StatisticsController { |
|
|
|
@ApiOperation("吸烟饮酒统计") |
|
|
|
@PostMapping("/xyYjStatistics") |
|
|
|
public JsonResponse<HomeDpVo.XyYjStatistics> xyYjStatistics(@RequestBody StatisticsDto.Query dto){ |
|
|
|
if (dto.getDeptId() == null) { |
|
|
|
// 获取请求携带的令牌
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) |
|
|
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); |
|
|
|
if (StrUtil.isNotEmpty(deptId)) { |
|
|
|
dto.setDeptId(Long.parseLong(deptId)); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResponse.ok(statisticsService.xyYjStatistics(dto)); |
|
|
|
} |
|
|
|
} |
|
|
|
|