Commit f68797b6cebd1225497472428c885efc5c739e6e

Authored by litao@lymsh.com
1 parent 571704c4a6

12333

Showing 1 changed file with 9 additions and 3 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java View file @ f68797b
... ... @@ -12,6 +12,7 @@
12 12 import com.lyms.platform.common.utils.StringUtils;
13 13 import com.lyms.platform.operate.web.facade.AutoMatchFacade;
14 14 import com.lyms.platform.operate.web.service.ITrackDownService;
  15 +import com.lyms.platform.operate.web.utils.CollectionUtils;
15 16 import com.lyms.platform.operate.web.utils.MongoUtil;
16 17 import com.lyms.platform.pojo.*;
17 18 import org.springframework.beans.factory.annotation.Autowired;
18 19  
... ... @@ -59,11 +60,13 @@
59 60 residentCriteria.orOperator(Criteria.where("phone").regex(key), Criteria.where("username").regex(key), Criteria.where("certificateNum").is(key));
60 61 }
61 62 PageResult mongoPage = findMongoPage(Patients.class, Query.query(patientCriteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit);
62   - List<Patients> patients = null;
63   - if(mongoPage.getCount() >= limit) {
  63 + List<Patients> patients = (List<Patients>) mongoPage.getGrid();
  64 + boolean doPage = false;
  65 + if(patients.size() >= limit) {
64 66 patients = (List<Patients>) mongoPage.getGrid();
65 67 } else {
66 68 patients = mongoTemplate.find(Query.query(patientCriteria), Patients.class);
  69 + doPage = true;
67 70 }
68 71 List<ResidentsArchiveModel> residentsArchiveModels = mongoTemplate.find(Query.query(residentCriteria), ResidentsArchiveModel.class);
69 72 List<Map<String, Object>> restList = new ArrayList<>();
... ... @@ -146,7 +149,7 @@
146 149 restList.addAll(archiveModelList.subList(0, count));
147 150 }
148 151 }
149   - return RespBuilder.buildSuccess("tabList", new PageResult(mongoPage.getCount() + archiveModelCount, page, limit, restList));
  152 + return RespBuilder.buildSuccess("tabList", new PageResult(mongoPage.getCount() + archiveModelCount, page, limit, doPage ? CollectionUtils.getPageIds(restList, page, limit) : restList));
150 153 }
151 154  
152 155 private int isExitTrackDown(String parentId, TrackDownDateEnums trackDownDateEnums) {
153 156  
154 157  
... ... @@ -235,8 +238,11 @@
235 238 temp.put("residenceAddress", mongoUtil.findAddressName(residentsArchiveModel.getProvinceId(), residentsArchiveModel.getCityId(), residentsArchiveModel.getAreaId(), residentsArchiveModel.getStreetId())); /** 居住地 */
236 239 temp.put("phone", StringUtils.encryPhone(residentsArchiveModel.getPhone()));
237 240 TrackDown trackDown = mongoTemplate.findOne(Query.query(Criteria.where("residentsArchiveId").is(residentsArchiveModel.getId()).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class);
  241 + // 婚检追访结果
238 242 temp.put("end", trackDown == null ? "--" : TrackDownTransferEnums.getName(trackDown.getTrackDownType()));
  243 + // 婚检追访时间
239 244 temp.put("trackDownTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getTrackDownDate()));
  245 + // 预约时间
240 246 temp.put("yyTime", trackDown == null ? "--" : DateUtil.getyyyy_MM_dd(trackDown.getReservatDate()));
241 247 restList.add(temp);
242 248 }