Commit 0201639d202d741a21410f991495771cd044c0cb
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 8 changed files
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
- platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
- platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java
- platform-job-index/src/main/webapp/WEB-INF/lib/base-common-1.0-SNAPSHOT.jar
- platform-job-index/src/main/webapp/WEB-INF/lib/mainData.jar
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
View file @
0201639
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
0201639
... | ... | @@ -967,5 +967,23 @@ |
967 | 967 | from organization |
968 | 968 | where yn = 1 |
969 | 969 | </select> |
970 | + | |
971 | + | |
972 | + <select id="findHospitalAllused" parameterType="map" resultType="map"> | |
973 | + select sum(allUserdCount) as allUserdCount from ( select count(1) as allUserdCount from coupon_info c INNER JOIN | |
974 | + (select t.id | |
975 | + from hospital_coupon_template_group h,coupon_template t ,coupon_type p | |
976 | + where h.coupon_template_group_id=t.group_id and t.type_id=p.id | |
977 | + and h.hospital_id = #{hid} | |
978 | + and p.type=2) t on c.coupon_template_id = t.id | |
979 | + where create_hospital_id= #{hid} and status =2 and used_id is not null | |
980 | + GROUP BY user_id having count(1) >= (select count(1) | |
981 | + from hospital_coupon_template_group h,coupon_template t ,coupon_type p | |
982 | + where h.coupon_template_group_id=t.group_id and t.type_id=p.id | |
983 | + and h.hospital_id = #{hid} | |
984 | + and p.type='2')) temp | |
985 | + </select> | |
986 | + | |
987 | + | |
970 | 988 | </mapper> |
platform-job-index/src/main/java/com/lyms/platform/job/index/restore/data/ConvertHelper.java
View file @
0201639
... | ... | @@ -568,6 +568,7 @@ |
568 | 568 | localPatient.setPid(patients.getPid()); |
569 | 569 | localPatient.setLastCheckEmployeeId(patients.getLastCheckEmployeeId()); |
570 | 570 | localPatient.setHospitalForeignId(patients.getHospitalId()); |
571 | + localPatient.setAutoFm(patients.getIsAutoFm()==null?0:1); | |
571 | 572 | //孕妇 |
572 | 573 | localPatient.setType(patients.getType()); |
573 | 574 | localPatient.setPublishId(0); |
platform-job-index/src/main/webapp/WEB-INF/lib/base-common-1.0-SNAPSHOT.jar
View file @
0201639
platform-job-index/src/main/webapp/WEB-INF/lib/mainData.jar
View file @
0201639
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
0201639
... | ... | @@ -152,8 +152,9 @@ |
152 | 152 | @RequestParam(required = true) Double weight, |
153 | 153 | @RequestParam(required = true) Integer sex, |
154 | 154 | @RequestParam(required = true) String birth, |
155 | - @RequestParam(required = false) Integer correctAge){ | |
156 | - return babyCheckFacade.queryHWByHeight(height, weight, sex, birth, correctAge); | |
155 | + @RequestParam(required = false) String dueDate, | |
156 | + @RequestParam(required = false) String checkDate){ | |
157 | + return babyCheckFacade.queryHWByHeight(height, weight, sex, birth, dueDate,checkDate); | |
157 | 158 | |
158 | 159 | } |
159 | 160 | |
... | ... | @@ -172,8 +173,9 @@ |
172 | 173 | @RequestParam(required = true) Integer type, |
173 | 174 | @RequestParam(required = true) String birth, |
174 | 175 | @RequestParam(required = false) String babyId, |
175 | - @RequestParam(required = false) Integer correctAge){ | |
176 | - return babyCheckFacade.queryBabyHealthStatus(birth, value, sex, type, correctAge, babyId); | |
176 | + @RequestParam(required = false) String dueDate, | |
177 | + @RequestParam(required = false) String checkDate){ | |
178 | + return babyCheckFacade.queryBabyHealthStatus(birth, value, sex, type, dueDate, babyId,checkDate); | |
177 | 179 | |
178 | 180 | } |
179 | 181 | |
... | ... | @@ -190,8 +192,9 @@ |
190 | 192 | @ResponseBody |
191 | 193 | public BaseObjectResponse queryGrowthEvaluate(@RequestParam(required = true) Double height,@RequestParam(required = true) Integer sex |
192 | 194 | ,@RequestParam(required = true) String birth,@RequestParam(required = true) Double weight, |
193 | - @RequestParam(required = false) Integer correctAge){ | |
194 | - return babyCheckFacade.queryGrowthEvaluate(height, sex, birth, weight, correctAge); | |
195 | + @RequestParam(required = false) String dueDate, | |
196 | + @RequestParam(required = false) String checkDate){ | |
197 | + return babyCheckFacade.queryGrowthEvaluate(height, sex, birth, weight, dueDate,checkDate); | |
195 | 198 | |
196 | 199 | } |
197 | 200 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
0201639
... | ... | @@ -1393,10 +1393,10 @@ |
1393 | 1393 | * @param sex |
1394 | 1394 | * @return |
1395 | 1395 | */ |
1396 | - public BaseObjectResponse queryHWByHeight(Double height, Double weight, Integer sex, String birth,Integer correctAge) { | |
1396 | + public BaseObjectResponse queryHWByHeight(Double height, Double weight, Integer sex, String birth, String dueDate,String checkDate) { | |
1397 | 1397 | |
1398 | 1398 | |
1399 | - String res = getBabyHW(height, weight, sex, birth,correctAge); | |
1399 | + String res = getBabyHW(height, weight, sex, birth, dueDate,checkDate); | |
1400 | 1400 | BaseObjectResponse br = new BaseObjectResponse(); |
1401 | 1401 | br.setData(res); |
1402 | 1402 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
1403 | 1403 | |
1404 | 1404 | |
1405 | 1405 | |
... | ... | @@ -1405,15 +1405,24 @@ |
1405 | 1405 | } |
1406 | 1406 | |
1407 | 1407 | |
1408 | - public String getBabyHW(Double height, Double weight, Integer sex, String birth,Integer correctAge) { | |
1408 | + public String getBabyHW(Double height, Double weight, Integer sex, String birth,String dueDate,String checkDate) { | |
1409 | 1409 | Double hw = getHw(height); |
1410 | 1410 | |
1411 | + int monthAge = 0; | |
1412 | + if (StringUtils.isNotEmpty(dueDate)) | |
1413 | + { | |
1414 | + monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(dueDate), DateUtil.parseYMD(checkDate)); | |
1415 | + if (monthAge < 0) | |
1416 | + { | |
1417 | + monthAge = 0; | |
1418 | + } | |
1419 | + } | |
1420 | + else | |
1421 | + { | |
1422 | + monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), DateUtil.parseYMD(checkDate)); | |
1423 | + } | |
1411 | 1424 | |
1412 | - Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth), Math.abs(correctAge == null ? 0 : correctAge)); | |
1413 | 1425 | |
1414 | - //计算儿童的月龄 | |
1415 | - int monthAge = DateUtil.getBabyAgeMonth(birthday, new Date()); | |
1416 | -// int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
1417 | 1426 | int ageType = 0; |
1418 | 1427 | if (monthAge > 24) { |
1419 | 1428 | ageType = 1; |
1420 | 1429 | |
... | ... | @@ -1487,9 +1496,9 @@ |
1487 | 1496 | * @param birth |
1488 | 1497 | * @return |
1489 | 1498 | */ |
1490 | - public BaseObjectResponse queryGrowthEvaluate(Double height, Integer sex, String birth, Double weight,Integer correctAge) { | |
1499 | + public BaseObjectResponse queryGrowthEvaluate(Double height, Integer sex, String birth, Double weight,String dueDate,String checkDate) { | |
1491 | 1500 | |
1492 | - List<String> list = getBabyGrowthEvaluate(height, sex, birth, weight, correctAge); | |
1501 | + List<String> list = getBabyGrowthEvaluate(height, sex, birth, weight, dueDate, checkDate); | |
1493 | 1502 | BaseObjectResponse br = new BaseObjectResponse(); |
1494 | 1503 | br.setData(list); |
1495 | 1504 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
1496 | 1505 | |
1497 | 1506 | |
... | ... | @@ -1513,16 +1522,24 @@ |
1513 | 1522 | * |
1514 | 1523 | * @return |
1515 | 1524 | */ |
1516 | - public List<String> getBabyGrowthEvaluate(Double height, Integer sex, String birth, Double weight,Integer correctAge) { | |
1525 | + public List<String> getBabyGrowthEvaluate(Double height, Integer sex, String birth, Double weight,String dueDate,String checkDate) { | |
1517 | 1526 | List<String> growthEvaluate = new ArrayList<>(); |
1518 | 1527 | Double hw = getHw(height); |
1519 | 1528 | |
1520 | - Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth), Math.abs(correctAge == null ? 0 : correctAge)); | |
1529 | + int monthAge = 0; | |
1530 | + if (StringUtils.isNotEmpty(dueDate)) | |
1531 | + { | |
1532 | + monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(dueDate), DateUtil.parseYMD(checkDate)); | |
1533 | + if (monthAge < 0) | |
1534 | + { | |
1535 | + monthAge = 0; | |
1536 | + } | |
1537 | + } | |
1538 | + else | |
1539 | + { | |
1540 | + monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), DateUtil.parseYMD(checkDate)); | |
1541 | + } | |
1521 | 1542 | |
1522 | - //计算儿童的月龄 | |
1523 | - int monthAge = DateUtil.getBabyAgeMonth(birthday, new Date()); | |
1524 | - | |
1525 | - //int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
1526 | 1543 | int ageType = 0; |
1527 | 1544 | if (monthAge > 24) { |
1528 | 1545 | ageType = 1; |
1529 | 1546 | |
1530 | 1547 | |
... | ... | @@ -1638,16 +1655,17 @@ |
1638 | 1655 | return objectResponse; |
1639 | 1656 | } |
1640 | 1657 | |
1641 | - public BaseObjectResponse queryBabyHealthStatus(String birth, Double value, Integer sex, Integer type,Integer correctAge,String babyId) { | |
1658 | + public BaseObjectResponse queryBabyHealthStatus(String birth, Double value, Integer sex, Integer type,String dueDate,String babyId, | |
1659 | + String checkDate) { | |
1642 | 1660 | String res = ""; |
1643 | 1661 | //体重 |
1644 | 1662 | if (type == 0) |
1645 | 1663 | { |
1646 | - res = getGrowthValue(birth, value, sex,correctAge,babyId); | |
1664 | + res = getGrowthValue(birth, value, sex,dueDate,babyId,checkDate); | |
1647 | 1665 | } |
1648 | 1666 | else |
1649 | 1667 | { |
1650 | - res = getGrowthValue1(birth, value, sex, type, correctAge); | |
1668 | + res = getGrowthValue1(birth, value, sex, type, dueDate,checkDate); | |
1651 | 1669 | } |
1652 | 1670 | |
1653 | 1671 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
1654 | 1672 | |
1655 | 1673 | |
1656 | 1674 | |
1657 | 1675 | |
1658 | 1676 | |
1659 | 1677 | |
1660 | 1678 | |
1661 | 1679 | |
... | ... | @@ -1658,33 +1676,41 @@ |
1658 | 1676 | } |
1659 | 1677 | |
1660 | 1678 | |
1661 | - public String getGrowthValue(String birth, Double value, Integer sex,Integer correctAge,String babyId) { | |
1679 | + public String getGrowthValue(String birth, Double value, Integer sex,String dueDate,String babyId,String checkDate) { | |
1662 | 1680 | |
1663 | 1681 | |
1664 | - BabyModelQuery babyQuery = new BabyModelQuery(); | |
1665 | - babyQuery.setId(babyId); | |
1666 | - babyQuery.setYn(YnEnums.YES.getId()); | |
1667 | - //查询儿童的基本信息 | |
1668 | - List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); | |
1682 | +// BabyModelQuery babyQuery = new BabyModelQuery(); | |
1683 | +// babyQuery.setId(babyId); | |
1684 | +// babyQuery.setYn(YnEnums.YES.getId()); | |
1685 | +// //查询儿童的基本信息 | |
1686 | +// List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); | |
1669 | 1687 | |
1670 | 1688 | List<AwModel> list = null; |
1671 | - if (CollectionUtils.isNotEmpty(models) && models.get(0).getDueWeek() != null && correctAge != null) | |
1689 | + if (dueDate != null) | |
1672 | 1690 | { |
1673 | - Integer days = DateUtil.daysBetween(DateUtil.parseYMD(birth), new Date()); | |
1674 | - if (models.get(0).getDueDay() != null) | |
1691 | + Integer week = DateUtil.getWeek2(DateUtil.addDay(DateUtil.parseYMD(dueDate), -280),DateUtil.parseYMD(checkDate)); | |
1692 | + if (week < 41) | |
1675 | 1693 | { |
1676 | - days+=models.get(0).getDueDay(); | |
1694 | + //查询该月龄的年龄别体重值 | |
1695 | + list = babyCheckService.queryBabyHealthConfigWeek(week, sex, 4); | |
1677 | 1696 | } |
1678 | - Integer week = models.get(0).getDueWeek() + days/7; | |
1697 | + else | |
1698 | + { | |
1699 | + //计算儿童的月龄 | |
1700 | + int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(dueDate), DateUtil.parseYMD(checkDate)); | |
1701 | + if (monthAge < 0) | |
1702 | + { | |
1703 | + monthAge = 0; | |
1704 | + } | |
1705 | + //查询该月龄的年龄别体重值 | |
1706 | + list = babyCheckService.queryBabyHealthConfig(monthAge, sex, 0); | |
1707 | + } | |
1679 | 1708 | |
1680 | - //查询该月龄的年龄别体重值 | |
1681 | - list = babyCheckService.queryBabyHealthConfigWeek(week, sex, 4); | |
1682 | 1709 | } |
1683 | 1710 | else |
1684 | 1711 | { |
1685 | - //Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth),Math.abs(correctAge == null ? 0 : correctAge)); | |
1686 | 1712 | //计算儿童的月龄 |
1687 | - int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
1713 | + int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), DateUtil.parseYMD(checkDate)); | |
1688 | 1714 | //查询该月龄的年龄别体重值 |
1689 | 1715 | list = babyCheckService.queryBabyHealthConfig(monthAge, sex, 0); |
1690 | 1716 | } |
1691 | 1717 | |
... | ... | @@ -1716,10 +1742,22 @@ |
1716 | 1742 | } |
1717 | 1743 | |
1718 | 1744 | |
1719 | - public String getGrowthValue1(String birth, Double value, Integer sex, Integer type,Integer correctAge) { | |
1720 | - Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth),Math.abs(correctAge == null ? 0 : correctAge)); | |
1745 | + public String getGrowthValue1(String birth, Double value, Integer sex, | |
1746 | + Integer type,String dueDate,String checkDate) { | |
1721 | 1747 | //计算儿童的月龄 |
1722 | - int monthAge = DateUtil.getBabyAgeMonth(birthday, new Date()); | |
1748 | + int monthAge = 0; | |
1749 | + if (StringUtils.isNotEmpty(dueDate)) | |
1750 | + { | |
1751 | + monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(dueDate), DateUtil.parseYMD(checkDate)); | |
1752 | + if (monthAge < 0) | |
1753 | + { | |
1754 | + monthAge = 0; | |
1755 | + } | |
1756 | + } | |
1757 | + else | |
1758 | + { | |
1759 | + monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), DateUtil.parseYMD(checkDate)); | |
1760 | + } | |
1723 | 1761 | |
1724 | 1762 | |
1725 | 1763 | //查询该月龄的年龄别体重值 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
0201639
... | ... | @@ -2459,10 +2459,13 @@ |
2459 | 2459 | param.put("hid", hid); |
2460 | 2460 | Map<String, Object> usedInfo = couponMapper.findHospitalUsedInfo2(param); |
2461 | 2461 | Map<String, Object> sendInfo = couponMapper.findHospitalSendInfo2(param); |
2462 | + Map<String, Object> allusedInfo = couponMapper.findHospitalAllused(param); | |
2462 | 2463 | |
2463 | 2464 | Map<String, Object> tempMap = packCouponMap(sendInfo, usedInfo, hNameMap, hid, xAxis, param); |
2464 | 2465 | |
2465 | 2466 | if(MapUtils.isNotEmpty(tempMap)) { |
2467 | + tempMap.put("allUserdCount",(allusedInfo == null || allusedInfo.get("allUserdCount") == null) ? 0 : allusedInfo.get("allUserdCount")); | |
2468 | + | |
2466 | 2469 | /** 方法/使用人数id */ |
2467 | 2470 | List<String> sendUserIds = couponMapper.findSendUserIds2(param); |
2468 | 2471 | List<String> usedUserIds = couponMapper.findUsedUserIds2(param); |