Commit bea35a6424896b8f2cdc96747f88c83b498ed100

Authored by [wangbo]
1 parent 6f8ea25b8d

孕妇追访搜索字段添加

Showing 14 changed files with 468 additions and 67 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientDao.java View file @ bea35a6
... ... @@ -16,6 +16,7 @@
16 16  
17 17 public void updatePatient(Patients obj, String id);
18 18  
  19 +
19 20 public void deletePatient(String id);
20 21  
21 22 public Patients getPatient(String id);
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ bea35a6
... ... @@ -55,6 +55,11 @@
55 55 iPatientDao.updatePatient(obj, obj.getId());
56 56 }
57 57  
  58 + public void updatePatientOne(Patients obj, String id) {
  59 + iPatientDao.updatePatient(obj, id);
  60 + }
  61 +
  62 +
58 63 public void findAndModify(PatientsQuery query, Patients obj) {
59 64 iPatientDao.findAndModify(query.convertToQuery(), obj);
60 65 }
... ... @@ -344,8 +349,8 @@
344 349 System.out.println("开始处理产检、产筛追访数据进入产后复查追访:" + records.size());
345 350 for (TrackDownRecord tr : records) {
346 351 Patients patients = iPatientDao.getPatient(tr.getParentId());
347   - if (patients != null){
348   - if( patients.getType() == 3) {//产妇
  352 + if (patients != null) {
  353 + if (patients.getType() == 3) {//产妇
349 354 System.out.println("产检追访已经分娩:" + patients.getId());
350 355 //分娩距当前时间天数
351 356 int day = DateUtil.daysBetween(patients.getFmDate(), new Date());
... ... @@ -359,7 +364,8 @@
359 364 System.out.println("开始处理产检、产筛追访数据进入分娩追访:" + patients.getId());
360 365 tr.setStatus(0);
361 366 }
362   - }if(patients.getType() == 1){
  367 + }
  368 + if (patients.getType() == 1) {
363 369 if (patients.getLastMenses() != null) {
364 370 int week = DateUtil.getWeek2(patients.getLastMenses(), new Date());
365 371 if (week > 20) {//不能做产前筛查追访,显示产前检查追访
... ... @@ -386,7 +392,7 @@
386 392 downRecordQuery.setTrackTypes(Arrays.asList(TrackDownDateEnums.C.getId(), TrackDownDateEnums.H.getId()));
387 393  
388 394 List<TrackDownRecord> records = trackDownRecordService.queryTrackDown(downRecordQuery);
389   - System.out.println("开始处理孕周大于20周自动进入产检追访:"+records.size());
  395 + System.out.println("开始处理孕周大于20周自动进入产检追访:" + records.size());
390 396 for (TrackDownRecord tr : records) {
391 397 Patients patients = iPatientDao.getPatient(tr.getParentId());
392 398 if (patients == null || tr == null) {
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java View file @ bea35a6
... ... @@ -12,7 +12,7 @@
12 12 import java.util.Objects;
13 13  
14 14  
15   -@Document(collection="lyms_patient")
  15 +@Document(collection = "lyms_patient")
16 16 public class Patients extends BaseModel {
17 17  
18 18 private static final long serialVersionUID = SerialIdEnum.Patients.getCid();
... ... @@ -127,7 +127,7 @@
127 127 private String hstreetRegisterId;
128 128 /******add by lqy end *********/
129 129 /**
130   - *孕妇户籍地址
  130 + * 孕妇户籍地址
131 131 */
132 132 private String address;
133 133 private String provinceId;
... ... @@ -151,7 +151,7 @@
151 151 private Integer dueStatus;
152 152  
153 153 //建档类型 0 未分娩建档 1儿童建档时建档 2 自动分娩类型 3 转诊自动建档
154   - private Integer buildType;
  154 + private Integer buildType;
155 155  
156 156 /**
157 157 * 产后休养地
158 158  
... ... @@ -295,10 +295,35 @@
295 295 //辅助建档医生id
296 296 private String assistUserId;
297 297  
298   -
299 298 //乡镇卫生机构id
300 299 private String townOrgId;
301 300  
  301 + /**
  302 + * 孕妇追访字段冗余
  303 + */
  304 + //预约时间
  305 + private Date followupTime;
  306 +
  307 + //流程是否终止
  308 + private String stop;
  309 +
  310 +
  311 + public Date getFollowupTime() {
  312 + return followupTime;
  313 + }
  314 +
  315 + public void setFollowupTime(Date followupTime) {
  316 + this.followupTime = followupTime;
  317 + }
  318 +
  319 + public String getStop() {
  320 + return stop;
  321 + }
  322 +
  323 + public void setStop(String stop) {
  324 + this.stop = stop;
  325 + }
  326 +
302 327 public String getTownOrgId() {
303 328 return townOrgId;
304 329 }
... ... @@ -626,6 +651,7 @@
626 651 public void setRiskLevelId(String riskLevelId) {
627 652 this.riskLevelId = riskLevelId;
628 653 }
  654 +
629 655 public String getAddressPostRest() {
630 656 return addressPostRest;
631 657 }
... ... @@ -657,6 +683,7 @@
657 683 public void setAreaPostRestId(String areaPostRestId) {
658 684 this.areaPostRestId = areaPostRestId;
659 685 }
  686 +
660 687 public Integer getRiskScore() {
661 688 return riskScore;
662 689 }
... ... @@ -752,6 +779,7 @@
752 779 public void setAreaRegisterId(String areaRegisterId) {
753 780 this.areaRegisterId = areaRegisterId;
754 781 }
  782 +
755 783 public Integer getLastReportId() {
756 784 return lastReportId;
757 785 }
platform-dal/src/main/java/com/lyms/platform/pojo/TrackDownRecord.java View file @ bea35a6
... ... @@ -20,7 +20,7 @@
20 20 * @since BME V100R001C40B104
21 21 */
22 22 @Document(collection = "lyms_trackdown_record")
23   -public class TrackDownRecord extends BaseModel{
  23 +public class TrackDownRecord extends BaseModel {
24 24  
25 25 private String id;
26 26 private String username;
... ... @@ -51,6 +51,40 @@
51 51 private Integer status;
52 52 //数据所在的列表
53 53 private Integer trackType;
  54 +
  55 +
  56 + //预约追访日期
  57 + private Date appointmentDate;
  58 +
  59 + //追访日期
  60 + private Date trackDownDate;
  61 +
  62 + //是否终止流程
  63 + private String stop;
  64 +
  65 + public String getStop() {
  66 + return stop;
  67 + }
  68 +
  69 + public void setStop(String stop) {
  70 + this.stop = stop;
  71 + }
  72 +
  73 + public Date getAppointmentDate() {
  74 + return appointmentDate;
  75 + }
  76 +
  77 + public void setAppointmentDate(Date appointmentDate) {
  78 + this.appointmentDate = appointmentDate;
  79 + }
  80 +
  81 + public Date getTrackDownDate() {
  82 + return trackDownDate;
  83 + }
  84 +
  85 + public void setTrackDownDate(Date trackDownDate) {
  86 + this.trackDownDate = trackDownDate;
  87 + }
54 88  
55 89 public String getSex() {
56 90 return sex;
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ bea35a6
... ... @@ -336,6 +336,31 @@
336 336 private Date endAge;
337 337  
338 338  
  339 + /**
  340 + * 孕妇追访字段冗余
  341 + * 0 代表正常 1 待追访 2.已终止
  342 + */
  343 + private Integer followupStatus;
  344 +
  345 + //是否分娩
  346 + private Boolean isDeliver;
  347 +
  348 + public Boolean isDeliver() {
  349 + return isDeliver;
  350 + }
  351 +
  352 + public void setDeliver(Boolean deliver) {
  353 + isDeliver = deliver;
  354 + }
  355 +
  356 + public Integer getFollowupStatus() {
  357 + return followupStatus;
  358 + }
  359 +
  360 + public void setFollowupStatus(Integer followupStatus) {
  361 + this.followupStatus = followupStatus;
  362 + }
  363 +
339 364 public Date getStartAge() {
340 365 return startAge;
341 366 }
... ... @@ -378,6 +403,19 @@
378 403 }
379 404 if (null != serviceTypeIsExist) {
380 405 condition = condition.and("serviceType", serviceTypeIsExist, MongoOper.EXISTS);
  406 + }
  407 + if (null != isDeliver) {
  408 + condition = condition.and("fmDate", isDeliver, MongoOper.EXISTS);
  409 + }
  410 +
  411 + if (null != followupStatus) {
  412 + if (0 == followupStatus) {
  413 + condition = condition.and("followupTime", new Date(), MongoOper.GTE);
  414 + } else if (1 == followupStatus) {
  415 + condition = condition.and("followupTime", new Date(), MongoOper.LTE);
  416 + } else if (2 == followupStatus) {
  417 + condition = condition.and("stop", "1", MongoOper.IS);
  418 + }
381 419 }
382 420  
383 421 if (null != townOrgId) {
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java View file @ bea35a6
... ... @@ -174,16 +174,14 @@
174 174 condition = condition.and("pregnantBuild", pregnantBuild, MongoOper.IS);
175 175 }
176 176 if (null != followupStatus) {
177   - if (followupStatus == 1) {
  177 + if (followupStatus == 0) {
  178 + condition = condition.and("followupTime", new Date(), MongoOper.GTE);
  179 + } else if (followupStatus == 1) {
178 180 condition = condition.and("followupTime", new Date(), MongoOper.LTE);
179 181 } else if (followupStatus == 2) {
180   - condition = condition.and("followupTime", new Date(), MongoOper.GTE);
181   - } else if (followupStatus == 3) {
182 182 condition = condition.and("stop", "1", MongoOper.IS);
183 183 }
184 184 }
185   -
186   -
187 185 if (StringUtils.isNotBlank(username)) {
188 186 condition = condition.and("username", username, MongoOper.LIKE);
189 187 }
platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java View file @ bea35a6
... ... @@ -53,6 +53,108 @@
53 53 */
54 54 private Date lastMensesEnd;
55 55  
  56 + //妇女建档开始日期
  57 + private Date foundStart;
  58 +
  59 + //妇女建档结束日期
  60 + private Date foundEnd;
  61 +
  62 +
  63 + //预约开始追访日期
  64 + private Date appointmentDateStart;
  65 +
  66 + //预约结束追访日期
  67 + private Date appointmentDateEnd;
  68 +
  69 +
  70 + //追访状态 0 正常 1. 待追访 2.已终止
  71 + private Integer followupStatus;
  72 +
  73 + //开始追访日期
  74 + private Date trackDownDateStart;
  75 +
  76 + //结束追访日期
  77 + private Date trackDownDateEnd;
  78 +
  79 + //起始逾期时间
  80 + private Date startBeOverdueDays;
  81 +
  82 + //结束逾期时间
  83 + private Date endBeOverdueDays;
  84 +
  85 +
  86 + public Date getStartBeOverdueDays() {
  87 + return startBeOverdueDays;
  88 + }
  89 +
  90 + public void setStartBeOverdueDays(Date startBeOverdueDays) {
  91 + this.startBeOverdueDays = startBeOverdueDays;
  92 + }
  93 +
  94 + public Date getEndBeOverdueDays() {
  95 + return endBeOverdueDays;
  96 + }
  97 +
  98 + public void setEndBeOverdueDays(Date endBeOverdueDays) {
  99 + this.endBeOverdueDays = endBeOverdueDays;
  100 + }
  101 +
  102 + public Date getTrackDownDateStart() {
  103 + return trackDownDateStart;
  104 + }
  105 +
  106 + public void setTrackDownDateStart(Date trackDownDateStart) {
  107 + this.trackDownDateStart = trackDownDateStart;
  108 + }
  109 +
  110 + public Date getTrackDownDateEnd() {
  111 + return trackDownDateEnd;
  112 + }
  113 +
  114 + public void setTrackDownDateEnd(Date trackDownDateEnd) {
  115 + this.trackDownDateEnd = trackDownDateEnd;
  116 + }
  117 +
  118 + public Integer getFollowupStatus() {
  119 + return followupStatus;
  120 + }
  121 +
  122 + public void setFollowupStatus(Integer followupStatus) {
  123 + this.followupStatus = followupStatus;
  124 + }
  125 +
  126 + public Date getAppointmentDateStart() {
  127 + return appointmentDateStart;
  128 + }
  129 +
  130 + public void setAppointmentDateStart(Date appointmentDateStart) {
  131 + this.appointmentDateStart = appointmentDateStart;
  132 + }
  133 +
  134 + public Date getAppointmentDateEnd() {
  135 + return appointmentDateEnd;
  136 + }
  137 +
  138 + public void setAppointmentDateEnd(Date appointmentDateEnd) {
  139 + this.appointmentDateEnd = appointmentDateEnd;
  140 + }
  141 +
  142 + public Date getFoundStart() {
  143 + return foundStart;
  144 + }
  145 +
  146 + public void setFoundStart(Date foundStart) {
  147 + this.foundStart = foundStart;
  148 + }
  149 +
  150 + public Date getFoundEnd() {
  151 + return foundEnd;
  152 + }
  153 +
  154 + public void setFoundEnd(Date foundEnd) {
  155 + this.foundEnd = foundEnd;
  156 + }
  157 +
56 158 public List<String> getParentIds() {
57 159 return parentIds;
58 160 }
... ... @@ -209,8 +311,8 @@
209 311 public MongoQuery convertToQuery() {
210 312 MongoCondition condition = MongoCondition.newInstance();
211 313  
212   - if (status!=null) {
213   - if(status!=3){//查询全部
  314 + if (status != null) {
  315 + if (status != 3) {//查询全部
214 316 condition = condition.and("status", status, MongoOper.IS);
215 317 }
216 318 } else {
217 319  
... ... @@ -262,14 +364,22 @@
262 364 condition = condition.and("parentId", parentId, MongoOper.IS);
263 365 }
264 366  
265   - if (null!=parentIds) {
  367 + if (null != parentIds) {
266 368 condition = condition.and("parentId", parentIds, MongoOper.IN);
267 369 }
268 370  
269 371 if (null != pids) {
270 372 condition = condition.and("pid", pids, MongoOper.IN);
271 373 }
272   -
  374 + if (null != followupStatus) {
  375 + if (followupStatus == 0) {
  376 + condition = condition.and("appointmentDate", new Date(), MongoOper.GTE);
  377 + } else if (followupStatus == 1) {
  378 + condition = condition.and("appointmentDate", new Date(), MongoOper.LTE);
  379 + } else if (followupStatus == 2) {
  380 + condition = condition.and("stop", "1", MongoOper.IS);
  381 + }
  382 + }
273 383 Criteria c1 = null;
274 384  
275 385 if (StringUtils.isNotEmpty(key)) {
... ... @@ -298,6 +408,68 @@
298 408 c1 = Criteria.where("lastMenses").lte(lastMensesEnd);
299 409 }
300 410 }
  411 +
  412 + if (null != foundStart) {
  413 + if (null != c1) {
  414 + c1 = c1.and("created").gte(foundStart);
  415 + } else {
  416 + c1 = Criteria.where("created").gte(foundStart);
  417 + }
  418 + }
  419 + if (null != foundEnd) {
  420 + if (c1 != null) {
  421 + c1 = c1.lte(foundEnd);
  422 + } else {
  423 + c1 = Criteria.where("created").lte(foundEnd);
  424 + }
  425 + }
  426 +
  427 + if (null != appointmentDateStart) {
  428 + if (null != c1) {
  429 + c1 = c1.and("appointmentDate").gte(appointmentDateStart);
  430 + } else {
  431 + c1 = Criteria.where("appointmentDate").gte(appointmentDateStart);
  432 + }
  433 + }
  434 + if (null != appointmentDateEnd) {
  435 + if (c1 != null) {
  436 + c1 = c1.lte(appointmentDateEnd);
  437 + } else {
  438 + c1 = Criteria.where("appointmentDate").lte(appointmentDateEnd);
  439 + }
  440 + }
  441 +
  442 + if (null != trackDownDateStart) {
  443 + if (null != c1) {
  444 + c1 = c1.and("trackDownDate").gte(trackDownDateStart);
  445 + } else {
  446 + c1 = Criteria.where("trackDownDate").gte(trackDownDateStart);
  447 + }
  448 + }
  449 + if (null != trackDownDateEnd) {
  450 + if (c1 != null) {
  451 + c1 = c1.lte(trackDownDateEnd);
  452 + } else {
  453 + c1 = Criteria.where("trackDownDate").lte(trackDownDateEnd);
  454 + }
  455 + }
  456 +
  457 +
  458 + if (null != startBeOverdueDays) {
  459 + if (null != c1) {
  460 + c1 = c1.and("appointmentDate").gte(startBeOverdueDays);
  461 + } else {
  462 + c1 = Criteria.where("appointmentDate").gte(startBeOverdueDays);
  463 + }
  464 + }
  465 + if (null != endBeOverdueDays) {
  466 + if (c1 != null) {
  467 + c1 = c1.lte(endBeOverdueDays);
  468 + } else {
  469 + c1 = Criteria.where("appointmentDate").lte(endBeOverdueDays);
  470 + }
  471 + }
  472 +
301 473 if (null != c1) {
302 474 condition = condition.andCondition(new MongoCondition(c1));
303 475 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TrackDownController.java View file @ bea35a6
... ... @@ -4,6 +4,7 @@
4 4 import com.lyms.platform.common.annotation.TokenRequired;
5 5 import com.lyms.platform.common.base.BaseController;
6 6 import com.lyms.platform.common.result.BaseResponse;
  7 +import com.lyms.platform.common.utils.DateUtil;
7 8 import com.lyms.platform.operate.web.facade.TrackDownFacade;
8 9 import com.lyms.platform.operate.web.facade.TrackDownJobFacade;
9 10 import com.lyms.platform.operate.web.request.TrackDownQueryRequest;
10 11  
... ... @@ -86,9 +87,9 @@
86 87 @RequestMapping(value = "/all", method = RequestMethod.GET)
87 88 public BaseResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key, Integer type,
88 89 @RequestParam Integer page, @RequestParam Integer limit, HttpServletRequest request,
89   - Integer check, String checkup, String pregnantBuild, Integer followupStatus) {
  90 + Integer check, String checkup, String pregnantBuild, Integer followupStatus, boolean isDeliver) {
90 91 return trackDownService.all(buildStart, buildEnd, checkStart, checkEnd, fmStart, fmEnd, key,
91   - page, limit, getUserId(request), type, check, checkup, pregnantBuild, followupStatus);
  92 + page, limit, getUserId(request), type, check, checkup, pregnantBuild, followupStatus, isDeliver);
92 93 }
93 94  
94 95 @ResponseBody
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java View file @ bea35a6
... ... @@ -441,8 +441,6 @@
441 441  
442 442 trackDownService.addOrupdateTrackDownRecord(userId, trackDownRecord);
443 443 }
444   -
445   -
446 444 /**
447 445 * 通过ID查看居民建档详情
448 446 * @param id
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java View file @ bea35a6
... ... @@ -375,6 +375,40 @@
375 375 downRecordQuery.setCityId(downQueryRequest.getCityId());
376 376 downRecordQuery.setStreetId(downQueryRequest.getStreetId());
377 377 downRecordQuery.setKey(downQueryRequest.getKey());
  378 + /**
  379 + * 孕妇追访功能新增搜索条件20190709
  380 + * */
  381 + downRecordQuery.setFoundStart(downQueryRequest.getFoundDateStart());
  382 + downRecordQuery.setFoundEnd(downQueryRequest.getFoundDateEnd());
  383 +
  384 + downRecordQuery.setAppointmentDateStart(downQueryRequest.getAppointmentDateStart());
  385 + downRecordQuery.setAppointmentDateEnd(downQueryRequest.getAppointmentDateEnd());
  386 +
  387 + downRecordQuery.setFollowupStatus(downQueryRequest.getFollowupStatus());
  388 +
  389 + if (null != downQueryRequest.getBeOverdueDays()) {
  390 + Calendar instance = Calendar.getInstance();
  391 + instance.setTime(new Date());
  392 + instance.add(Calendar.DATE, -downQueryRequest.getBeOverdueDays());
  393 + instance.set(Calendar.HOUR_OF_DAY, 23);
  394 + instance.set(Calendar.MINUTE, 59);
  395 + instance.set(Calendar.SECOND, 59);
  396 + instance.set(Calendar.MILLISECOND, 999);
  397 + Date end = instance.getTime();
  398 + downRecordQuery.setEndBeOverdueDays(end);
  399 +
  400 + instance.setTime(new Date());
  401 + instance.add(Calendar.DATE, -downQueryRequest.getBeOverdueDays());
  402 + instance.set(Calendar.HOUR_OF_DAY, 00);
  403 + instance.set(Calendar.MINUTE, 00);
  404 + instance.set(Calendar.SECOND, 00);
  405 + instance.set(Calendar.MILLISECOND, 000);
  406 + Date start = instance.getTime();
  407 + downRecordQuery.setStartBeOverdueDays(start);
  408 +
  409 + }
  410 +
  411 +
378 412 //产检和产后数据特殊处理
379 413 if (null != downQueryRequest.getTrackType() && TrackDownDateEnums.C.getId() == downQueryRequest.getTrackType()) {
380 414 downRecordQuery.setTrackTypes(Arrays.asList(3, 9));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ResidentsArchiveAddRequest.java View file @ bea35a6
... ... @@ -12,9 +12,8 @@
12 12 import java.util.Map;
13 13  
14 14 /**
15   - *
16   - * 居民建档请求数据
17   - *
  15 + * 居民建档请求数据
  16 + * <p>
18 17 * Created by Administrator on 2016/11/14 0014.
19 18 */
20 19 @Form
... ... @@ -128,7 +127,7 @@
128 127 private String mcyj;//末次月经时间
129 128 private String isOrNotGl;//月经周期是否规律(0:否;1:是;默认为1)
130 129 private String jq;//经期
131   - private String zq;//周期
  130 + private String zq;//周期
132 131 private String yjl;//月经量(0:多;1:中;2:少;默认为1)
133 132 private String tj;//痛经(0:无;1:轻;2:重;默认为1)
134 133 private String isOrNotHy;//是否曾经怀孕(0:无;1:有;默认为0)
... ... @@ -146,6 +145,7 @@
146 145 private String xyzns;//现有子女数
147 146 private String znstzk;//子女身体状况(0:健康;1:疾病)
148 147 private String jtbm;//注明具体病名
  148 +
149 149 /***********荣成新增女性建档字段**********/
150 150  
151 151  
152 152  
153 153  
154 154  
155 155  
... ... @@ -186,19 +186,19 @@
186 186 model.setStreetRegisterId(streetRegisterId);
187 187 model.setAddressRegister(addressRegister);
188 188  
189   - if (pastHistory!=null){
  189 + if (pastHistory != null) {
190 190 model.setPastHistory(JsonUtil.obj2JsonString(pastHistory));
191 191 }
192   - if (familyHistory!=null){
  192 + if (familyHistory != null) {
193 193 model.setFamilyHistory(JsonUtil.obj2JsonString(familyHistory));
194 194 }
195   - if (personalHistory!=null){
  195 + if (personalHistory != null) {
196 196 model.setPersonalHistory(JsonUtil.obj2JsonString(personalHistory));
197 197 }
198   - if (ywgmHistory!=null){
  198 + if (ywgmHistory != null) {
199 199 model.setYwgmHistory(JsonUtil.obj2JsonString(ywgmHistory));
200 200 }
201   - if (presentHistory!=null){
  201 + if (presentHistory != null) {
202 202 model.setPresentHistory(JsonUtil.obj2JsonString(presentHistory));
203 203 }
204 204 model.setVcCardNo(vcCardNo);
... ... @@ -238,7 +238,8 @@
238 238 model.setXyzns(xyzns);
239 239 model.setZnstzk(znstzk);
240 240 model.setJtbm(jtbm);
241   -
  241 + //追访时间默认为当前建档时间
  242 + model.setFollowupTime(new Date());
242 243 return model;
243 244 }
244 245  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/TrackDownQueryRequest.java View file @ bea35a6
... ... @@ -58,10 +58,73 @@
58 58 private Integer endBeOverdue;
59 59 //流程状态
60 60 private Integer processState;
61   - //追访方式
62   - private Integer ChaseVisitMode;
63 61  
  62 + //妇女建档开始日期
  63 + private Date foundDateStart;
  64 + //结束日期
  65 + private Date foundDateEnd;
64 66  
  67 + //预约开始追访日期
  68 + private Date appointmentDateStart;
  69 +
  70 + //预约结束追访日期
  71 + private Date appointmentDateEnd;
  72 +
  73 + //追访状态 0 正常 1. 待追访 2.已终止
  74 + private Integer followupStatus;
  75 +
  76 + //起始逾期天数
  77 + private Integer beOverdueDays;
  78 +
  79 +
  80 + public Integer getBeOverdueDays() {
  81 + return beOverdueDays;
  82 + }
  83 +
  84 + public void setBeOverdueDays(Integer beOverdueDays) {
  85 + this.beOverdueDays = beOverdueDays;
  86 + }
  87 +
  88 + public Integer getFollowupStatus() {
  89 + return followupStatus;
  90 + }
  91 +
  92 + public void setFollowupStatus(Integer followupStatus) {
  93 + this.followupStatus = followupStatus;
  94 + }
  95 +
  96 + public Date getAppointmentDateStart() {
  97 + return appointmentDateStart;
  98 + }
  99 +
  100 + public void setAppointmentDateStart(Date appointmentDateStart) {
  101 + this.appointmentDateStart = appointmentDateStart;
  102 + }
  103 +
  104 + public Date getAppointmentDateEnd() {
  105 + return appointmentDateEnd;
  106 + }
  107 +
  108 + public void setAppointmentDateEnd(Date appointmentDateEnd) {
  109 + this.appointmentDateEnd = appointmentDateEnd;
  110 + }
  111 +
  112 + public Date getFoundDateStart() {
  113 + return foundDateStart;
  114 + }
  115 +
  116 + public void setFoundDateStart(Date foundDateStart) {
  117 + this.foundDateStart = foundDateStart;
  118 + }
  119 +
  120 + public Date getFoundDateEnd() {
  121 + return foundDateEnd;
  122 + }
  123 +
  124 + public void setFoundDateEnd(Date foundDateEnd) {
  125 + this.foundDateEnd = foundDateEnd;
  126 + }
  127 +
65 128 public Date getStartChaseVisit() {
66 129 return startChaseVisit;
67 130 }
... ... @@ -102,13 +165,6 @@
102 165 this.processState = processState;
103 166 }
104 167  
105   - public Integer getChaseVisitMode() {
106   - return ChaseVisitMode;
107   - }
108   -
109   - public void setChaseVisitMode(Integer chaseVisitMode) {
110   - ChaseVisitMode = chaseVisitMode;
111   - }
112 168  
113 169 public String getCheckDoctor() {
114 170 return checkDoctor;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/ITrackDownService.java View file @ bea35a6
... ... @@ -17,7 +17,7 @@
17 17 BaseObjectResponse list(String provinceId, String cityId, String areaId, String streetId, String key, Integer trackType, Integer page, Integer limit, Integer userId);
18 18  
19 19 BaseObjectResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart,
20   - Date fmEnd, String key, Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, Integer followupStatus);
  20 + Date fmEnd, String key, Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, Integer followupStatus, boolean isDeliver);
21 21  
22 22 BaseObjectResponse info(String patientId, Integer trackType, Integer buildType);
23 23  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java View file @ bea35a6
... ... @@ -10,6 +10,7 @@
10 10 import com.lyms.platform.operate.web.utils.MongoUtil;
11 11 import com.lyms.platform.operate.web.utils.ResponseUtil;
12 12 import com.lyms.platform.permission.dao.master.CouponMapper;
  13 +import com.lyms.platform.permission.model.PatientService;
13 14 import com.lyms.platform.pojo.*;
14 15 import com.lyms.platform.query.*;
15 16 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -52,6 +53,9 @@
52 53 @Autowired
53 54 private MatDeliverService matDeliverService;
54 55  
  56 + @Autowired
  57 + private PatientsService patientsService;
  58 +
55 59 /**
56 60 * @param buildStart
57 61 * @param buildEnd
... ... @@ -68,7 +72,7 @@
68 72 */
69 73 @Override
70 74 public BaseObjectResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key,
71   - Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, Integer followupStatus) {
  75 + Integer page, Integer limit, Integer userId, Integer type, Integer check, String checkup, String pregnantBuild, Integer followupStatus, boolean isDeliver) {
72 76 String hospitalId = autoMatchFacade.getHospitalId(userId);
73 77 List<Map<String, Object>> restList = new ArrayList<>();
74 78 Integer archiveModelCount = 0;
... ... @@ -90,6 +94,7 @@
90 94 query.setFollowupStatus(followupStatus);
91 95 //妇女建档主数据
92 96 List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
  97 + System.out.println("---------" + query.convertToQuery().convertToMongoQuery().toString());
93 98 // StopWatch stopWatch = new StopWatch("妇女建档主数据");
94 99 //优化前
95 100 // stopWatch.start("妇女建档优化前");
... ... @@ -110,7 +115,6 @@
110 115 }
111 116 }
112 117 }
113   -
114 118 } else {
115 119 restList = getResidentMainData(modelList);
116 120 }
117 121  
... ... @@ -137,9 +141,11 @@
137 141 patientsQuery.setNeed("need");
138 142 patientsQuery.setLimit(limit);
139 143 patientsQuery.setPage(page);
140   -
141 144 patientsQuery.setHospitalId(hospitalId);
142 145 patientsQuery.setQueryNo(key);
  146 + patientsQuery.setFollowupStatus(followupStatus);
  147 + patientsQuery.setDeliver(isDeliver);
  148 +
143 149 List<Patients> patientsList = patientsService.queryPatient(patientsQuery);
144 150 StopWatch stopWatch = new StopWatch("孕妇建档主数据");
145 151 //优化前
146 152  
... ... @@ -787,28 +793,59 @@
787 793 && TrackDownTransferEnums.B.getId() == trackDown.getTrackDownTransfer()) {//性别男:特殊处理,流转到下一流程时结束流程
788 794 trackDown.setTrackDownTransfer(TrackDownTransferEnums.C.getId());
789 795 }
  796 + /** 孕妇追访功能冗余字段**/
  797 + //获取孕妇建档id
  798 + if (StringUtils.isNotEmpty(trackDownRecord.getParentId())) {
  799 + Patients patients = new Patients();
  800 + if (null != trackDown.getReservatDate()) {
  801 + patients.setFollowupTime(trackDown.getReservatDate());
  802 + } else {
  803 + patients.setFollowupTime(new Date());
  804 + }
  805 + if (1 == trackDown.getTrackDownTransfer() || 2 == trackDown.getTrackDownTransfer()) {
  806 + patients.setStop("0");
  807 + } else if (3 == trackDown.getTrackDownTransfer()) {
  808 + patients.setStop("1");
  809 + }
  810 + patientsService.updatePatientOne(patients, trackDownRecord.getParentId());
  811 + }
  812 + //获取妇女建党id
  813 + if (StringUtils.isNotEmpty(trackDownRecord.getResidentsArchiveId())) {
  814 + ResidentsArchiveModel residentsArchiveModel1 = new ResidentsArchiveModel();
  815 + if (null != trackDown.getReservatDate()) {
  816 + residentsArchiveModel1.setFollowupTime(trackDown.getReservatDate());
  817 + } else {
  818 + residentsArchiveModel1.setFollowupTime(new Date());
  819 + }
  820 + /**冗余 现在处于哪一个流程*/
  821 + if (1 == trackDown.getTrackDownTransfer() || 2 == trackDown.getTrackDownTransfer()) {
  822 + residentsArchiveModel1.setStop("0");
  823 + } else if (3 == trackDown.getTrackDownTransfer()) {
  824 + residentsArchiveModel1.setStop("1");
  825 + }
  826 + residentsArchiveService.updateResident(residentsArchiveModel1, trackDown.getParentId());
  827 + }
  828 + /**冗余到追访记录表*/
  829 + TrackDownRecord trackDownRecord1 = new TrackDownRecord();
  830 + if (null != trackDownRecord.getAppointmentDate() && trackDown.getReservatDate() != null) {
  831 + trackDownRecord1.setAppointmentDate(trackDown.getReservatDate());
  832 + } else {
  833 + trackDownRecord1.setAppointmentDate(new Date());
  834 + }
  835 + if (null != trackDown.getTrackDownDate()) {
  836 + trackDownRecord1.setTrackDownDate(trackDown.getTrackDownDate());
  837 + }
  838 + if (null != trackDownRecord.getStop() && null != trackDown.getTrackDownTransfer()) {
  839 + if (1 == trackDown.getTrackDownTransfer() || 2 == trackDown.getTrackDownTransfer()) {
  840 + trackDownRecord1.setStop("0");
  841 + } else if (3 == trackDown.getTrackDownTransfer()) {
  842 + trackDownRecord1.setStop("1");
  843 + }
  844 + }
  845 + trackDownRecordService.updateTrackDown(trackDownRecord1, trackDownRecord.getId());
790 846 }
791 847 }
792 848 }
793   - /**冗余预约追访日期*/
794   - if (StringUtils.isNotEmpty(trackDown.getParentId()) && StringUtils.isNotEmpty(trackDown.getHospitalId())) {
795   - ResidentsArchiveModel residentsArchiveModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(trackDown.getParentId()).and("hospitalId").is(trackDown.getHospitalId())), ResidentsArchiveModel.class);
796   - if (null != residentsArchiveModel) {
797   - ResidentsArchiveModel residentsArchiveModel1 = new ResidentsArchiveModel();
798   - if (null != residentsArchiveModel.getFollowupTime()) {
799   - residentsArchiveModel1.setFollowupTime(trackDown.getReservatDate());
800   - } else {
801   - residentsArchiveModel1.setFollowupTime(new Date());
802   - }
803   - /**冗余 现在处于哪一个流程*/
804   - if (1 == trackDown.getTrackDownTransfer() || 2 == trackDown.getTrackDownTransfer()) {
805   - residentsArchiveModel1.setStop("0");
806   - } else if (3 == trackDown.getTrackDownTransfer()) {
807   - residentsArchiveModel1.setStop("1");
808   - }
809   - residentsArchiveService.updateResident(residentsArchiveModel1, trackDown.getParentId());
810   - }
811   - }
812 849 trackDown.setId(null);
813 850 trackDown.setYn(YnEnums.YES.getId());
814 851 trackDown.setCreated(new Date());
... ... @@ -816,7 +853,6 @@
816 853 trackDown.setOperaterId(userId);
817 854 trackDown.setModified(new Date());
818 855  
819   -
820 856 trackDownService.add(trackDown);
821 857 String recordId = trackDown.getTrackDownRecId();
822 858 updateRecordStatus(trackDown, recordId);
... ... @@ -845,8 +881,6 @@
845 881  
846 882 @Autowired
847 883 private TrackDownRecordService trackDownRecordService;
848   - @Autowired
849   - private PatientsService patientsService;
850 884  
851 885  
852 886 /**