From f88c123835d3df71e3f8b65896627cf979dcdfd1 Mon Sep 17 00:00:00 2001 From: shiyang <316555390@qq.com> Date: Tue, 28 Dec 2021 08:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=A6=E5=B9=B3-=E5=AD=95=E4=BA=A7=E8=B4=AB?= =?UTF-8?q?=E8=A1=80=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lyms/platform/pojo/AntExChuModel.java | 10 +++++ .../com/lyms/platform/query/AntExChuQuery.java | 42 ++++++++++++++---- .../operate/web/controller/ViewController.java | 14 ++++++ .../platform/operate/web/facade/ViewFacade.java | 50 ++++++++++++++++++++++ 4 files changed, 108 insertions(+), 8 deletions(-) diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java b/platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java index e2178a6..f3480a3 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java @@ -487,6 +487,16 @@ public class AntExChuModel extends BaseModel { private String teamId;//医生团队 private String reason;//换团队的原因 + //统计筛选时间 + private String checkTimeString; + + public String getCheckTimeString() { + return checkTimeString; + } + + public void setCheckTimeString(String checkTimeString) { + this.checkTimeString = checkTimeString; + } public String getTeamId() { return teamId; diff --git a/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java index cf5a078..4a4172e 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java @@ -58,14 +58,17 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { private List notHivkt; private String xhdb; + //滦平统计用 + private String lpXhdbStart; + private String lpXhdbEnd; - private Integer xhdbXiao; + private String xhdbXiao; - public Integer getXhdbXiao() { + public String getXhdbXiao() { return xhdbXiao; } - public void setXhdbXiao(Integer xhdbXiao) { + public void setXhdbXiao(String xhdbXiao) { this.xhdbXiao = xhdbXiao; } @@ -77,6 +80,22 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { this.xhdb = xhdb; } + public String getLpXhdbStart() { + return lpXhdbStart; + } + + public void setLpXhdbStart(String lpXhdbStart) { + this.lpXhdbStart = lpXhdbStart; + } + + public String getLpXhdbEnd() { + return lpXhdbEnd; + } + + public void setLpXhdbEnd(String lpXhdbEnd) { + this.lpXhdbEnd = lpXhdbEnd; + } + public List getYgbmkyList() { return ygbmkyList; } @@ -361,7 +380,7 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { if (null != end) { if (null != c) { - c = c.lte(end); + c = c.and("checkTime").lte(end); } else { c = Criteria.where("checkTime").lte(end); } @@ -370,7 +389,7 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { if (null != nextCheckTimeStart && nextCheckTimeEnd != null) { if (null != c) { - c = c.where("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd); + c = c.and("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd); } else { c = Criteria.where("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd); } @@ -378,7 +397,7 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { if (null != checkTimeStart && checkTimeEnd != null) { if (null != c) { - c = c.where("checkTime").gte(checkTimeStart).lte(checkTimeEnd); + c = c.and("checkTime").gte(checkTimeStart).lte(checkTimeEnd); } else { c = Criteria.where("checkTime").gte(checkTimeStart).lte(checkTimeEnd); } @@ -386,14 +405,14 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { if (null != createdTimeStart && createdTimeEnd != null) { if (null != c) { - c = c.where("created").gte(createdTimeStart).lte(createdTimeEnd); + c = c.and("created").gte(createdTimeStart).lte(createdTimeEnd); } else { c = Criteria.where("created").gte(createdTimeStart).lte(createdTimeEnd); } } if (null != modifiedStart && modifiedEnd != null) { if (null != c) { - c = c.where("modified").gte(modifiedStart).lte(modifiedEnd); + c = c.and("modified").gte(modifiedStart).lte(modifiedEnd); } else { c = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd); } @@ -404,6 +423,13 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); } + if (null != lpXhdbStart&&null!=lpXhdbEnd) { + if (null != c) { + c = c.and("xhdb").gte(lpXhdbStart).lte(lpXhdbEnd); + } else { + c = Criteria.where("xhdb").gte(lpXhdbStart).lte(lpXhdbEnd); + } + } if (null != c) { condition = condition.andCondition(new MongoCondition(c)); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java index e269a18..d6ec209 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java @@ -1,6 +1,7 @@ package com.lyms.platform.operate.web.controller; import com.aspose.words.*; +import com.lyms.platform.biz.AntExChuModelTemp; import com.lyms.platform.common.annotation.TokenRequired; import com.lyms.platform.common.base.BaseController; import com.lyms.platform.common.base.LoginContext; @@ -13,6 +14,7 @@ import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; import com.lyms.platform.operate.web.facade.MatdeliverFollowFacade; import com.lyms.platform.operate.web.facade.ViewFacade; import com.lyms.platform.operate.web.request.RisInfoModelRequest; +import com.lyms.platform.pojo.AntExChuModel; import com.lyms.platform.query.BabyModelQuery; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -1225,4 +1227,16 @@ public class ViewController extends BaseController { return viewFacade.getBabyScreening(cardNo); } + /** + * 统计管理-孕期贫血统计 + *统计初诊血红蛋白值得范围 + * @param antExChuModel + * @return + */ + @RequestMapping(value = "/getChuXhdb", method = RequestMethod.GET) + @ResponseBody + @TokenRequired + public BaseResponse getChuXhdb(AntExChuModel antExChuModel) { + return viewFacade.getChuXhdb(antExChuModel); + } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java index 3b34dde..a8b5c1f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java @@ -9,6 +9,7 @@ import java.text.SimpleDateFormat; import java.util.*; import com.lyms.hospitalapi.qhdfy.QhdfyHisService; +import com.lyms.platform.biz.AntExChuModelTemp; import com.lyms.platform.common.constants.*; import com.lyms.platform.common.enums.*; import com.lyms.platform.common.utils.*; @@ -35,6 +36,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.domain.Sort; import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.data.mongodb.core.aggregation.Aggregation; +import org.springframework.data.mongodb.core.aggregation.AggregationOperation; +import org.springframework.data.mongodb.core.aggregation.AggregationResults; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; @@ -8783,4 +8787,50 @@ public class ViewFacade { } return data; } + + public BaseResponse getChuXhdb(AntExChuModel antExChuModel) { + BaseResponse br = new BaseResponse(); + Mapmap =new HashMap<>(); + AntExChuQuery antExChuQuery=new AntExChuQuery(); + //检查时间筛选 + if (StringUtils.isNotEmpty(antExChuModel.getCheckTimeString())) { + try { + antExChuQuery.setCheckTimeStart(DateUtil.getSNDate(antExChuModel.getCheckTimeString())[0]); + antExChuQuery.setCheckTimeEnd(DateUtil.getSNDate(antExChuModel.getCheckTimeString())[1]); + } catch (Exception e) { + // 什么都不做,这里是数据传入错误了 + } + } + antExChuQuery.setHospitalId(antExChuModel.getHospitalId()); + //轻度妊娠期贫血(100-109g/l) + antExChuQuery.setLpXhdbStart("100"); + antExChuQuery.setLpXhdbEnd("109"); + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString()); + Long light = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class); + map.put("light",light); + //中度妊娠期贫血(70-99g/l) + antExChuQuery.setLpXhdbStart("70"); + antExChuQuery.setLpXhdbEnd("99"); + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString()); + Long middle = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class); + map.put("middle",middle); + //重度妊娠期贫血(40-69g/l) + antExChuQuery.setLpXhdbStart("40"); + antExChuQuery.setLpXhdbEnd("69"); + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString()); + Long matter = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class); + map.put("matter",matter); + //极重度贫血(<40g/l) + antExChuQuery.setXhdbXiao("40"); + antExChuQuery.setLpXhdbStart(null); + antExChuQuery.setLpXhdbEnd(null); + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString()); + Long severity = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class); + map.put("severity",severity); + br.setErrorcode(ErrorCodeConstants.SUCCESS); + br.setErrormsg("成功"); + br.setObject(map); + return br; + + } } -- 1.8.3.1