Commit 06ca209dd5ebe43c9dcc5c7a241f0a78c3ab9743
1 parent
3ed7fc10fb
Exists in
master
and in
6 other branches
本机构所有儿童档案统计
Showing 3 changed files with 78 additions and 0 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
06ca209
... | ... | @@ -1874,6 +1874,35 @@ |
1874 | 1874 | stringBuffer.append(checkIndex[indexOf]); |
1875 | 1875 | return stringBuffer; |
1876 | 1876 | } |
1877 | + /** | |
1878 | + * 获取某年第一天日期 | |
1879 | + * @param year 年份 | |
1880 | + * @return Date | |
1881 | + */ | |
1882 | + public static Date getYearFirst(int year){ | |
1883 | + Calendar calendar = Calendar.getInstance(); | |
1884 | + calendar.clear(); | |
1885 | + calendar.set(Calendar.YEAR, year); | |
1886 | + Date currYearFirst = calendar.getTime(); | |
1887 | + return currYearFirst; | |
1888 | + } | |
1889 | + /** | |
1890 | + * 获取某年最后一天日期 | |
1891 | + * @param year 年份 | |
1892 | + * @return Date | |
1893 | + */ | |
1894 | + public static Date getYearLast(int year){ | |
1895 | + Calendar calendar = Calendar.getInstance(); | |
1896 | + calendar.clear(); | |
1897 | + calendar.set(Calendar.YEAR, year); | |
1898 | + calendar.roll(Calendar.DAY_OF_YEAR, -1); | |
1899 | + calendar.set(Calendar.HOUR_OF_DAY, 23); | |
1900 | + calendar.set(Calendar.MINUTE, 59); | |
1901 | + calendar.set(Calendar.SECOND, 59); | |
1902 | + Date currYearLast = calendar.getTime(); | |
1903 | + | |
1904 | + return currYearLast; | |
1905 | + } | |
1877 | 1906 | |
1878 | 1907 | |
1879 | 1908 | public static void main(String[] args) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
06ca209
... | ... | @@ -1024,5 +1024,18 @@ |
1024 | 1024 | return babyBookbuildingFacade.updateKosekiInfo(pid, babyProvinceId,babyCityId,babyAreaId,babyStreetId,babyAddress); |
1025 | 1025 | } |
1026 | 1026 | |
1027 | + /** | |
1028 | + * 本机构所有儿童档案统计 | |
1029 | + * @param babyBookbuildingAddRequest | |
1030 | + * @param httpServletRequest | |
1031 | + * @return | |
1032 | + */ | |
1033 | + @RequestMapping(method = RequestMethod.GET, value = "/queryBabyBuildStatistical") | |
1034 | + @ResponseBody | |
1035 | + @TokenRequired | |
1036 | + public BaseResponse queryBabyBuildStatistical(BabyModelQuery babyModelQuery,HttpServletRequest httpServletRequest) { | |
1037 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
1038 | + return babyBookbuildingFacade.queryBabyBuildStatistical(babyModelQuery, loginState.getId()); | |
1039 | + } | |
1027 | 1040 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
06ca209
... | ... | @@ -6186,5 +6186,41 @@ |
6186 | 6186 | br.setErrormsg("成功"); |
6187 | 6187 | return br; |
6188 | 6188 | } |
6189 | + | |
6190 | + public BaseResponse queryBabyBuildStatistical(BabyModelQuery babyModelQuery, Integer userId) { | |
6191 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
6192 | + babyModelQuery.setHospitalId(hospitalId); | |
6193 | + babyModelQuery.setBuildDateEnd(DateUtil.getMonthEndTime(babyModelQuery.getBuildDateStart())); | |
6194 | + Date currentDate = DateUtil.formatDate(new Date()); | |
6195 | + babyModelQuery.setBirthEnd(currentDate); | |
6196 | + | |
6197 | + //0-3岁建档数 | |
6198 | + Date end_3 = DateUtil.addDay(DateUtil.addMonth(currentDate, -36 - 1), 1); | |
6199 | + babyModelQuery.setBirthStart(end_3); | |
6200 | + int babyCount_3 = babyBookbuildingService.queryBabyCount(babyModelQuery); | |
6201 | + | |
6202 | + //0-6岁建档数 | |
6203 | + Date end_6 = DateUtil.addDay(DateUtil.addMonth(currentDate, -72 - 1), 1); | |
6204 | + babyModelQuery.setBirthStart(end_6); | |
6205 | + int babyCount_6 = babyBookbuildingService.queryBabyCount(babyModelQuery); | |
6206 | + | |
6207 | + //本月超过7岁建档数 | |
6208 | + Date endMonth_7 = DateUtil.addDay(DateUtil.addMonth(currentDate, -84 - 1), 1); | |
6209 | + babyModelQuery.setBirthStart(endMonth_7); | |
6210 | + int babyCountMonth_7 = babyBookbuildingService.queryBabyCount(babyModelQuery); | |
6211 | + | |
6212 | + //本年超过7岁建档数 | |
6213 | + babyModelQuery.setBuildDateStart(DateUtil.getYearFirst(Integer.parseInt(DateUtil.getYearStr(babyModelQuery.getBuildDateStart())))); | |
6214 | + babyModelQuery.setBuildDateEnd(DateUtil.getYearLast(Integer.parseInt(DateUtil.getYearStr(babyModelQuery.getBuildDateStart())))); | |
6215 | + Date endYear_7 = DateUtil.addDay(DateUtil.addMonth(currentDate, -84 - 1), 1); | |
6216 | + babyModelQuery.setBirthStart(endYear_7); | |
6217 | + int babyCountYear_7 = babyBookbuildingService.queryBabyCount(babyModelQuery); | |
6218 | + Map map=new HashMap(); | |
6219 | + map.put("age0_3",babyCount_3); | |
6220 | + map.put("age0_6",babyCount_6); | |
6221 | + map.put("ageMonth_7",babyCountMonth_7); | |
6222 | + map.put("ageYear_7",babyCountYear_7); | |
6223 | + return new BaseObjectResponse().setData(map); | |
6224 | + } | |
6189 | 6225 | } |