Commit 36d70ce8d2725dacd7e3988c5804541c8fa021b1

Authored by dongqin
1 parent 8fd7a3474f
Exists in master and in 1 other branch dev

健康统计

Showing 4 changed files with 279 additions and 1 deletions

platform-dal/src/main/java/com/lyms/platform/query/HealthChargeQuery.java View file @ 36d70ce
... ... @@ -64,6 +64,16 @@
64 64  
65 65 private List<String> ids;
66 66  
  67 + private List<String> hospitalIds;
  68 +
  69 + public List<String> getHospitalIds() {
  70 + return hospitalIds;
  71 + }
  72 +
  73 + public void setHospitalIds(List<String> hospitalIds) {
  74 + this.hospitalIds = hospitalIds;
  75 + }
  76 +
67 77 public List<String> getIds() {
68 78 return ids;
69 79 }
... ... @@ -149,6 +159,10 @@
149 159  
150 160 if (CollectionUtils.isNotEmpty(ids)) {
151 161 condition = condition.and("id", ids, MongoOper.IN);
  162 + }
  163 +
  164 + if (CollectionUtils.isNotEmpty(hospitalIds)){
  165 + condition = condition.and("hospitalId", hospitalIds, MongoOper.IN);
152 166 }
153 167 Criteria c = null;
154 168  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java View file @ 36d70ce
... ... @@ -6,6 +6,7 @@
6 6 import com.lyms.platform.common.constants.ErrorCodeConstants;
7 7 import com.lyms.platform.common.result.BaseResponse;
8 8 import com.lyms.platform.operate.web.facade.AreaCountFacade;
  9 +import com.lyms.platform.operate.web.request.HealthManagerListRequest;
9 10 import com.lyms.platform.permission.model.ServiceListQuery;
10 11 import org.slf4j.Logger;
11 12 import org.slf4j.LoggerFactory;
... ... @@ -240,7 +241,6 @@
240 241 * @param param
241 242 */
242 243 @RequestMapping(value = "/getServiceDetail/export",method = RequestMethod.GET)
243   - //@ResponseBody
244 244 @TokenRequired
245 245 public void getServiceDetailExport(ServiceListQuery param, HttpServletRequest request, HttpServletResponse response){
246 246 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
... ... @@ -251,6 +251,29 @@
251 251 logger.error("增值服务统计导出失败", e);
252 252 }
253 253 }
  254 +
  255 + /**
  256 + * 健康管理统计list
  257 + *
  258 + * @param query
  259 + */
  260 + @RequestMapping(value = "/healthManager/list",method = RequestMethod.POST)
  261 + @ResponseBody
  262 + @TokenRequired
  263 + public BaseResponse healthManagerList(@RequestBody @Valid HealthManagerListRequest query, HttpServletRequest request){
  264 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  265 + query.setUserId(loginState.getId());
  266 + try {
  267 + return areaCountFacade.healthManagerList(query);
  268 + }catch (Exception e){
  269 + logger.error("健康管理统计失败",e);
  270 + BaseResponse baseResponse = new BaseResponse();
  271 + baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  272 + baseResponse.setErrormsg("增健康管理统计失败");
  273 + return baseResponse;
  274 + }
  275 + }
  276 +
254 277  
255 278 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java View file @ 36d70ce
... ... @@ -11,6 +11,7 @@
11 11 import com.lyms.platform.common.result.BaseResponse;
12 12 import com.lyms.platform.common.result.RespBuilder;
13 13 import com.lyms.platform.common.utils.*;
  14 +import com.lyms.platform.operate.web.request.HealthManagerListRequest;
14 15 import com.lyms.platform.operate.web.utils.CommonsHelper;
15 16 import com.lyms.platform.operate.web.utils.FunvCommonUtil;
16 17 import com.lyms.platform.operate.web.utils.MongoUtil;
... ... @@ -28,6 +29,7 @@
28 29 import com.lyms.platform.pojo.*;
29 30 import com.lyms.platform.query.AntExRecordQuery;
30 31 import com.lyms.platform.query.DataPermissionsModelQuery;
  32 +import com.lyms.platform.query.HealthChargeQuery;
31 33 import com.lyms.platform.query.PatientsQuery;
32 34 import org.apache.commons.collections.CollectionUtils;
33 35 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -93,6 +95,9 @@
93 95 @Autowired
94 96 private BabyBookbuildingService babyBookbuildingService;
95 97  
  98 + @Autowired
  99 + private HealthChargeService healthChargeService;
  100 +
96 101 public static ExpiryMap<String, BaseResponse> cacheGetServiceList = new ExpiryMap<>(1000 * 60 * 3);
97 102  
98 103 /**
... ... @@ -1373,6 +1378,74 @@
1373 1378 // 不同年
1374 1379 return day2-day1;
1375 1380 }
  1381 + }
  1382 +
  1383 + /**
  1384 + * 健康统计- list
  1385 + *
  1386 + * @param query
  1387 + * @return
  1388 + */
  1389 + public BaseResponse healthManagerList(HealthManagerListRequest query) {
  1390 + BaseResponse baseResponse = new BaseResponse();
  1391 + Date startTime = query.getStartTime();
  1392 + Date endTime = query.getEndTime();
  1393 + if (startTime == null || endTime == null){
  1394 + startTime = getStartDate();
  1395 + endTime = new Date();
  1396 + }
  1397 +
  1398 + String hospitalId = query.getHospitalId();
  1399 + String provinceId = query.getProvinceId();
  1400 + String cityId = query.getCityId();
  1401 + String areaId = query.getAreaId();
  1402 + String reportNameType = query.getReportNameType();
  1403 + String interpretDoctorId = query.getInterpretDoctorId();
  1404 + String reportSource = query.getReportSource();
  1405 + String reportType = query.getReportType();
  1406 + String settleStatus = query.getSettleStatus();
  1407 +
  1408 + List<String> hospitalIds = new ArrayList<>();
  1409 + if (StringUtils.isNotEmpty(hospitalId)){
  1410 + hospitalIds.add(hospitalId);
  1411 + }else {
  1412 + hospitalIds = getCurrentUserHospPermissions(query.getUserId(), StringUtils.isEmpty(provinceId) ? null : provinceId, StringUtils.isEmpty(cityId) ? null : cityId,
  1413 + StringUtils.isEmpty(areaId) ? null : areaId);
  1414 + }
  1415 + if (CollectionUtils.isNotEmpty(hospitalIds)){
  1416 + return baseResponse;
  1417 + }
  1418 +
  1419 + HealthChargeQuery healthChargeQuery = new HealthChargeQuery();
  1420 + healthChargeQuery.setCreatedStart(startTime);
  1421 + healthChargeQuery.setCreatedEnd(endTime);
  1422 + healthChargeQuery.setYn(YnEnums.YES.getId());
  1423 + if (StringUtils.isNotEmpty(reportNameType)){
  1424 + healthChargeQuery.setHealthType(Integer.parseInt(reportNameType));
  1425 + }
  1426 + if (StringUtils.isNotEmpty(interpretDoctorId)){
  1427 + healthChargeQuery.setDoctorId(interpretDoctorId);
  1428 + }
  1429 + if (StringUtils.isNotEmpty(reportSource)){
  1430 + healthChargeQuery.setSource(Integer.parseInt(reportSource));
  1431 + }
  1432 + if (StringUtils.isNotEmpty(reportType)){
  1433 + healthChargeQuery.setType(Integer.parseInt(reportType));
  1434 + }
  1435 + if (StringUtils.isNotEmpty(settleStatus)){
  1436 + healthChargeQuery.setStatus(Integer.parseInt(settleStatus));
  1437 + }
  1438 + if (CollectionUtils.isNotEmpty(hospitalIds)){
  1439 + healthChargeQuery.setHospitalIds(hospitalIds);
  1440 + }
  1441 +
  1442 + List<HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery);
  1443 +
  1444 +
  1445 +
  1446 +
  1447 +
  1448 + return null;
1376 1449 }
1377 1450 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HealthManagerListRequest.java View file @ 36d70ce
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +import com.lyms.platform.common.dao.BaseQuery;
  4 +
  5 +import java.util.Date;
  6 +
  7 +/**
  8 + *
  9 + * @Author dongqin
  10 + * @Description 健康统计请求参数
  11 + * @Date 19:23 2019/5/28
  12 + */
  13 +
  14 +public class HealthManagerListRequest extends BaseQuery {
  15 +
  16 + /**
  17 + * 起始时间
  18 + */
  19 + private Date startTime;
  20 +
  21 + /**
  22 + * 结束时间
  23 + */
  24 + private Date endTime;
  25 +
  26 + /**
  27 + * 省id
  28 + */
  29 + private String provinceId;
  30 +
  31 + /**
  32 + * 市id
  33 + */
  34 + private String cityId;
  35 +
  36 + /**
  37 + * 区id
  38 + */
  39 + private String areaId;
  40 +
  41 + /**
  42 + * 医院id
  43 + */
  44 + private String hospitalId;
  45 +
  46 + /**
  47 + * 报告解读人
  48 + */
  49 + private String interpretDoctorId;
  50 +
  51 + /**
  52 + * 1体重 2 血糖 3 血压 4妊高症 5-儿童
  53 + */
  54 + private String reportNameType;
  55 +
  56 + /**
  57 + * 1院内建档 2零时建档
  58 + */
  59 + private String reportSource;
  60 +
  61 + /**
  62 + * 报告类型 1普通报告 2高危报告
  63 + */
  64 + private String reportType;
  65 +
  66 + /**
  67 + * 结算状态 1-未结算 2-已结算
  68 + */
  69 + private String settleStatus;
  70 +
  71 + private Integer userId;
  72 +
  73 + public Integer getUserId() {
  74 + return userId;
  75 + }
  76 +
  77 + public void setUserId(Integer userId) {
  78 + this.userId = userId;
  79 + }
  80 +
  81 + public Date getStartTime() {
  82 + return startTime;
  83 + }
  84 +
  85 + public void setStartTime(Date startTime) {
  86 + this.startTime = startTime;
  87 + }
  88 +
  89 + public Date getEndTime() {
  90 + return endTime;
  91 + }
  92 +
  93 + public void setEndTime(Date endTime) {
  94 + this.endTime = endTime;
  95 + }
  96 +
  97 + public String getProvinceId() {
  98 + return provinceId;
  99 + }
  100 +
  101 + public void setProvinceId(String provinceId) {
  102 + this.provinceId = provinceId;
  103 + }
  104 +
  105 + public String getCityId() {
  106 + return cityId;
  107 + }
  108 +
  109 + public void setCityId(String cityId) {
  110 + this.cityId = cityId;
  111 + }
  112 +
  113 + public String getAreaId() {
  114 + return areaId;
  115 + }
  116 +
  117 + public void setAreaId(String areaId) {
  118 + this.areaId = areaId;
  119 + }
  120 +
  121 + public String getHospitalId() {
  122 + return hospitalId;
  123 + }
  124 +
  125 + public void setHospitalId(String hospitalId) {
  126 + this.hospitalId = hospitalId;
  127 + }
  128 +
  129 + public String getInterpretDoctorId() {
  130 + return interpretDoctorId;
  131 + }
  132 +
  133 + public void setInterpretDoctorId(String interpretDoctorId) {
  134 + this.interpretDoctorId = interpretDoctorId;
  135 + }
  136 +
  137 + public String getReportNameType() {
  138 + return reportNameType;
  139 + }
  140 +
  141 + public void setReportNameType(String reportNameType) {
  142 + this.reportNameType = reportNameType;
  143 + }
  144 +
  145 + public String getReportSource() {
  146 + return reportSource;
  147 + }
  148 +
  149 + public void setReportSource(String reportSource) {
  150 + this.reportSource = reportSource;
  151 + }
  152 +
  153 + public String getReportType() {
  154 + return reportType;
  155 + }
  156 +
  157 + public void setReportType(String reportType) {
  158 + this.reportType = reportType;
  159 + }
  160 +
  161 + public String getSettleStatus() {
  162 + return settleStatus;
  163 + }
  164 +
  165 + public void setSettleStatus(String settleStatus) {
  166 + this.settleStatus = settleStatus;
  167 + }
  168 +}