Commit 42d625e8570408d7ec6f2982b81aac6283b1abc4

Authored by shiyang
1 parent f88c123835

滦平-孕产贫血统计-详情

Showing 4 changed files with 79 additions and 5 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java View file @ 42d625e
... ... @@ -361,6 +361,14 @@
361 361 public int queryWeekPointCount(int startWeek, int endWeek, String hospitalId, Date startTime, Date endTime,Integer pointType) {
362 362 return iAntenatalExaminationDao.queryWeekPointCount(startWeek, endWeek, hospitalId, startTime, endTime, pointType);
363 363 }
  364 + public List<AntExChuModel> queryAntExChuPage(AntExChuQuery antExChuQuery,Sort.Direction direction,String sortField) {
  365 + MongoQuery query = antExChuQuery.convertToQuery();
  366 + if (StringUtils.isNotEmpty(antExChuQuery.getNeed())) {
  367 + antExChuQuery.mysqlBuild(antExDao.count(query));
  368 + query.start(antExChuQuery.getOffset()).end(antExChuQuery.getLimit());
  369 + }
  370 + return iAntExChuDao.query(query.addOrder(direction, sortField));
  371 + }
364 372  
365 373 }
platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java View file @ 42d625e
... ... @@ -489,6 +489,16 @@
489 489 private String reason;//换团队的原因
490 490 //统计筛选时间
491 491 private String checkTimeString;
  492 + //贫血等级
  493 + private Integer xhdbLevel;
  494 +
  495 + public Integer getXhdbLevel() {
  496 + return xhdbLevel;
  497 + }
  498 +
  499 + public void setXhdbLevel(Integer xhdbLevel) {
  500 + this.xhdbLevel = xhdbLevel;
  501 + }
492 502  
493 503 public String getCheckTimeString() {
494 504 return checkTimeString;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java View file @ 42d625e
... ... @@ -1239,5 +1239,18 @@
1239 1239 public BaseResponse getChuXhdb(AntExChuModel antExChuModel) {
1240 1240 return viewFacade.getChuXhdb(antExChuModel);
1241 1241 }
  1242 +
  1243 + /**
  1244 + * 统计管理-孕期贫血统计-详情
  1245 + *
  1246 + * @param antExChuModel
  1247 + * @return
  1248 + */
  1249 + @RequestMapping(value = "/getChuXhdbDetails", method = RequestMethod.GET)
  1250 + @ResponseBody
  1251 + @TokenRequired
  1252 + public BaseObjectResponse getChuXhdbDetails(AntExChuModel antExChuModel,Integer page,Integer limit) {
  1253 + return viewFacade.getChuXhdbDetails(antExChuModel,page,limit);
  1254 + }
1242 1255 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 42d625e
... ... @@ -12,6 +12,7 @@
12 12 import com.lyms.platform.biz.AntExChuModelTemp;
13 13 import com.lyms.platform.common.constants.*;
14 14 import com.lyms.platform.common.enums.*;
  15 +import com.lyms.platform.common.result.BaseListResponse;
15 16 import com.lyms.platform.common.utils.*;
16 17 import com.lyms.platform.common.utils.HttpClientUtil;
17 18 import com.lyms.platform.operate.web.request.MessagesResult;
... ... @@ -8792,6 +8793,7 @@
8792 8793 BaseResponse br = new BaseResponse();
8793 8794 Map<String,Object>map =new HashMap<>();
8794 8795 AntExChuQuery antExChuQuery=new AntExChuQuery();
  8796 + antExChuQuery.setHospitalId(antExChuModel.getHospitalId());
8795 8797 //检查时间筛选
8796 8798 if (StringUtils.isNotEmpty(antExChuModel.getCheckTimeString())) {
8797 8799 try {
8798 8800  
8799 8801  
8800 8802  
8801 8803  
8802 8804  
8803 8805  
... ... @@ -8801,37 +8803,78 @@
8801 8803 // 什么都不做,这里是数据传入错误了
8802 8804 }
8803 8805 }
8804   - antExChuQuery.setHospitalId(antExChuModel.getHospitalId());
8805 8806 //轻度妊娠期贫血(100-109g/l)
8806 8807 antExChuQuery.setLpXhdbStart("100");
8807 8808 antExChuQuery.setLpXhdbEnd("109");
8808   - System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
8809 8809 Long light = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
8810 8810 map.put("light",light);
8811 8811 //中度妊娠期贫血(70-99g/l)
8812 8812 antExChuQuery.setLpXhdbStart("70");
8813 8813 antExChuQuery.setLpXhdbEnd("99");
8814   - System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
8815 8814 Long middle = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
8816 8815 map.put("middle",middle);
8817 8816 //重度妊娠期贫血(40-69g/l)
8818 8817 antExChuQuery.setLpXhdbStart("40");
8819 8818 antExChuQuery.setLpXhdbEnd("69");
8820   - System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
8821 8819 Long matter = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
8822 8820 map.put("matter",matter);
8823 8821 //极重度贫血(<40g/l)
8824 8822 antExChuQuery.setXhdbXiao("40");
8825 8823 antExChuQuery.setLpXhdbStart(null);
8826 8824 antExChuQuery.setLpXhdbEnd(null);
8827   - System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
8828 8825 Long severity = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
8829 8826 map.put("severity",severity);
  8827 + map.put("total",light+middle+matter+severity);
8830 8828 br.setErrorcode(ErrorCodeConstants.SUCCESS);
8831 8829 br.setErrormsg("成功");
8832 8830 br.setObject(map);
8833 8831 return br;
8834 8832  
  8833 + }
  8834 +
  8835 + public BaseObjectResponse getChuXhdbDetails(AntExChuModel antExChuModel,Integer page,Integer limit) {
  8836 +
  8837 + BaseObjectResponse baseObjectResponse=new BaseObjectResponse();
  8838 + AntExChuQuery antExChuQuery=new AntExChuQuery();
  8839 + antExChuQuery.setHospitalId(antExChuModel.getHospitalId());
  8840 + //检查时间筛选
  8841 + if (StringUtils.isNotEmpty(antExChuModel.getCheckTimeString())) {
  8842 + try {
  8843 + antExChuQuery.setCheckTimeStart(DateUtil.getSNDate(antExChuModel.getCheckTimeString())[0]);
  8844 + antExChuQuery.setCheckTimeEnd(DateUtil.getSNDate(antExChuModel.getCheckTimeString())[1]);
  8845 + } catch (Exception e) {
  8846 + // 什么都不做,这里是数据传入错误了
  8847 + }
  8848 + }
  8849 + if(null!=antExChuModel.getXhdbLevel()){
  8850 + switch (antExChuModel.getXhdbLevel()){
  8851 + case 1:
  8852 + //轻度妊娠期贫血(100-109g/l)
  8853 + antExChuQuery.setLpXhdbStart("100");
  8854 + antExChuQuery.setLpXhdbEnd("109");
  8855 + break;
  8856 + case 2:
  8857 + //中度妊娠期贫血(70-99g/l)
  8858 + antExChuQuery.setLpXhdbStart("70");
  8859 + antExChuQuery.setLpXhdbEnd("99");
  8860 + break;
  8861 + case 3:
  8862 + //重度妊娠期贫血(40-69g/l)
  8863 + antExChuQuery.setLpXhdbStart("40");
  8864 + antExChuQuery.setLpXhdbEnd("69");
  8865 + break;
  8866 + case 4:
  8867 + //极重度贫血(<40g/l)
  8868 + antExChuQuery.setXhdbXiao("40");
  8869 + break;
  8870 + }
  8871 + }
  8872 + antExChuQuery.setNeed("yes");
  8873 + antExChuQuery.setPage(null!=page&&0!=page?page:1);
  8874 + antExChuQuery.setLimit(null!=limit&&0!=limit?limit:20);
  8875 + List<AntExChuModel> antExChuModels = antExService.queryAntExChuPage(antExChuQuery,Sort.Direction.DESC, "checkTime");
  8876 + baseObjectResponse.setData(antExChuModels).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(antExChuQuery.getPageInfo());
  8877 + return baseObjectResponse;
8835 8878 }
8836 8879 }