Commit c19544b03c8d569a580b2103bfa54ddc08f0ea71
1 parent
4f2d6edaea
Exists in
master
and in
6 other branches
update
Showing 4 changed files with 41 additions and 31 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyModel.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyOralCheckQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyOralCheckFacade.java
platform-dal/src/main/java/com/lyms/platform/pojo/BabyModel.java
View file @
c19544b
| ... | ... | @@ -788,6 +788,18 @@ |
| 788 | 788 | * 检查月龄套餐 |
| 789 | 789 | */ |
| 790 | 790 | private String oralCheckMonthId; |
| 791 | + /** | |
| 792 | + * 检查月龄 | |
| 793 | + */ | |
| 794 | + private String oralCheckMonthAge; | |
| 795 | + | |
| 796 | + public String getOralCheckMonthAge() { | |
| 797 | + return oralCheckMonthAge; | |
| 798 | + } | |
| 799 | + | |
| 800 | + public void setOralCheckMonthAge(String oralCheckMonthAge) { | |
| 801 | + this.oralCheckMonthAge = oralCheckMonthAge; | |
| 802 | + } | |
| 791 | 803 | |
| 792 | 804 | public String getOralCheckId() { |
| 793 | 805 | return oralCheckId; |
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
c19544b
| ... | ... | @@ -1949,12 +1949,15 @@ |
| 1949 | 1949 | if (StringUtils.isNotEmpty(hc)) { |
| 1950 | 1950 | condition = condition.and("hc", hc, MongoOper.IS); |
| 1951 | 1951 | } |
| 1952 | - if (StringUtils.isNotEmpty(oralCheckMonthId)) { | |
| 1952 | + if (StringUtils.isNotEmpty(wgfb)) { | |
| 1953 | 1953 | condition = condition.and("wgfb", wgfb, MongoOper.IS); |
| 1954 | 1954 | } |
| 1955 | 1955 | if (StringUtils.isNotEmpty(oralCheckId)) { |
| 1956 | 1956 | condition = condition.and("oralCheckId", oralCheckId, MongoOper.IS); |
| 1957 | 1957 | } |
| 1958 | + if (StringUtils.isNotEmpty(oralCheckDoctor)) { | |
| 1959 | + condition = condition.and("oralCheckDoctor", oralCheckDoctor, MongoOper.IS); | |
| 1960 | + } | |
| 1958 | 1961 | |
| 1959 | 1962 | Criteria c = null; |
| 1960 | 1963 | if (null != birthStart) { |
| 1961 | 1964 | |
| 1962 | 1965 | |
| 1963 | 1966 | |
| 1964 | 1967 | |
| 1965 | 1968 | |
| 1966 | 1969 | |
| ... | ... | @@ -2316,34 +2319,28 @@ |
| 2316 | 2319 | } |
| 2317 | 2320 | } |
| 2318 | 2321 | |
| 2322 | + Criteria cor6=MongoCondition.newInstance().getCriteria();//这里不能给null return拼接不能为空 | |
| 2319 | 2323 | //龋齿个数筛选 |
| 2320 | 2324 | if(StringUtils.isNotEmpty(qcStart)){//大于等于 |
| 2321 | 2325 | //字符串判断大小 |
| 2322 | 2326 | String format = String.format("function() {\n" + |
| 2323 | 2327 | " return this.qc >= %s \n" + |
| 2324 | 2328 | " }",qcStart); |
| 2325 | - if(null != c){ | |
| 2326 | - c = c.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 2327 | - }else{ | |
| 2328 | - c = Criteria.where("$where").is(format).and("qc").ne(""); | |
| 2329 | - } | |
| 2329 | + cor6.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 2330 | 2330 | } |
| 2331 | + Criteria cor7=MongoCondition.newInstance().getCriteria();//这里不能给null return拼接不能为空 | |
| 2331 | 2332 | if(StringUtils.isNotEmpty(qcEnd)){//小于等于 |
| 2332 | 2333 | //字符串判断大小 |
| 2333 | 2334 | String format = String.format("function() {\n" + |
| 2334 | 2335 | " return this.qc <= %s \n" + |
| 2335 | 2336 | " }",qcEnd); |
| 2336 | - if(null != c){ | |
| 2337 | - c = c.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 2338 | - }else{ | |
| 2339 | - c = Criteria.where("$where").is(format).and("qc").ne(""); | |
| 2340 | - } | |
| 2337 | + cor7.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 2341 | 2338 | } |
| 2342 | - if (null != oralCheckTimeStart && oralCheckTimeStart != null) { | |
| 2339 | + if (null != oralCheckTimeStart && oralCheckTimeEnd != null) { | |
| 2343 | 2340 | if (null != c) { |
| 2344 | - c = c.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeStart); | |
| 2341 | + c = c.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeEnd); | |
| 2345 | 2342 | } else { |
| 2346 | - c = Criteria.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeStart); | |
| 2343 | + c = Criteria.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeEnd); | |
| 2347 | 2344 | } |
| 2348 | 2345 | } |
| 2349 | 2346 | if (null != nextOralCheckTimeStrat && nextOralCheckTimeEnd != null) { |
| 2350 | 2347 | |
| ... | ... | @@ -2358,9 +2355,9 @@ |
| 2358 | 2355 | * 多个orCondition 需要添加Criteria来控制json同级两个and或者or来解决mongodb执行查询问题 |
| 2359 | 2356 | */ |
| 2360 | 2357 | if(c!=null){ |
| 2361 | - return new MongoCondition(c.andOperator(condition.getCriteria(),cor,cor2,cor3,cor4,cor5)).toMongoQuery(); | |
| 2358 | + return new MongoCondition(c.andOperator(condition.getCriteria(),cor,cor2,cor3,cor4,cor5,cor6,cor7)).toMongoQuery(); | |
| 2362 | 2359 | } |
| 2363 | - return new MongoCondition(cor.andOperator(condition.getCriteria(),cor2,cor3,cor4,cor5)).toMongoQuery(); | |
| 2360 | + return new MongoCondition(cor.andOperator(condition.getCriteria(),cor2,cor3,cor4,cor5,cor6,cor7)).toMongoQuery(); | |
| 2364 | 2361 | } |
| 2365 | 2362 | |
| 2366 | 2363 | public Boolean getFmDataStatu() { |
platform-dal/src/main/java/com/lyms/platform/query/BabyOralCheckQuery.java
View file @
c19544b
| ... | ... | @@ -262,11 +262,11 @@ |
| 262 | 262 | c = Criteria.where("birth").gte(birthEnd); |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | - if (null != oralCheckTimeStart && oralCheckTimeStart != null) { | |
| 265 | + if (null != oralCheckTimeStart && oralCheckTimeEnd != null) { | |
| 266 | 266 | if (null != c) { |
| 267 | - c = c.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeStart); | |
| 267 | + c = c.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeEnd); | |
| 268 | 268 | } else { |
| 269 | - c = Criteria.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeStart); | |
| 269 | + c = Criteria.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeEnd); | |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | if (null != nextOralCheckTimeStrat && nextOralCheckTimeEnd != null) { |
| 273 | 273 | |
| 274 | 274 | |
| 275 | 275 | |
| ... | ... | @@ -277,27 +277,21 @@ |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | //龋齿个数筛选 |
| 280 | + Criteria c3=MongoCondition.newInstance().getCriteria();//这里不能给null return拼接不能为空 | |
| 280 | 281 | if(StringUtils.isNotEmpty(qcStart)){//大于等于 |
| 281 | 282 | //字符串判断大小 |
| 282 | 283 | String format = String.format("function() {\n" + |
| 283 | 284 | " return this.qc >= %s \n" + |
| 284 | 285 | " }",qcStart); |
| 285 | - if(null != c){ | |
| 286 | - c = c.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 287 | - }else{ | |
| 288 | - c = Criteria.where("$where").is(format).and("qc").ne(""); | |
| 289 | - } | |
| 286 | + c3.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 290 | 287 | } |
| 288 | + Criteria c4=MongoCondition.newInstance().getCriteria();//这里不能给null return拼接不能为空 | |
| 291 | 289 | if(StringUtils.isNotEmpty(qcEnd)){//小于等于 |
| 292 | 290 | //字符串判断大小 |
| 293 | 291 | String format = String.format("function() {\n" + |
| 294 | 292 | " return this.qc <= %s \n" + |
| 295 | 293 | " }",qcEnd); |
| 296 | - if(null != c){ | |
| 297 | - c = c.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 298 | - }else{ | |
| 299 | - c = Criteria.where("$where").is(format).and("qc").ne(""); | |
| 300 | - } | |
| 294 | + c4.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 301 | 295 | } |
| 302 | 296 | // 查询号 |
| 303 | 297 | Criteria c2=MongoCondition.newInstance().getCriteria(); |
| 304 | 298 | |
| ... | ... | @@ -314,9 +308,9 @@ |
| 314 | 308 | } |
| 315 | 309 | |
| 316 | 310 | if (null != c) { |
| 317 | - return new MongoCondition(c.andOperator(condition.getCriteria(),c2)).toMongoQuery(); | |
| 311 | + return new MongoCondition(c.andOperator(condition.getCriteria(),c2,c3,c4)).toMongoQuery(); | |
| 318 | 312 | } |
| 319 | - return new MongoCondition(c2.andOperator(condition.getCriteria())).toMongoQuery(); | |
| 313 | + return new MongoCondition(c2.andOperator(condition.getCriteria(),c3,c4)).toMongoQuery(); | |
| 320 | 314 | } |
| 321 | 315 | |
| 322 | 316 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyOralCheckFacade.java
View file @
c19544b
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.biz.service.BabyOralCheckService; |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 6 | import com.lyms.platform.common.enums.CheckMonthEnums; |
| 7 | +import com.lyms.platform.common.enums.CheckMonthQhdEnums; | |
| 7 | 8 | import com.lyms.platform.common.enums.SexEnum; |
| 8 | 9 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | 10 | import com.lyms.platform.common.result.BaseObjectResponse; |
| ... | ... | @@ -119,6 +120,7 @@ |
| 119 | 120 | babyModel2.setQc(babyOralCheck.getQc()); |
| 120 | 121 | babyModel2.setHc(babyOralCheck.getHc()); |
| 121 | 122 | babyModel2.setWgfb(babyOralCheck.getWgfb()); |
| 123 | + babyModel2.setOralCheckMonthAge(babyOralCheck.getCheckMonthAge()); | |
| 122 | 124 | Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyModel2)); |
| 123 | 125 | mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(babyOralCheck.getBabyId())), update, BabyModel.class); |
| 124 | 126 | } |
| ... | ... | @@ -259,6 +261,7 @@ |
| 259 | 261 | babyModelQuery.setBirthEnd(DateUtil.getBirthEnd(babyModelQuery.getQueryMonthAgeStart())); |
| 260 | 262 | } |
| 261 | 263 | List<BabyModel> babyModelList = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery, "oralCheckTime", Sort.Direction.DESC); |
| 264 | + System.out.println(babyModelQuery.convertToQuery().convertToMongoQuery().toString()); | |
| 262 | 265 | List<Map> result=new ArrayList<>(); |
| 263 | 266 | for (BabyModel babyModel : babyModelList) { |
| 264 | 267 | Map<String,Object> map=new HashMap<>(); |
| ... | ... | @@ -273,6 +276,10 @@ |
| 273 | 276 | map.put("positive", StringUtils.isNotEmpty(babyModel.getPositiveType())?("2".equals(babyModel.getPositiveType())?"阳性":"正常"):"");//阳性项目 |
| 274 | 277 | map.put("checkTime", DateUtil.getYyyyMmDd(babyModel.getOralCheckTime()));//检查日期 |
| 275 | 278 | map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyModel.getNextOralCheckTime()));//预约日期 |
| 279 | + map.put("oralCheckMonthAge", babyModel.getOralCheckMonthAge());//检查月龄 | |
| 280 | + map.put("hc", babyModel.getHc()); | |
| 281 | + map.put("qc", babyModel.getQc()); | |
| 282 | + map.put("wgfb", babyModel.getWgfb()); | |
| 276 | 283 | result.add(map); |
| 277 | 284 | } |
| 278 | 285 | BaseObjectResponse br = new BaseObjectResponse(); |