Commit c570a07277782a9e54b5c1f3265f24fef61b5f58

Authored by liquanyu
1 parent 7e08f7f940

update code

Showing 7 changed files with 109 additions and 3 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java View file @ c570a07
... ... @@ -273,6 +273,17 @@
273 273 // 是否发放过优惠券
274 274 private Boolean isSendCoupon;
275 275  
  276 + //建档天数
  277 + private Integer buildDays;
  278 +
  279 + public Integer getBuildDays() {
  280 + return buildDays;
  281 + }
  282 +
  283 + public void setBuildDays(Integer buildDays) {
  284 + this.buildDays = buildDays;
  285 + }
  286 +
276 287 public Integer getIsAutoFm() {
277 288 return isAutoFm;
278 289 }
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ c570a07
... ... @@ -133,6 +133,25 @@
133 133 private String[] pc;
134 134 private String[] pv;
135 135  
  136 + private Integer buildDaysStart;
  137 + private Integer buildDaysEnd;
  138 +
  139 + public Integer getBuildDaysStart() {
  140 + return buildDaysStart;
  141 + }
  142 +
  143 + public void setBuildDaysStart(Integer buildDaysStart) {
  144 + this.buildDaysStart = buildDaysStart;
  145 + }
  146 +
  147 + public Integer getBuildDaysEnd() {
  148 + return buildDaysEnd;
  149 + }
  150 +
  151 + public void setBuildDaysEnd(Integer buildDaysEnd) {
  152 + this.buildDaysEnd = buildDaysEnd;
  153 + }
  154 +
136 155 public String getoRiskFactor() {
137 156 return oRiskFactor;
138 157 }
... ... @@ -1326,6 +1345,24 @@
1326 1345 c1 = Criteria.where("postViewTimes").lte(postViewTimesEnd);
1327 1346 }
1328 1347 }
  1348 +
  1349 +
  1350 + if (null != buildDaysStart) {
  1351 + if (null != c1) {
  1352 + c1 = c1.and("buildDays").gte(buildDaysStart);
  1353 + } else {
  1354 + c1 = Criteria.where("buildDays").gte(buildDaysStart);
  1355 + }
  1356 + }
  1357 +
  1358 + if (null != buildDaysEnd) {
  1359 + if (null != c1) {
  1360 + c1 = c1.lte(buildDaysEnd);
  1361 + } else {
  1362 + c1 = Criteria.where("buildDays").lte(buildDaysEnd);
  1363 + }
  1364 + }
  1365 +
1329 1366  
1330 1367 if (null != lastRhTimeStart) {
1331 1368 if (null != c1) {
platform-msg-generate/src/main/java/com/lyms/platform/msg/remote/SaveMessageService.java View file @ c570a07
... ... @@ -93,7 +93,7 @@
93 93 }
94 94 }
95 95 } catch (Exception e) {
96   - logger.error("get msg is exist error",e);
  96 + logger.error("get msg is exist error,url="+ConfigInterface.MSG_BASE_URL + "/biz-push-web/push",e);
97 97 }
98 98 return false;
99 99 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ c570a07
... ... @@ -367,7 +367,7 @@
367 367 List<PostReviewModel> postReviewModels = postReviewService.findWithList(postReviewQuery);
368 368 if (CollectionUtils.isNotEmpty(postReviewModels))
369 369 {
370   - System.out.println("postReviewModels="+postReviewModels.size()+";patientid="+pat.getId());
  370 + System.out.println("postReviewModels=" + postReviewModels.size() + ";patientid=" + pat.getId());
371 371 for(PostReviewModel postReviewModel : postReviewModels)
372 372 {
373 373 Patients patients = patientsService.findOnePatientById(postReviewModel.getParentId());
... ... @@ -381,6 +381,33 @@
381 381 }
382 382 }
383 383 return "updatePostViewTimes finish";
  384 + }
  385 +
  386 +
  387 + /**
  388 + * 建档天数计算
  389 + * @param hospitalId
  390 + * @return
  391 + */
  392 + @RequestMapping(value = "/updatePatBuildDays", method = RequestMethod.GET)
  393 + @ResponseBody
  394 + public String updatePatBuildDays(@RequestParam(required = true) String hospitalId) {
  395 + PatientsQuery patientsQuery1 = new PatientsQuery();
  396 + patientsQuery1.setYn(YnEnums.YES.getId());
  397 + patientsQuery1.setHospitalId(hospitalId);
  398 + List<Patients> pats = patientsService.queryPatient(patientsQuery1);
  399 + System.out.println("main="+pats.size());
  400 + if (CollectionUtils.isNotEmpty(pats)) {
  401 + for (Patients pat : pats) {
  402 + if (StringUtils.isNotEmpty(pat.getPid()))
  403 + {
  404 + pat.setBuildDays(DateUtil.getDays(pat.getLastMenses(), new Date()));
  405 + patientsService.updatePatient(pat);
  406 + }
  407 +
  408 + }
  409 + }
  410 + return "updatePatBuildDays finish";
384 411 }
385 412  
386 413  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ c570a07
... ... @@ -1074,7 +1074,7 @@
1074 1074 */
1075 1075 public Patients getPatientsData(YunBookbuildingAddRequest yunRequest) {
1076 1076 Patients patient = new Patients();
1077   -
  1077 + patient.setBuildDays(DateUtil.getDays(DateUtil.parseYMD(yunRequest.getLastMenstrualPeriod()), new Date()));
1078 1078 patient.setMensStartDay(yunRequest.getMensStartDay());
1079 1079  
1080 1080 patient.setMensEndDay(yunRequest.getMensEndDay());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ c570a07
... ... @@ -931,6 +931,17 @@
931 931 PatientManagerResult patientManagerResult = new PatientManagerResult();
932 932  
933 933 PatientsQuery patientsQuery = new PatientsQuery();
  934 +
  935 + if (patientManagerRequest.getBuildWeekStart() != null)
  936 + {
  937 + patientsQuery.setBuildDaysStart(patientManagerRequest.getBuildWeekStart()*7);
  938 + }
  939 +
  940 + if (patientManagerRequest.getBuildWeekEnd() != null)
  941 + {
  942 + patientsQuery.setBuildDaysEnd((patientManagerRequest.getBuildWeekEnd()+1) * 7 - 1);
  943 + }
  944 +
934 945 patientsQuery.setYn(YnEnums.YES.getId());
935 946 if (!patientManagerRequest.isExcel()) {
936 947 patientsQuery.setNeed("need");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PatientManagerRequest.java View file @ c570a07
... ... @@ -68,6 +68,26 @@
68 68  
69 69 private boolean isExcel;
70 70  
  71 + //建档孕周
  72 + private Integer buildWeekStart;
  73 + private Integer buildWeekEnd;
  74 +
  75 + public Integer getBuildWeekStart() {
  76 + return buildWeekStart;
  77 + }
  78 +
  79 + public void setBuildWeekStart(Integer buildWeekStart) {
  80 + this.buildWeekStart = buildWeekStart;
  81 + }
  82 +
  83 + public Integer getBuildWeekEnd() {
  84 + return buildWeekEnd;
  85 + }
  86 +
  87 + public void setBuildWeekEnd(Integer buildWeekEnd) {
  88 + this.buildWeekEnd = buildWeekEnd;
  89 + }
  90 +
71 91 public String getStreetRegisterId() {
72 92 return streetRegisterId;
73 93 }