Commit 7195e4040040d601c1c8ab240ecae1c9cd4a252f

Authored by liquanyu
1 parent c25546508c

查询修改

Showing 2 changed files with 55 additions and 5 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 7195e40
... ... @@ -2,6 +2,7 @@
2 2  
3 3 import com.lyms.hospitalapi.qhdfy.QhdfyHisService;
4 4 import com.lyms.platform.biz.JdbcUtil;
  5 +import com.lyms.platform.biz.service.AntenatalExaminationService;
5 6 import com.lyms.platform.biz.service.AssayConfigService;
6 7 import com.lyms.platform.biz.service.PatientsService;
7 8 import com.lyms.platform.biz.service.SieveService;
8 9  
9 10  
... ... @@ -10,12 +11,17 @@
10 11 import com.lyms.platform.common.utils.JsonUtil;
11 12 import com.lyms.platform.operate.web.service.SyncDataTaskService;
12 13 import com.lyms.platform.permission.service.OrganizationService;
  14 +import com.lyms.platform.pojo.AntExChuModel;
  15 +import com.lyms.platform.pojo.AntenatalExaminationModel;
13 16 import com.lyms.platform.pojo.AssayConfig;
14 17 import com.lyms.platform.pojo.Patients;
  18 +import com.lyms.platform.query.AntExChuQuery;
  19 +import com.lyms.platform.query.AntExQuery;
15 20 import com.lyms.platform.query.PatientsQuery;
16 21 import org.apache.commons.collections.CollectionUtils;
17 22 import org.apache.commons.io.FileUtils;
18 23 import org.springframework.beans.factory.annotation.Autowired;
  24 +import org.springframework.data.domain.Sort;
19 25 import org.springframework.data.mongodb.core.MongoTemplate;
20 26 import org.springframework.stereotype.Controller;
21 27 import org.springframework.web.bind.annotation.RequestMapping;
... ... @@ -53,6 +59,9 @@
53 59 @Autowired
54 60 private OrganizationService organizationService;
55 61  
  62 + @Autowired
  63 + private AntenatalExaminationService antenatalExaminationService;
  64 +
56 65 /**
57 66 * 获取科室
58 67 */
... ... @@ -285,6 +294,52 @@
285 294 public String rebuildDefaultRoles() {
286 295 organizationService.rebuildDefaultRoles();
287 296 return "sieveOrder finish";
  297 + }
  298 +
  299 +
  300 + @RequestMapping(value = "/syncPatNextTime", method = RequestMethod.GET)
  301 + @ResponseBody
  302 + public String syncPatNextTime() {
  303 + PatientsQuery patientQuery = new PatientsQuery();
  304 + patientQuery.setYn(YnEnums.YES.getId());
  305 + patientQuery.setHospitalId("221");
  306 + patientQuery.setType(1);
  307 + List<Patients> patientses = patientsService.queryPatient(patientQuery);
  308 + if (CollectionUtils.isNotEmpty(patientses))
  309 + {
  310 + for (Patients pat : patientses) {
  311 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  312 + antExChuQuery.setYn(YnEnums.YES.getId());
  313 + antExChuQuery.setHospitalId(pat.getHospitalId());
  314 + antExChuQuery.setParentId(pat.getId());
  315 + List<AntExChuModel> chus = antenatalExaminationService.queryAntExChu(antExChuQuery);
  316 + if (CollectionUtils.isNotEmpty(chus)) {
  317 + Date nextTime = null;
  318 + AntExChuModel chu = chus.get(0);
  319 + if (chu != null)
  320 + {
  321 + nextTime = chu.getNextCheckTime();
  322 +
  323 + AntExQuery antExQuery = new AntExQuery();
  324 + antExQuery.setParentId(pat.getId());
  325 + antExQuery.setYn(YnEnums.YES.getId());
  326 + antExQuery.setHospitalId(pat.getHospitalId());
  327 + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
  328 + if (CollectionUtils.isNotEmpty(list))
  329 + {
  330 + AntenatalExaminationModel ae = list.get(0);
  331 + if (ae != null)
  332 + {
  333 + nextTime = ae.getNextCheckTime();
  334 + }
  335 + }
  336 + patientsService.updatePatientOneCol(pat.getId(), "nextCheckTime", nextTime);
  337 + }
  338 +
  339 + }
  340 + }
  341 + }
  342 + return "syncPatNextTime finish";
288 343 }
289 344  
290 345 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 7195e40
... ... @@ -16,24 +16,19 @@
16 16 import com.lyms.platform.operate.web.worker.WorkHR;
17 17 import com.lyms.platform.permission.model.Organization;
18 18 import com.lyms.platform.permission.model.OrganizationQuery;
19   -import com.lyms.platform.permission.model.Users;
20 19 import com.lyms.platform.permission.service.OrganizationService;
21 20 import com.lyms.platform.permission.service.UsersService;
22 21 import com.lyms.platform.pojo.*;
23 22 import com.lyms.platform.query.*;
24   -import com.sun.javafx.collections.MappingChange;
25 23 import org.apache.commons.collections.CollectionUtils;
26 24 import org.apache.commons.lang.StringUtils;
27   -import org.apache.commons.lang.math.NumberUtils;
28 25 import org.slf4j.Logger;
29 26 import org.slf4j.LoggerFactory;
30 27 import org.springframework.beans.factory.annotation.Autowired;
31   -import org.springframework.data.domain.Sort;
32 28 import org.springframework.stereotype.Component;
33 29 import org.springframework.util.StopWatch;
34 30  
35 31 import javax.servlet.http.HttpServletResponse;
36   -import java.io.IOException;
37 32 import java.io.OutputStream;
38 33 import java.util.*;
39 34 import java.util.concurrent.*;