Commit 4ebbd79e057180bbb010cd7c866bdfba385c2a30

Authored by wtt
1 parent eadbfd076f

update

Showing 1 changed file with 59 additions and 6 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 4ebbd79
1 1 package com.lyms.platform.operate.web.controller;
2 2  
3   -import com.alibaba.fastjson.JSON;
4 3 import com.lyms.hospitalapi.Cdfy.CdGwInterface;
5 4 import com.lyms.hospitalapi.Cdfy.CdfyHisService;
6 5 import com.lyms.hospitalapi.dzfy.DzfyFmService;
7 6  
8 7  
9 8  
... ... @@ -28,18 +27,22 @@
28 27 import com.lyms.platform.operate.web.service.IBloodPressureService;
29 28 import com.lyms.platform.operate.web.service.PatientWeightService;
30 29 import com.lyms.platform.operate.web.service.SyncDataTaskService;
31   -import com.lyms.platform.operate.web.worker.*;
  30 +import com.lyms.platform.operate.web.worker.AntexOtherHighRiskWorker;
  31 +import com.lyms.platform.operate.web.worker.AntexcOtherHighRiskWorker;
  32 +import com.lyms.platform.operate.web.worker.BabyBuildSerToPatientSerWorker;
  33 +import com.lyms.platform.operate.web.worker.BuildSerToPatientSerWorker;
32 34 import com.lyms.platform.permission.model.*;
33   -import com.lyms.platform.permission.service.*;
  35 +import com.lyms.platform.permission.service.BabyDiagnoseService;
  36 +import com.lyms.platform.permission.service.OrganizationService;
  37 +import com.lyms.platform.permission.service.PatientServiceService;
  38 +import com.lyms.platform.permission.service.UsersService;
34 39 import com.lyms.platform.pojo.*;
35 40 import com.lyms.platform.query.*;
36   -import com.mongodb.Mongo;
37 41 import org.apache.commons.collections.CollectionUtils;
38 42 import org.apache.commons.io.FileUtils;
39 43 import org.apache.commons.lang.StringUtils;
40 44 import org.springframework.beans.factory.annotation.Autowired;
41 45 import org.springframework.beans.factory.annotation.Qualifier;
42   -import org.springframework.data.authentication.UserCredentials;
43 46 import org.springframework.data.domain.Sort;
44 47 import org.springframework.data.mongodb.core.MongoTemplate;
45 48 import org.springframework.data.mongodb.core.query.Criteria;
... ... @@ -47,7 +50,10 @@
47 50 import org.springframework.data.mongodb.core.query.Update;
48 51 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
49 52 import org.springframework.stereotype.Controller;
50   -import org.springframework.web.bind.annotation.*;
  53 +import org.springframework.web.bind.annotation.RequestMapping;
  54 +import org.springframework.web.bind.annotation.RequestMethod;
  55 +import org.springframework.web.bind.annotation.RequestParam;
  56 +import org.springframework.web.bind.annotation.ResponseBody;
51 57  
52 58 import javax.servlet.http.HttpServletRequest;
53 59 import javax.servlet.http.HttpServletResponse;
... ... @@ -999,6 +1005,53 @@
999 1005 }).start();
1000 1006 }
1001 1007 return "syncPatientsLastCheckEmployeeId start......";
  1008 + }
  1009 + /**
  1010 + * 秦皇岛市妇幼
  1011 + * 2019年在本院分娩的多少人,其中有多少人是本院初诊的
  1012 + * 2020年在本院分娩的多少人,其中有多少人是本院初诊的
  1013 + */
  1014 + @ResponseBody
  1015 + @RequestMapping(value = "/tongji", method = RequestMethod.GET)
  1016 + public Integer tongji(@RequestParam(required = false) String start,
  1017 + @RequestParam(required = false) String end,
  1018 + @RequestParam(required = false) String hospitalId) {
  1019 + long l = System.currentTimeMillis();
  1020 + Integer i = getInteger(start, end, hospitalId);
  1021 + long l1 = System.currentTimeMillis();
  1022 + System.out.println("执行时间:" + (l1 - l));
  1023 + return i;
  1024 + }
  1025 +
  1026 + private Integer getInteger(String createdTimeStart, String createdTimeEnd, String hospitalId) {
  1027 + Integer i = 0;
  1028 + try {
  1029 + MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
  1030 + matDeliverQuery.setYn(YnEnums.YES.getId());
  1031 + matDeliverQuery.setFmHospital(hospitalId);
  1032 + Date startDate1 = DateUtil.parseYMD(createdTimeStart);
  1033 + Date endDate1 = DateUtil.getDayLastSecond( DateUtil.parseYMD(createdTimeEnd));
  1034 + matDeliverQuery.setCreatedTimeStart(startDate1);
  1035 + matDeliverQuery.setCreatedTimeEnd(endDate1);
  1036 + List <MaternalDeliverModel> maternalDeliverModels = matDeliverService.query(matDeliverQuery);
  1037 + System.out.println(matDeliverQuery.convertToQuery().convertToMongoQuery());
  1038 + boolean b = true;
  1039 + for (MaternalDeliverModel m: maternalDeliverModels ) {
  1040 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  1041 + antExChuQuery.setHospitalId("216");
  1042 + antExChuQuery.setYn(YnEnums.YES.getId());
  1043 + antExChuQuery.setParentId(m.getParentId());
  1044 + List<AntExChuModel> antExChu = antenatalExaminationService.queryAntExChu(antExChuQuery);
  1045 + System.out.println(b==true?antExChuQuery.convertToQuery().convertToMongoQuery():"");
  1046 + b = false;
  1047 + if(CollectionUtils.isNotEmpty(antExChu)){
  1048 + i++;
  1049 + }
  1050 + }
  1051 + } catch (Exception e) {
  1052 + e.printStackTrace();
  1053 + }
  1054 + return i;
1002 1055 }
1003 1056  
1004 1057 /**