Commit 6ccc953c212cd59bd8becbb58c344ee2c1e89892
1 parent
d135793840
Exists in
master
儿童统计
Showing 6 changed files with 74 additions and 10 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IBabyCheckDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BabyCheckDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyCheckService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IBabyCheckDao.java
View file @
6ccc953
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BabyCheckDaoImpl.java
View file @
6ccc953
| ... | ... | @@ -69,6 +69,11 @@ |
| 69 | 69 | return (int) count(mongoQuery.convertToMongoQuery()); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | + @Override | |
| 73 | + public void updateBabyCheckByBuildId(BabyCheckModel checkModel, String buildId) { | |
| 74 | + this.mongoTemplate.updateMulti(new Query(Criteria.where("buildId").is(buildId)), Update.update("birth", checkModel.getBirth()), BabyCheckModel.class); | |
| 75 | + } | |
| 76 | + | |
| 72 | 77 | |
| 73 | 78 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyCheckService.java
View file @
6ccc953
| ... | ... | @@ -46,8 +46,13 @@ |
| 46 | 46 | babyCheckDao.updateBabyCheck(obj, id); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public List<BabyCheckModel> queryBabyCheckRecord(BabyCheckModelQuery query) { | |
| 50 | - return babyCheckDao.queryBabyCheckRecord(query.convertToQuery().addOrder(Sort.Direction.DESC,"modified")); | |
| 49 | + public List<BabyCheckModel> queryBabyCheckRecord(BabyCheckModelQuery babyQuery) { | |
| 50 | + MongoQuery query = babyQuery.convertToQuery(); | |
| 51 | + if (StringUtils.isNotEmpty(babyQuery.getNeed())) { | |
| 52 | + babyQuery.mysqlBuild(babyCheckDao.queryBabyCheckCount(babyQuery.convertToQuery())); | |
| 53 | + query.start(babyQuery.getOffset()).end(babyQuery.getLimit()); | |
| 54 | + } | |
| 55 | + return babyCheckDao.queryBabyCheckRecord(babyQuery.convertToQuery().addOrder(Sort.Direction.DESC,"created")); | |
| 51 | 56 | } |
| 52 | 57 | |
| 53 | 58 | public List<BabyCheckModel> queryBabyCheckRecord(BabyCheckModelQuery query,String sortkey,Sort.Direction sort) { |
| ... | ... | @@ -90,6 +95,10 @@ |
| 90 | 95 | public int queryBabyCheckCount(BabyCheckModelQuery babyQuery) { |
| 91 | 96 | |
| 92 | 97 | return babyCheckDao.queryBabyCheckCount(babyQuery.convertToQuery()); |
| 98 | + } | |
| 99 | + | |
| 100 | + public void updateBabyCheckByBuildId(BabyCheckModel checkModel, String buildId) { | |
| 101 | + babyCheckDao.updateBabyCheckByBuildId(checkModel,buildId); | |
| 93 | 102 | } |
| 94 | 103 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
6ccc953
| ... | ... | @@ -393,9 +393,11 @@ |
| 393 | 393 | @RequestMapping(method = RequestMethod.GET, value = "/getBabyGroupRightCount") |
| 394 | 394 | @ResponseBody |
| 395 | 395 | @TokenRequired |
| 396 | - public BaseResponse getBabyGroupRightCount(@Valid @RequestBody BabyManageRequest babyManageRequest,HttpServletRequest request){ | |
| 396 | + public BaseResponse getBabyGroupRightCount(@Valid @RequestBody BabyManageRequest babyManageRequest,HttpServletRequest request, | |
| 397 | + @RequestParam("page") Integer page, | |
| 398 | + @RequestParam("limit") Integer limit){ | |
| 397 | 399 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 398 | - return babyBookbuildingFacade.getBabyGroupRightCount(babyManageRequest,loginState.getId()); | |
| 400 | + return babyBookbuildingFacade.getBabyGroupRightCount(babyManageRequest,loginState.getId(),page,limit); | |
| 399 | 401 | } |
| 400 | 402 | |
| 401 | 403 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
6ccc953
| ... | ... | @@ -108,6 +108,8 @@ |
| 108 | 108 | private AutoMatchFacade autoMatchFacade; |
| 109 | 109 | |
| 110 | 110 | |
| 111 | + | |
| 112 | + | |
| 111 | 113 | private static ExecutorService pool = Executors.newFixedThreadPool(10); |
| 112 | 114 | |
| 113 | 115 | |
| ... | ... | @@ -198,7 +200,7 @@ |
| 198 | 200 | * @param request |
| 199 | 201 | * @return |
| 200 | 202 | */ |
| 201 | - public BaseResponse updateBabyBookbuilding(BabyBookbuildingAddRequest request,Integer userId) { | |
| 203 | + public BaseResponse updateBabyBookbuilding(BabyBookbuildingAddRequest request, Integer userId) { | |
| 202 | 204 | BabyModel model = getBabyModel(request); |
| 203 | 205 | model.setModified(new Date()); |
| 204 | 206 | model.setOperator(userId); |
| ... | ... | @@ -280,6 +282,14 @@ |
| 280 | 282 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 281 | 283 | } |
| 282 | 284 | |
| 285 | + | |
| 286 | + private void updateCheckBirth(BabyModel babyModel) | |
| 287 | + { | |
| 288 | + BabyCheckModel checkModel = new BabyCheckModel(); | |
| 289 | + checkModel.setBirth(babyModel.getBirth()); | |
| 290 | + babyCheckService.updateBabyCheckByBuildId(checkModel, babyModel.getId()); | |
| 291 | + } | |
| 292 | + | |
| 283 | 293 | /** |
| 284 | 294 | * 添加儿童建档 |
| 285 | 295 | * |
| ... | ... | @@ -2179,7 +2189,7 @@ |
| 2179 | 2189 | * @param userId |
| 2180 | 2190 | * @return |
| 2181 | 2191 | */ |
| 2182 | - public BaseResponse getBabyGroupRightCount(BabyManageRequest request, Integer userId) { | |
| 2192 | + public BaseResponse getBabyGroupRightCount(BabyManageRequest request, Integer userId,Integer page,Integer limit) { | |
| 2183 | 2193 | String hospitalId = ""; |
| 2184 | 2194 | //得到当前登录的医院id |
| 2185 | 2195 | if (userId != null) { |
| ... | ... | @@ -2213,6 +2223,19 @@ |
| 2213 | 2223 | babyQuery.setCheckDateStart(end); |
| 2214 | 2224 | } |
| 2215 | 2225 | |
| 2226 | + babyQuery.setPage(page); | |
| 2227 | + babyQuery.setLimit(limit); | |
| 2228 | + babyQuery.setNeed("true"); | |
| 2229 | + | |
| 2230 | + if (StringUtils.isNotEmpty(request.getItemType()) && "1".equals(request.getItemType())) | |
| 2231 | + { | |
| 2232 | + babyQuery.setHeightEvaluate(request.getEvaluate()); | |
| 2233 | + } | |
| 2234 | + else if (StringUtils.isNotEmpty(request.getItemType()) && "2".equals(request.getItemType())) | |
| 2235 | + { | |
| 2236 | + babyQuery.setWeightEvaluate(request.getEvaluate()); | |
| 2237 | + } | |
| 2238 | + | |
| 2216 | 2239 | List<Map<String,String>> results = new ArrayList<>(); |
| 2217 | 2240 | |
| 2218 | 2241 | List<BabyCheckModel> babyCheckModels = babyCheckService.queryBabyCheckRecord(babyQuery); |
| 2219 | 2242 | |
| ... | ... | @@ -2239,12 +2262,12 @@ |
| 2239 | 2262 | { |
| 2240 | 2263 | BabyModel model = getBabyModelById(checkModel.getBuildId()); |
| 2241 | 2264 | Map<String,String> map = new HashMap<>(); |
| 2242 | - map.put("babyId",model.getId()); | |
| 2243 | - map.put("checkId",checkModel.getId()); | |
| 2265 | + map.put("babyId",model.getId()); //儿童主键 | |
| 2266 | + map.put("checkId",checkModel.getId()); //检查主键 | |
| 2244 | 2267 | map.put("sex", StringUtils.emptyDeal(SexEnum.getTextById(model.getSex()))); //性别 |
| 2245 | 2268 | map.put("babyName", StringUtils.emptyDeal(model.getName())); //儿童名称 |
| 2246 | 2269 | map.put("birthday", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getBirth()))); //生日 |
| 2247 | - map.put("age",""); //当前月龄 | |
| 2270 | + map.put("age",StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), checkModel.getCheckDate()))); //检查月龄 | |
| 2248 | 2271 | map.put("height",checkModel.getHeight()); //身长 |
| 2249 | 2272 | map.put("weight", checkModel.getWeight()); //体重 |
| 2250 | 2273 | map.put("growthEvaluate",checkModel.getGrowthEvaluate()); //体格发育评价 |
| ... | ... | @@ -2280,7 +2303,8 @@ |
| 2280 | 2303 | } |
| 2281 | 2304 | } |
| 2282 | 2305 | |
| 2283 | - BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 2306 | + BaseListResponse objectResponse = new BaseListResponse(); | |
| 2307 | + objectResponse.setPageInfo(babyQuery.getPageInfo()); | |
| 2284 | 2308 | objectResponse.setData(results); |
| 2285 | 2309 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 2286 | 2310 | objectResponse.setErrormsg("成功"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
View file @
6ccc953
| ... | ... | @@ -74,6 +74,28 @@ |
| 74 | 74 | |
| 75 | 75 | private String isArea; |
| 76 | 76 | |
| 77 | + //检查项类型 1身长 2 体重 | |
| 78 | + private String itemType; | |
| 79 | + | |
| 80 | + //评价 | |
| 81 | + private String evaluate; | |
| 82 | + | |
| 83 | + public String getItemType() { | |
| 84 | + return itemType; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setItemType(String itemType) { | |
| 88 | + this.itemType = itemType; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public String getEvaluate() { | |
| 92 | + return evaluate; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setEvaluate(String evaluate) { | |
| 96 | + this.evaluate = evaluate; | |
| 97 | + } | |
| 98 | + | |
| 77 | 99 | public String getHospitalProvinceId() { |
| 78 | 100 | return hospitalProvinceId; |
| 79 | 101 | } |