Commit cbde2fae69861ec686e1a99feec9bb73e16bfcc5
1 parent
4866018724
Exists in
master
and in
6 other branches
bug修改
Showing 7 changed files with 63 additions and 51 deletions
- platform-common/src/main/java/com/lyms/platform/common/dao/operator/MongoOper.java
- platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-common/src/main/java/com/lyms/platform/common/dao/operator/MongoOper.java
View file @
cbde2fa
| 1 | 1 | package com.lyms.platform.common.dao.operator; |
| 2 | + | |
| 2 | 3 | /** |
| 3 | 4 | * 查询的操作符 |
| 4 | - * | |
| 5 | - * @author Administrator | |
| 6 | 5 | * |
| 6 | + * @author Administrator | |
| 7 | 7 | */ |
| 8 | 8 | public enum MongoOper { |
| 9 | - // 等于 | |
| 10 | - IS, | |
| 11 | - // 小于 | |
| 12 | - LT, | |
| 13 | - // 小于等于 | |
| 14 | - LTE, | |
| 15 | - // 大于 | |
| 16 | - GT, | |
| 17 | - // 大于等于 | |
| 18 | - GTE, | |
| 19 | - //不等于 | |
| 20 | - NE, | |
| 21 | - //模糊 | |
| 22 | - LIKE, | |
| 23 | - ALL, | |
| 24 | - //是否存在 | |
| 25 | - EXISTS, | |
| 26 | - NIN, | |
| 27 | - IN; | |
| 9 | + // 等于 | |
| 10 | + IS, | |
| 11 | + // 小于 | |
| 12 | + LT, | |
| 13 | + // 小于等于 | |
| 14 | + LTE, | |
| 15 | + // 大于 | |
| 16 | + GT, | |
| 17 | + // 大于等于 | |
| 18 | + GTE, | |
| 19 | + //不等于 | |
| 20 | + NE, | |
| 21 | + //模糊 | |
| 22 | + LIKE, | |
| 23 | + ALL, | |
| 24 | + //是否存在 | |
| 25 | + EXISTS, | |
| 26 | + NIN, | |
| 27 | + IN; | |
| 28 | 28 | } |
platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
View file @
cbde2fa
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | +import com.lyms.platform.common.utils.DateUtil; | |
| 8 | 9 | import com.lyms.platform.common.utils.StringUtils; |
| 9 | 10 | import org.springframework.data.mongodb.core.query.Criteria; |
| 10 | 11 | |
| 11 | 12 | |
| ... | ... | @@ -373,9 +374,9 @@ |
| 373 | 374 | } |
| 374 | 375 | if (null != followupStatus) { |
| 375 | 376 | if (followupStatus == 0) { |
| 376 | - condition = condition.and("appointmentDate", new Date(), MongoOper.GTE); | |
| 377 | + condition = condition.and("appointmentDate", new Date(), MongoOper.GT); | |
| 377 | 378 | } else if (followupStatus == 1) { |
| 378 | - condition = condition.and("appointmentDate", new Date(), MongoOper.LTE); | |
| 379 | + condition = condition.and("appointmentDate", new Date(), MongoOper.LT); | |
| 379 | 380 | } else if (followupStatus == 2) { |
| 380 | 381 | condition = condition.and("stop", "1", MongoOper.IS); |
| 381 | 382 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java
View file @
cbde2fa
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | @ResponseBody |
| 34 | 34 | @RequestMapping(method = RequestMethod.POST) |
| 35 | 35 | @TokenRequired |
| 36 | - public BaseResponse addOrUpdate(@RequestParam(value = "doctorId", required = false) String doctorId, PatientWeight patientWeight, HttpServletRequest request) { | |
| 36 | + public BaseResponse addOrUpdate(@RequestParam(value = "doctorId", required = false) String doctorId, PatientWeight patientWeight, HttpServletRequest request) { | |
| 37 | 37 | return patientWeightService.addOrUpdate(getUserId(request), patientWeight, doctorId); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| ... | ... | @@ -93,10 +93,12 @@ |
| 93 | 93 | @TokenRequired |
| 94 | 94 | public BaseResponse report(@PathVariable String id, |
| 95 | 95 | HttpServletRequest request, |
| 96 | - @RequestParam(value = "rid", required = false) String rid) { | |
| 97 | - return patientWeightService.report(id, getUserId(request), rid); | |
| 96 | + @RequestParam(value = "rid", required = false) String rid, | |
| 97 | + String version) { | |
| 98 | + return patientWeightService.report(id, getUserId(request), rid, version); | |
| 98 | 99 | } |
| 99 | 100 | |
| 101 | + | |
| 100 | 102 | /** |
| 101 | 103 | * 体重报告(小程序和app使用) |
| 102 | 104 | */ |
| 103 | 105 | |
| ... | ... | @@ -261,11 +263,11 @@ |
| 261 | 263 | @TokenRequired |
| 262 | 264 | public BaseResponse getWeightsReport(@PathVariable String pid, |
| 263 | 265 | HttpServletRequest request, |
| 264 | - @RequestParam(value = "rid", required = false) String rid) { | |
| 266 | + @RequestParam(value = "rid", required = false) String rid, String version) { | |
| 265 | 267 | if (pid.isEmpty() || "null".equals(pid)) { |
| 266 | 268 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.USER_PASSWORD_ERROR).setErrormsg("pid值不能为空!"); |
| 267 | 269 | } |
| 268 | - return patientWeightService.getWeightsReport(pid, getUserId(request), rid); | |
| 270 | + return patientWeightService.getWeightsReport(pid, getUserId(request), rid, version); | |
| 269 | 271 | } |
| 270 | 272 | |
| 271 | 273 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
cbde2fa
| ... | ... | @@ -955,7 +955,8 @@ |
| 955 | 955 | |
| 956 | 956 | Patients patients = patientsService.findOnePatientById(nutritionInfoRequest.getPatientId()); |
| 957 | 957 | List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("patientId").is(nutritionInfoRequest.getPatientId()))); |
| 958 | - String hospitalId = nutritionInfoRequest.getHospitalId(); | |
| 958 | + String hospitalId = nutritionInfoRequest.getHospitalId().trim(); | |
| 959 | + | |
| 959 | 960 | |
| 960 | 961 | Map<String, String> dayWeights = new LinkedHashMap<>(); |
| 961 | 962 | List<Map<String, Object>> dayWeights2 = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
View file @
cbde2fa
| ... | ... | @@ -471,6 +471,8 @@ |
| 471 | 471 | downRecordQuery.setNeed("1"); |
| 472 | 472 | // downRecordQuery.setSort("modified desc"); |
| 473 | 473 | downRecordQuery.setHospitalId(hospitalId); |
| 474 | + System.out.println("====>" + downRecordQuery.convertToQuery().convertToMongoQuery()); | |
| 475 | + | |
| 474 | 476 | return downRecordQuery; |
| 475 | 477 | } |
| 476 | 478 | |
| ... | ... | @@ -920,7 +922,7 @@ |
| 920 | 922 | } else { |
| 921 | 923 | temp.put("result", "--"); // 婚检追访结果 |
| 922 | 924 | temp.put("trackDownTime", "--"); // 追访时间 |
| 923 | - temp.put("yyzfTime", "--"); // 预约预约时间 | |
| 925 | + temp.put("yyzfTime", downRecord == null ? "--" : DateUtil.getyyyy_MM_dd(downRecord.getAppointmentDate())); // 预约预约时间 | |
| 924 | 926 | } |
| 925 | 927 | |
| 926 | 928 | //如果是产前检查取预约结果 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java
View file @
cbde2fa
| ... | ... | @@ -33,8 +33,9 @@ |
| 33 | 33 | |
| 34 | 34 | BaseResponse delete(String id); |
| 35 | 35 | |
| 36 | - BaseResponse report(String id, Integer userId, String rid); | |
| 36 | + BaseResponse report(String id, Integer userId, String rid, String version); | |
| 37 | 37 | |
| 38 | + | |
| 38 | 39 | BaseResponse wxReport(String pid); |
| 39 | 40 | |
| 40 | 41 | BaseResponse wxAddOrUpdate(PatientWeight patientWeight); |
| ... | ... | @@ -57,7 +58,7 @@ |
| 57 | 58 | |
| 58 | 59 | public void getSeries(Map<String, Object> series, String bmiStr, String bregmatic); |
| 59 | 60 | |
| 60 | - BaseResponse getWeightsReport(String pid, Integer userId, String rid); | |
| 61 | + BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version); | |
| 61 | 62 | |
| 62 | 63 | public void setReport(Map<String, Object> restMap, Map<Integer, String> weights, String beforeWeight, |
| 63 | 64 | String bmi, Map<String, String> dayWeights, String bregmatic); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
cbde2fa
| ... | ... | @@ -16,19 +16,19 @@ |
| 16 | 16 | import com.lyms.platform.operate.web.utils.MongoUtil; |
| 17 | 17 | import com.lyms.platform.operate.web.utils.ReportConfig; |
| 18 | 18 | import com.lyms.platform.permission.dao.master.CouponMapper; |
| 19 | -import com.lyms.platform.permission.model.*; | |
| 20 | -import com.lyms.platform.permission.service.DepartmentsService; | |
| 19 | +import com.lyms.platform.permission.model.Organization; | |
| 20 | +import com.lyms.platform.permission.model.PatientService; | |
| 21 | +import com.lyms.platform.permission.model.PatientServiceQuery; | |
| 22 | +import com.lyms.platform.permission.model.Users; | |
| 21 | 23 | import com.lyms.platform.permission.service.OrganizationService; |
| 22 | 24 | import com.lyms.platform.permission.service.PatientServiceService; |
| 23 | 25 | import com.lyms.platform.permission.service.UsersService; |
| 24 | 26 | import com.lyms.platform.pojo.*; |
| 25 | 27 | import com.lyms.platform.query.PatientsQuery; |
| 26 | -import com.lyms.platform.query.SmsConfigQuery; | |
| 27 | 28 | import net.sf.json.JSONArray; |
| 28 | 29 | import net.sf.json.JSONObject; |
| 29 | 30 | import org.apache.commons.collections.MapUtils; |
| 30 | 31 | import org.apache.commons.lang.StringUtils; |
| 31 | -import org.omg.CORBA.StringHolder; | |
| 32 | 32 | import org.springframework.beans.factory.annotation.Autowired; |
| 33 | 33 | import org.springframework.data.domain.Sort; |
| 34 | 34 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 35 | 35 | |
| ... | ... | @@ -36,10 +36,7 @@ |
| 36 | 36 | import org.springframework.data.mongodb.core.query.Query; |
| 37 | 37 | import org.springframework.data.mongodb.core.query.Update; |
| 38 | 38 | import org.springframework.stereotype.Service; |
| 39 | -import scala.Int; | |
| 40 | -import scala.util.parsing.combinator.testing.Str; | |
| 41 | 39 | |
| 42 | -import javax.swing.text.html.parser.Entity; | |
| 43 | 40 | import java.math.BigDecimal; |
| 44 | 41 | import java.math.RoundingMode; |
| 45 | 42 | import java.util.*; |
| ... | ... | @@ -607,7 +604,7 @@ |
| 607 | 604 | } |
| 608 | 605 | |
| 609 | 606 | @Override |
| 610 | - public BaseResponse report(String id, Integer userId, String rid) { | |
| 607 | + public BaseResponse report(String id, Integer userId, String rid, String version) { | |
| 611 | 608 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 612 | 609 | Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId)); |
| 613 | 610 | |
| 614 | 611 | |
| 615 | 612 | |
| ... | ... | @@ -649,17 +646,25 @@ |
| 649 | 646 | //根据高危获取不同的卡路里计算公式 |
| 650 | 647 | |
| 651 | 648 | Map<String, String> kmap = null; |
| 652 | - //威海市妇幼热量单独计算 | |
| 653 | - if ("2100001635".equals(hospitalId)) { | |
| 654 | - kmap = getWhComputeKul(week, Double.parseDouble(patientWeight.getNowWeight()), Double.parseDouble(patientWeight.getBeforeWeight()), patientWeight.getBregmatic(), bmi); | |
| 655 | - } else { | |
| 656 | - kmap = computeKulServiceManager.getComputeKulByRisk(rid).getComputeKul(Double.parseDouble(patientWeight.getBeforeWeight()), | |
| 657 | - Double.parseDouble(patientWeight.getNowWeight()), week, bmi, patientWeight.getBregmatic(), patientWeight.getBeforeHeight()); | |
| 649 | + | |
| 650 | + if (StringUtils.isEmpty(version)) { | |
| 651 | + //威海市妇幼热量单独计算 | |
| 652 | + if ("2100001635".equals(hospitalId)) { | |
| 653 | + kmap = getWhComputeKul(week, Double.parseDouble(patientWeight.getNowWeight()), Double.parseDouble(patientWeight.getBeforeWeight()), patientWeight.getBregmatic(), bmi); | |
| 654 | + } else { | |
| 655 | + kmap = computeKulServiceManager.getComputeKulByRisk(rid).getComputeKul(Double.parseDouble(patientWeight.getBeforeWeight()), | |
| 656 | + Double.parseDouble(patientWeight.getNowWeight()), week, bmi, patientWeight.getBregmatic(), patientWeight.getBeforeHeight()); | |
| 657 | + } | |
| 658 | + if (map == null || map.size() == 0) { | |
| 659 | + return null; | |
| 660 | + } | |
| 661 | + //秦皇岛熟食版 | |
| 662 | + } else if ("1".equals(version)) { | |
| 663 | + | |
| 664 | + | |
| 658 | 665 | } |
| 659 | - if (map == null || map.size() == 0) { | |
| 660 | - return null; | |
| 661 | - } | |
| 662 | 666 | |
| 667 | + | |
| 663 | 668 | setGuide(week, map, hospitalId); // 设置指南 |
| 664 | 669 | String nsArea = ReportConfig.getNSArea(basicConfig.getName()); |
| 665 | 670 | |
| ... | ... | @@ -2023,7 +2028,7 @@ |
| 2023 | 2028 | } |
| 2024 | 2029 | |
| 2025 | 2030 | @Override |
| 2026 | - public BaseResponse getWeightsReport(String pid, Integer userId, String rid) { | |
| 2031 | + public BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version) { | |
| 2027 | 2032 | Map<String, Map<Integer, Double>> series = new HashMap<>(); |
| 2028 | 2033 | Map<String, Map<String, Object>> datas = new TreeMap<>(); |
| 2029 | 2034 | PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pid)), PatientWeight.class); |
| ... | ... | @@ -2160,7 +2165,7 @@ |
| 2160 | 2165 | } |
| 2161 | 2166 | } |
| 2162 | 2167 | if (datas.size() == 0) { |
| 2163 | - BaseResponse baseResponse = this.report(pid, userId, rid); | |
| 2168 | + BaseResponse baseResponse = this.report(pid, userId, rid, version); | |
| 2164 | 2169 | return baseResponse; |
| 2165 | 2170 | } |
| 2166 | 2171 | //同时出现高血压和肝硬化或肝功能不全则按照肝硬化或肝功能不全 |