Commit cba12d7ff904e5f836ef1a60b7429f46ade5e696

Authored by gengxiaokai
1 parent 5fea138fd2

承德公共卫生定时任务

Showing 1 changed file with 26 additions and 0 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/Cdfy/CdGwInterface.java View file @ cba12d7
... ... @@ -39,6 +39,9 @@
39 39 import org.apache.http.util.EntityUtils;
40 40 import org.springframework.beans.factory.annotation.Autowired;
41 41 import org.springframework.data.domain.Sort;
  42 +import org.springframework.data.mongodb.core.MongoTemplate;
  43 +import org.springframework.data.mongodb.core.query.Criteria;
  44 +import org.springframework.data.mongodb.core.query.Query;
42 45 import org.springframework.stereotype.Service;
43 46  
44 47 import java.sql.*;
... ... @@ -74,6 +77,8 @@
74 77 private BabyBookbuildingService babyBookbuildingService;
75 78 @Autowired
76 79 private CouponMapper mapper;
  80 + @Autowired
  81 + private MongoTemplate mongoTemplate;
77 82  
78 83 //基本信息以及地址信息
79 84 public BaseObjectResponse saveBaseInfo(Patients patient) {
80 85  
... ... @@ -4377,8 +4382,28 @@
4377 4382  
4378 4383  
4379 4384  
  4385 + /**
  4386 + * 承德智业新生儿访视调用方法
  4387 + * @param startDate
  4388 + * @param endDate
  4389 + * @return
  4390 + */
  4391 + public BaseObjectResponse saveXsrFs(String startDate,String endDate){
  4392 + BaseObjectResponse br = null;
  4393 + Criteria c = null;
  4394 + c = Criteria.where("created").lt(DateUtil.parseYMDHMS(startDate)).lte(DateUtil.parseYMDHMS(endDate));
  4395 + List<NewbornVisit> visit = mongoTemplate.find(Query.query(c),NewbornVisit.class);
  4396 + if(visit != null && visit.size() > 0){
  4397 + for(NewbornVisit newbornVisit : visit){
  4398 + br = saveChild_HomeVisit_Memo(newbornVisit);
  4399 + }
  4400 + }
  4401 + return br;
  4402 + }
4380 4403  
4381 4404  
  4405 +
  4406 +
4382 4407 public void handleWork() {
4383 4408 java.util.Date end = new java.util.Date();
4384 4409 java.util.Date start = new java.util.Date(end.getTime()-1000*60*60);
... ... @@ -4392,6 +4417,7 @@
4392 4417 saveChFs(startDate, endDate);
4393 4418 saveChFc(startDate, endDate);
4394 4419 saveEtDa(startDate, endDate);
  4420 + saveXsrFs(startDate, endDate);
4395 4421  
4396 4422 }
4397 4423