Commit d530ea060e96c4c89a52c08fc5ecc49227ca0d6f
1 parent
96fd3fea25
Exists in
master
and in
6 other branches
隆化儿童口腔检查-阳性列表和全部儿童模块
Showing 4 changed files with 314 additions and 29 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 @
d530ea0
| ... | ... | @@ -768,6 +768,54 @@ | 
| 768 | 768 | * 口腔高危(同步字段) | 
| 769 | 769 | */ | 
| 770 | 770 | private List<String> oralHighRisk; | 
| 771 | + /** | |
| 772 | + * 龋齿 | |
| 773 | + */ | |
| 774 | + private String qc; | |
| 775 | + /** | |
| 776 | + * 护齿 | |
| 777 | + */ | |
| 778 | + private String hc; | |
| 779 | + /** | |
| 780 | + * 窝沟封闭 | |
| 781 | + */ | |
| 782 | + private String wgfb; | |
| 783 | + /** | |
| 784 | + * 检查月龄套餐 | |
| 785 | + */ | |
| 786 | + private String oralCheckMonthId; | |
| 787 | + | |
| 788 | + public String getOralCheckMonthId() { | |
| 789 | + return oralCheckMonthId; | |
| 790 | + } | |
| 791 | + | |
| 792 | + public void setOralCheckMonthId(String oralCheckMonthId) { | |
| 793 | + this.oralCheckMonthId = oralCheckMonthId; | |
| 794 | + } | |
| 795 | + | |
| 796 | + public String getQc() { | |
| 797 | + return qc; | |
| 798 | + } | |
| 799 | + | |
| 800 | + public void setQc(String qc) { | |
| 801 | + this.qc = qc; | |
| 802 | + } | |
| 803 | + | |
| 804 | + public String getHc() { | |
| 805 | + return hc; | |
| 806 | + } | |
| 807 | + | |
| 808 | + public void setHc(String hc) { | |
| 809 | + this.hc = hc; | |
| 810 | + } | |
| 811 | + | |
| 812 | + public String getWgfb() { | |
| 813 | + return wgfb; | |
| 814 | + } | |
| 815 | + | |
| 816 | + public void setWgfb(String wgfb) { | |
| 817 | + this.wgfb = wgfb; | |
| 818 | + } | |
| 771 | 819 | |
| 772 | 820 | public List<String> getOralHighRisk() { | 
| 773 | 821 | return oralHighRisk; | 
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
d530ea0
| ... | ... | @@ -10,6 +10,7 @@ | 
| 10 | 10 | import org.springframework.data.mongodb.core.query.Criteria; | 
| 11 | 11 | |
| 12 | 12 | import java.util.ArrayList; | 
| 13 | +import java.util.Arrays; | |
| 13 | 14 | import java.util.Date; | 
| 14 | 15 | import java.util.List; | 
| 15 | 16 | |
| ... | ... | @@ -1322,6 +1323,179 @@ | 
| 1322 | 1323 | this.highRiskAndWeakSon = highRiskAndWeakSon; | 
| 1323 | 1324 | } | 
| 1324 | 1325 | |
| 1326 | + //隆化-口腔模块 | |
| 1327 | + /** | |
| 1328 | + * 检查时间-开始 | |
| 1329 | + */ | |
| 1330 | + private Date oralCheckTimeStart; | |
| 1331 | + /** | |
| 1332 | + * 检查时间-结束 | |
| 1333 | + */ | |
| 1334 | + private Date oralCheckTimeEnd; | |
| 1335 | + | |
| 1336 | + /** | |
| 1337 | + * 预约下次检查时间-开始 | |
| 1338 | + */ | |
| 1339 | + private Date nextOralCheckTimeStrat; | |
| 1340 | + /** | |
| 1341 | + * 预约下次检查时间-结束 | |
| 1342 | + */ | |
| 1343 | + private Date nextOralCheckTimeEnd; | |
| 1344 | + | |
| 1345 | + /** | |
| 1346 | + * 检查医生 | |
| 1347 | + */ | |
| 1348 | + private String oralCheckDoctor; | |
| 1349 | + | |
| 1350 | + /** | |
| 1351 | + * 阳性状态1:正常 2:阳性 (注:前端接传0代表查询1或2是口腔全部儿童列表必传。传2是口腔模块阳性列表) | |
| 1352 | + */ | |
| 1353 | + private String positiveType; | |
| 1354 | + /** | |
| 1355 | + * 口腔高危(同步字段) | |
| 1356 | + */ | |
| 1357 | + private List<String> oralHighRisk; | |
| 1358 | + /** | |
| 1359 | + * 龋齿从几开始(个数) | |
| 1360 | + */ | |
| 1361 | + private String qcStart; | |
| 1362 | + /** | |
| 1363 | + * 龋齿到几结束(个数) | |
| 1364 | + */ | |
| 1365 | + private String qcEnd; | |
| 1366 | + /** | |
| 1367 | + * 护齿(1已做/2未做) | |
| 1368 | + */ | |
| 1369 | + private String hc; | |
| 1370 | + /** | |
| 1371 | + * 窝沟封闭(1已做/2未做) | |
| 1372 | + */ | |
| 1373 | + private String wgfb; | |
| 1374 | + /** | |
| 1375 | + * 检查月龄套餐 | |
| 1376 | + */ | |
| 1377 | + private String oralCheckMonthId; | |
| 1378 | + /** | |
| 1379 | + * 当前月龄筛选-开始 | |
| 1380 | + */ | |
| 1381 | + private Integer queryMonthAgeStart; | |
| 1382 | + /** | |
| 1383 | + * 当前月龄筛选-结束 | |
| 1384 | + */ | |
| 1385 | + private Integer queryMonthAgeEnd; | |
| 1386 | + | |
| 1387 | + public Integer getQueryMonthAgeStart() { | |
| 1388 | + return queryMonthAgeStart; | |
| 1389 | + } | |
| 1390 | + | |
| 1391 | + public void setQueryMonthAgeStart(Integer queryMonthAgeStart) { | |
| 1392 | + this.queryMonthAgeStart = queryMonthAgeStart; | |
| 1393 | + } | |
| 1394 | + | |
| 1395 | + public Integer getQueryMonthAgeEnd() { | |
| 1396 | + return queryMonthAgeEnd; | |
| 1397 | + } | |
| 1398 | + | |
| 1399 | + public void setQueryMonthAgeEnd(Integer queryMonthAgeEnd) { | |
| 1400 | + this.queryMonthAgeEnd = queryMonthAgeEnd; | |
| 1401 | + } | |
| 1402 | + | |
| 1403 | + public Date getOralCheckTimeStart() { | |
| 1404 | + return oralCheckTimeStart; | |
| 1405 | + } | |
| 1406 | + | |
| 1407 | + public void setOralCheckTimeStart(Date oralCheckTimeStart) { | |
| 1408 | + this.oralCheckTimeStart = oralCheckTimeStart; | |
| 1409 | + } | |
| 1410 | + | |
| 1411 | + public Date getOralCheckTimeEnd() { | |
| 1412 | + return oralCheckTimeEnd; | |
| 1413 | + } | |
| 1414 | + | |
| 1415 | + public void setOralCheckTimeEnd(Date oralCheckTimeEnd) { | |
| 1416 | + this.oralCheckTimeEnd = oralCheckTimeEnd; | |
| 1417 | + } | |
| 1418 | + | |
| 1419 | + public Date getNextOralCheckTimeStrat() { | |
| 1420 | + return nextOralCheckTimeStrat; | |
| 1421 | + } | |
| 1422 | + | |
| 1423 | + public void setNextOralCheckTimeStrat(Date nextOralCheckTimeStrat) { | |
| 1424 | + this.nextOralCheckTimeStrat = nextOralCheckTimeStrat; | |
| 1425 | + } | |
| 1426 | + | |
| 1427 | + public Date getNextOralCheckTimeEnd() { | |
| 1428 | + return nextOralCheckTimeEnd; | |
| 1429 | + } | |
| 1430 | + | |
| 1431 | + public void setNextOralCheckTimeEnd(Date nextOralCheckTimeEnd) { | |
| 1432 | + this.nextOralCheckTimeEnd = nextOralCheckTimeEnd; | |
| 1433 | + } | |
| 1434 | + | |
| 1435 | + public String getOralCheckDoctor() { | |
| 1436 | + return oralCheckDoctor; | |
| 1437 | + } | |
| 1438 | + | |
| 1439 | + public void setOralCheckDoctor(String oralCheckDoctor) { | |
| 1440 | + this.oralCheckDoctor = oralCheckDoctor; | |
| 1441 | + } | |
| 1442 | + | |
| 1443 | + public String getPositiveType() { | |
| 1444 | + return positiveType; | |
| 1445 | + } | |
| 1446 | + | |
| 1447 | + public void setPositiveType(String positiveType) { | |
| 1448 | + this.positiveType = positiveType; | |
| 1449 | + } | |
| 1450 | + | |
| 1451 | + public List<String> getOralHighRisk() { | |
| 1452 | + return oralHighRisk; | |
| 1453 | + } | |
| 1454 | + | |
| 1455 | + public void setOralHighRisk(List<String> oralHighRisk) { | |
| 1456 | + this.oralHighRisk = oralHighRisk; | |
| 1457 | + } | |
| 1458 | + | |
| 1459 | + public String getQcStart() { | |
| 1460 | + return qcStart; | |
| 1461 | + } | |
| 1462 | + | |
| 1463 | + public void setQcStart(String qcStart) { | |
| 1464 | + this.qcStart = qcStart; | |
| 1465 | + } | |
| 1466 | + | |
| 1467 | + public String getQcEnd() { | |
| 1468 | + return qcEnd; | |
| 1469 | + } | |
| 1470 | + | |
| 1471 | + public void setQcEnd(String qcEnd) { | |
| 1472 | + this.qcEnd = qcEnd; | |
| 1473 | + } | |
| 1474 | + | |
| 1475 | + public String getHc() { | |
| 1476 | + return hc; | |
| 1477 | + } | |
| 1478 | + | |
| 1479 | + public void setHc(String hc) { | |
| 1480 | + this.hc = hc; | |
| 1481 | + } | |
| 1482 | + | |
| 1483 | + public String getWgfb() { | |
| 1484 | + return wgfb; | |
| 1485 | + } | |
| 1486 | + | |
| 1487 | + public void setWgfb(String wgfb) { | |
| 1488 | + this.wgfb = wgfb; | |
| 1489 | + } | |
| 1490 | + | |
| 1491 | + public String getOralCheckMonthId() { | |
| 1492 | + return oralCheckMonthId; | |
| 1493 | + } | |
| 1494 | + | |
| 1495 | + public void setOralCheckMonthId(String oralCheckMonthId) { | |
| 1496 | + this.oralCheckMonthId = oralCheckMonthId; | |
| 1497 | + } | |
| 1498 | + | |
| 1325 | 1499 | @Override | 
| 1326 | 1500 | public MongoQuery convertToQuery() { | 
| 1327 | 1501 | MongoCondition condition = MongoCondition.newInstance(); | 
| ... | ... | @@ -1755,6 +1929,25 @@ | 
| 1755 | 1929 | if (null!=settleType) { | 
| 1756 | 1930 | condition = condition.and("settleType", settleType, MongoOper.IS); | 
| 1757 | 1931 | } | 
| 1932 | + if (StringUtils.isNotEmpty(positiveType)) { | |
| 1933 | + if("0".equals(positiveType)){ | |
| 1934 | + condition = condition.and("positiveType", Arrays.asList("1","2"), MongoOper.IN); | |
| 1935 | + }else { | |
| 1936 | + condition = condition.and("positiveType", positiveType, MongoOper.IS); | |
| 1937 | + } | |
| 1938 | + } | |
| 1939 | + if (CollectionUtils.isNotEmpty(oralHighRisk)) { | |
| 1940 | + condition = condition.and("oralHighRisk", oralHighRisk, MongoOper.IN); | |
| 1941 | + } | |
| 1942 | + if (StringUtils.isNotEmpty(oralCheckMonthId)) { | |
| 1943 | + condition = condition.and("oralCheckMonthId", oralCheckMonthId, MongoOper.IS); | |
| 1944 | + } | |
| 1945 | + if (StringUtils.isNotEmpty(hc)) { | |
| 1946 | + condition = condition.and("hc", hc, MongoOper.IS); | |
| 1947 | + } | |
| 1948 | + if (StringUtils.isNotEmpty(oralCheckMonthId)) { | |
| 1949 | + condition = condition.and("wgfb", wgfb, MongoOper.IS); | |
| 1950 | + } | |
| 1758 | 1951 | |
| 1759 | 1952 | Criteria c = null; | 
| 1760 | 1953 | if (null != birthStart) { | 
| ... | ... | @@ -2116,7 +2309,43 @@ | 
| 2116 | 2309 | } | 
| 2117 | 2310 | } | 
| 2118 | 2311 | |
| 2119 | - | |
| 2312 | + //龋齿个数筛选 | |
| 2313 | + if(StringUtils.isNotEmpty(qcStart)){//大于等于 | |
| 2314 | + //字符串判断大小 | |
| 2315 | + String format = String.format("function() {\n" + | |
| 2316 | + " return this.qc >= %s \n" + | |
| 2317 | + " }",qcStart); | |
| 2318 | + if(null != c){ | |
| 2319 | + c = c.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 2320 | + }else{ | |
| 2321 | + c = Criteria.where("$where").is(format).and("qc").ne(""); | |
| 2322 | + } | |
| 2323 | + } | |
| 2324 | + if(StringUtils.isNotEmpty(qcEnd)){//小于等于 | |
| 2325 | + //字符串判断大小 | |
| 2326 | + String format = String.format("function() {\n" + | |
| 2327 | + " return this.qc <= %s \n" + | |
| 2328 | + " }",qcEnd); | |
| 2329 | + if(null != c){ | |
| 2330 | + c = c.and("$where").is(format).and("qc").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据 | |
| 2331 | + }else{ | |
| 2332 | + c = Criteria.where("$where").is(format).and("qc").ne(""); | |
| 2333 | + } | |
| 2334 | + } | |
| 2335 | + if (null != oralCheckTimeStart && oralCheckTimeStart != null) { | |
| 2336 | + if (null != c) { | |
| 2337 | + c = c.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeStart); | |
| 2338 | + } else { | |
| 2339 | + c = Criteria.where("oralCheckTime").gte(oralCheckTimeStart).lte(oralCheckTimeStart); | |
| 2340 | + } | |
| 2341 | + } | |
| 2342 | + if (null != nextOralCheckTimeStrat && nextOralCheckTimeEnd != null) { | |
| 2343 | + if (null != c) { | |
| 2344 | + c = c.where("nextOralCheckTime").gte(nextOralCheckTimeStrat).lte(nextOralCheckTimeEnd); | |
| 2345 | + } else { | |
| 2346 | + c = Criteria.where("nextOralCheckTime").gte(nextOralCheckTimeStrat).lte(nextOralCheckTimeEnd); | |
| 2347 | + } | |
| 2348 | + } | |
| 2120 | 2349 | |
| 2121 | 2350 | /** | 
| 2122 | 2351 | * 多个orCondition 需要添加Criteria来控制json同级两个and或者or来解决mongodb执行查询问题 | 
platform-dal/src/main/java/com/lyms/platform/query/BabyOralCheckQuery.java
View file @
d530ea0
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyOralCheckFacade.java
View file @
d530ea0
| ... | ... | @@ -97,32 +97,26 @@ | 
| 97 | 97 | } | 
| 98 | 98 | |
| 99 | 99 | //同步数据到儿童档案(添加) | 
| 100 | - if (StringUtils.isEmpty(babyOralCheck.getId())) { | |
| 101 | - BabyModel babyModelsyn = new BabyModel(); | |
| 102 | - babyModelsyn.setPositiveType(babyOralCheck.getPositiveType()); | |
| 103 | - babyModelsyn.setOralCheckTime(babyOralCheck.getOralCheckTime()); | |
| 104 | - babyModelsyn.setNextOralCheckTime(babyOralCheck.getNextOralCheckTime()); | |
| 105 | - babyModelsyn.setOralCheckDoctor(babyOralCheck.getOralCheckDoctor()); | |
| 106 | - babyModelsyn.setOralHighRisk(babyOralCheck.getOralHighRisk()); | |
| 107 | - Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyModelsyn)); | |
| 100 | + BabyOralCheckQuery checkQuery=new BabyOralCheckQuery(); | |
| 101 | + checkQuery.setBabyId(babyOralCheck.getBabyId()); | |
| 102 | + List<BabyOralCheck> babyOralChecks=babyOralCheckService.queryList(checkQuery,Sort.Direction.DESC,"created"); | |
| 103 | + //修改最新的记录才会同步儿童档案,新增也会同步到儿童档案 | |
| 104 | + if( (CollectionUtils.isNotEmpty(babyOralChecks) && | |
| 105 | + babyOralChecks.get(0).getId().equals(babyOralCheck.getId())) || StringUtils.isEmpty(babyOralCheck.getId())){ | |
| 106 | + BabyModel babyModel2 = new BabyModel(); | |
| 107 | + babyModel2.setPositiveType(babyOralCheck.getPositiveType()); | |
| 108 | + babyModel2.setOralCheckTime(babyOralCheck.getOralCheckTime()); | |
| 109 | + babyModel2.setNextOralCheckTime(babyOralCheck.getNextOralCheckTime()); | |
| 110 | + babyModel2.setOralCheckDoctor(babyOralCheck.getOralCheckDoctor()); | |
| 111 | + babyModel2.setOralHighRisk(babyOralCheck.getOralHighRisk()); | |
| 112 | + babyModel2.setOralCheckMonthId(babyOralCheck.getCheckMonthId()); | |
| 113 | + babyModel2.setQc(babyOralCheck.getQc()); | |
| 114 | + babyModel2.setHc(babyOralCheck.getHc()); | |
| 115 | + babyModel2.setWgfb(babyOralCheck.getWgfb()); | |
| 116 | + Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyModel2)); | |
| 108 | 117 | mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(babyOralCheck.getBabyId())), update, BabyModel.class); | 
| 109 | - }else {//同步数据到儿童档案(修改) | |
| 110 | - BabyOralCheckQuery checkQuery=new BabyOralCheckQuery(); | |
| 111 | - checkQuery.setBabyId(babyOralCheck.getBabyId()); | |
| 112 | - List<BabyOralCheck> babyOralChecks=babyOralCheckService.queryList(checkQuery,Sort.Direction.DESC,"created"); | |
| 113 | - //修改最新的记录才会同步儿童档案 | |
| 114 | - if(CollectionUtils.isNotEmpty(babyOralChecks) && | |
| 115 | - babyOralChecks.get(0).getId().equals(babyOralCheck.getId())){ | |
| 116 | - BabyModel babyModelsyn = new BabyModel(); | |
| 117 | - babyModelsyn.setPositiveType(babyOralCheck.getPositiveType()); | |
| 118 | - babyModelsyn.setOralCheckTime(babyOralCheck.getOralCheckTime()); | |
| 119 | - babyModelsyn.setNextOralCheckTime(babyOralCheck.getNextOralCheckTime()); | |
| 120 | - babyModelsyn.setOralCheckDoctor(babyOralCheck.getOralCheckDoctor()); | |
| 121 | - babyModelsyn.setOralHighRisk(babyOralCheck.getOralHighRisk()); | |
| 122 | - Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyModelsyn)); | |
| 123 | - mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(babyOralCheck.getBabyId())), update, BabyModel.class); | |
| 124 | - } | |
| 125 | 118 | } | 
| 119 | + | |
| 126 | 120 | BaseObjectResponse br = new BaseObjectResponse(); | 
| 127 | 121 | br.setErrorcode(ErrorCodeConstants.SUCCESS); | 
| 128 | 122 | br.setErrormsg("成功"); | 
| 129 | 123 | |
| ... | ... | @@ -218,10 +212,10 @@ | 
| 218 | 212 | } | 
| 219 | 213 | //当前月龄筛选 | 
| 220 | 214 | if(request.getQueryMonthAgeStart()!=null){ | 
| 221 | - request.setBirthStart(DateUtil.getBirthEnd(request.getQueryMonthAgeStart())); | |
| 215 | + request.setBirthStart(DateUtil.getBirthStart(request.getQueryMonthAgeEnd())); | |
| 222 | 216 | } | 
| 223 | 217 | if(request.getQueryMonthAgeEnd()!=null){ | 
| 224 | - request.setBirthEnd(DateUtil.getBirthStart(request.getQueryMonthAgeEnd())); | |
| 218 | + request.setBirthEnd(DateUtil.getBirthEnd(request.getQueryMonthAgeStart())); | |
| 225 | 219 | } | 
| 226 | 220 | List<BabyOralCheck> babyOralChecks=babyOralCheckService.queryList(request,Sort.Direction.DESC,"created"); | 
| 227 | 221 | List<Map> result=new ArrayList<>(); | 
| ... | ... | @@ -244,6 +238,20 @@ | 
| 244 | 238 | babyModelQuery.setNeed("true"); | 
| 245 | 239 | babyModelQuery.setYn(YnEnums.YES.getId()); | 
| 246 | 240 | babyModelQuery.setHospitalId(hospitalId); | 
| 241 | + //结束日期加上时分秒 | |
| 242 | + if (babyModelQuery.getOralCheckTimeEnd() != null) { | |
| 243 | + babyModelQuery.setOralCheckTimeEnd(DateUtil.getDayLastSecond(babyModelQuery.getOralCheckTimeEnd())); | |
| 244 | + } | |
| 245 | + if (babyModelQuery.getNextOralCheckTimeEnd() != null) { | |
| 246 | + babyModelQuery.setNextOralCheckTimeEnd(DateUtil.getDayLastSecond(babyModelQuery.getNextOralCheckTimeEnd())); | |
| 247 | + } | |
| 248 | + //当前月龄筛选 | |
| 249 | + if(babyModelQuery.getQueryMonthAgeStart()!=null){ | |
| 250 | + babyModelQuery.setBirthStart(DateUtil.getBirthStart(babyModelQuery.getQueryMonthAgeEnd())); | |
| 251 | + } | |
| 252 | + if(babyModelQuery.getQueryMonthAgeEnd()!=null){ | |
| 253 | + babyModelQuery.setBirthEnd(DateUtil.getBirthEnd(babyModelQuery.getQueryMonthAgeStart())); | |
| 254 | + } | |
| 247 | 255 | List<BabyModel> babyModelList = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery, "oralCheckTime", Sort.Direction.DESC); | 
| 248 | 256 | |
| 249 | 257 | BaseObjectResponse br = new BaseObjectResponse(); |