Commit 6eda38356d9fb34ddfb56063060eb9cf09e722c7
1 parent
a609c6e912
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 90 additions and 40 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyNutritionSpecialtyController.java
View file @
6eda383
| ... | ... | @@ -108,7 +108,16 @@ |
| 108 | 108 | public BaseResponse queryOne(BabyNutritionSpecialtyModelQuery babyNutritionSpecialtyModelQuery, HttpServletRequest request) { |
| 109 | 109 | return babyNutritionSpecialtyFacade.queryOne(babyNutritionSpecialtyModelQuery,getUserId(request)); |
| 110 | 110 | } |
| 111 | - | |
| 111 | + /** | |
| 112 | + * 查询单人所有营养专科检查历史记录 | |
| 113 | + * | |
| 114 | + */ | |
| 115 | + @RequestMapping(value = "/queryOneList", method = RequestMethod.GET) | |
| 116 | + @ResponseBody | |
| 117 | + @TokenRequired | |
| 118 | + public BaseResponse queryOneList(BabyNutritionSpecialtyModelQuery babyNutritionSpecialtyModelQuery, HttpServletRequest request) { | |
| 119 | + return babyNutritionSpecialtyFacade.queryOneList(babyNutritionSpecialtyModelQuery,getUserId(request)); | |
| 120 | + } | |
| 112 | 121 | /** |
| 113 | 122 | * 查询全部所有心理专科检查记录 |
| 114 | 123 | * |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionSpecialtyFacade.java
View file @
6eda383
| ... | ... | @@ -26,9 +26,7 @@ |
| 26 | 26 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | 27 | import org.springframework.stereotype.Component; |
| 28 | 28 | |
| 29 | -import java.util.ArrayList; | |
| 30 | -import java.util.Date; | |
| 31 | -import java.util.List; | |
| 29 | +import java.util.*; | |
| 32 | 30 | |
| 33 | 31 | /** |
| 34 | 32 | * 营养专科 逻辑处理 |
| ... | ... | @@ -140,14 +138,14 @@ |
| 140 | 138 | |
| 141 | 139 | } |
| 142 | 140 | |
| 143 | - /** | |
| 144 | - * 新增 营养专科检查 | |
| 145 | - * | |
| 146 | - * @param request | |
| 147 | - * @param userId | |
| 148 | - * @Author: 武涛涛 | |
| 149 | - * @Date: 2020/8/14 10:55 | |
| 150 | - */ | |
| 141 | + /** | |
| 142 | + * 新增 营养专科检查 | |
| 143 | + * | |
| 144 | + * @param request | |
| 145 | + * @param userId | |
| 146 | + * @Author: 武涛涛 | |
| 147 | + * @Date: 2020/8/14 10:55 | |
| 148 | + */ | |
| 151 | 149 | public BaseResponse add(BabyNutritionSpecialtyRequest request, Integer userId) { |
| 152 | 150 | |
| 153 | 151 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| ... | ... | @@ -163,7 +161,7 @@ |
| 163 | 161 | model.setCreateDate(new Date()); |
| 164 | 162 | model.setHospitalId(hospitalId); |
| 165 | 163 | model = babyBabyNSService.add(model); |
| 166 | - if (model!=null && model.getId()!=null) { | |
| 164 | + if (model != null && model.getId() != null) { | |
| 167 | 165 | operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), model, model, OptActionEnums.ADD.getId(), "新增营养专科检查"); |
| 168 | 166 | } |
| 169 | 167 | BaseObjectResponse br = new BaseObjectResponse(); |
| 170 | 168 | |
| ... | ... | @@ -181,13 +179,13 @@ |
| 181 | 179 | * @Author: 武涛涛 |
| 182 | 180 | * @Date: 2020/8/14 10:55 |
| 183 | 181 | */ |
| 184 | - public BaseResponse update (BabyNutritionSpecialtyRequest request, Integer userId) { | |
| 182 | + public BaseResponse update(BabyNutritionSpecialtyRequest request, Integer userId) { | |
| 185 | 183 | //当前登录人医院Id |
| 186 | 184 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 187 | 185 | BabyNutritionSpecialtyModel model = getBabyNutritionSpecialtyModel(request); |
| 188 | 186 | BabyNutritionSpecialtyModel models = babyBabyNSService.queryById(request.getId()); |
| 189 | 187 | |
| 190 | - if (models !=null && models.getId()!=null) { | |
| 188 | + if (models != null && models.getId() != null) { | |
| 191 | 189 | babyBabyNSService.update(model, request.getId()); |
| 192 | 190 | operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), models, model, OptActionEnums.UPDATE.getId(), "修改营养专科检查"); |
| 193 | 191 | } |
| ... | ... | @@ -203,8 +201,8 @@ |
| 203 | 201 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 204 | 202 | |
| 205 | 203 | //查询营养专科记录 |
| 206 | - BabyNutritionSpecialtyModel checkModel = babyBabyNSService.queryById(id); | |
| 207 | - if(checkModel !=null && checkModel.getId()!= null){ | |
| 204 | + BabyNutritionSpecialtyModel checkModel = babyBabyNSService.queryById(id); | |
| 205 | + if (checkModel != null && checkModel.getId() != null) { | |
| 208 | 206 | babyBabyNSService.deleteById(id); |
| 209 | 207 | operateLogFacade.addDeleteOptLog(userId, Integer.valueOf(hospitalId), checkModel, OptActionEnums.DELETE.getId(), "删除营养专科检查"); |
| 210 | 208 | |
| 211 | 209 | |
| 212 | 210 | |
| 213 | 211 | |
| 214 | 212 | |
| ... | ... | @@ -221,21 +219,21 @@ |
| 221 | 219 | public BaseObjectResponse queryByIdShow(String id) { |
| 222 | 220 | |
| 223 | 221 | BaseObjectResponse br = new BaseObjectResponse(); |
| 224 | - if(StringUtils.isNotEmpty(id)){ | |
| 222 | + if (StringUtils.isNotEmpty(id)) { | |
| 225 | 223 | BabyNutritionSpecialtyModel babyNutritionSpecialtyModel = babyBabyNSService.queryById(id); |
| 226 | 224 | BabyNutritionSpecialtyResult babyNutritionSpecialtyResult = new BabyNutritionSpecialtyResult(); |
| 227 | 225 | babyNutritionSpecialtyResult.convertToShowResult(babyNutritionSpecialtyModel); |
| 228 | - if(CollectionUtils.isNotEmpty(babyNutritionSpecialtyModel.getmHighRiskReason())){ | |
| 226 | + if (CollectionUtils.isNotEmpty(babyNutritionSpecialtyModel.getmHighRiskReason())) { | |
| 229 | 227 | babyNutritionSpecialtyResult.setmHighRiskReason(mongoUtil.findColor(babyNutritionSpecialtyModel.getmHighRiskReason())); |
| 230 | 228 | } |
| 231 | 229 | |
| 232 | - if(StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getCheckDoctor())){ | |
| 230 | + if (StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getCheckDoctor())) { | |
| 233 | 231 | Users users = usersService.getUsers(NumberUtils.toInt(babyNutritionSpecialtyModel.getCheckDoctor())); |
| 234 | - if(users!=null && StringUtils.isNotEmpty(users.getName())){ | |
| 232 | + if (users != null && StringUtils.isNotEmpty(users.getName())) { | |
| 235 | 233 | babyNutritionSpecialtyResult.setCheckDoctor(users.getName()); |
| 236 | 234 | } |
| 237 | 235 | } |
| 238 | - if(StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getHospitalId())){ | |
| 236 | + if (StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getHospitalId())) { | |
| 239 | 237 | babyNutritionSpecialtyResult.setHospitalName(CommonsHelper.getHospitalName(babyNutritionSpecialtyModel.getHospitalId(), organizationService)); |
| 240 | 238 | } |
| 241 | 239 | br.setData(babyNutritionSpecialtyResult); |
| ... | ... | @@ -255,7 +253,7 @@ |
| 255 | 253 | public BaseObjectResponse queryByIdEdit(String id) { |
| 256 | 254 | |
| 257 | 255 | BaseObjectResponse br = new BaseObjectResponse(); |
| 258 | - if(StringUtils.isNotEmpty(id)){ | |
| 256 | + if (StringUtils.isNotEmpty(id)) { | |
| 259 | 257 | BabyNutritionSpecialtyModel babyNutritionSpecialtyModel = babyBabyNSService.queryById(id); |
| 260 | 258 | BabyNutritionSpecialtyResult babyNutritionSpecialtyResult = new BabyNutritionSpecialtyResult(); |
| 261 | 259 | babyNutritionSpecialtyResult.convertToResult(babyNutritionSpecialtyModel); |
| 262 | 260 | |
| ... | ... | @@ -280,10 +278,10 @@ |
| 280 | 278 | |
| 281 | 279 | BaseObjectResponse br = new BaseObjectResponse(); |
| 282 | 280 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 283 | - List<BabyNutritionSpecialtyResult> babyNutritionSpecialtyResults = new ArrayList<>(); | |
| 281 | + List <BabyNutritionSpecialtyResult> babyNutritionSpecialtyResults = new ArrayList <>(); | |
| 284 | 282 | //单人多条专病记录 |
| 285 | - List<BabyNutritionSpecialtyModel> babyNutritionSpecialtyModelList = new ArrayList<>(); | |
| 286 | - if( StringUtils.isNotEmpty(babyQuery.getBuildId()) || StringUtils.isNotEmpty(babyQuery.getYyProject())){ | |
| 283 | + List <BabyNutritionSpecialtyModel> babyNutritionSpecialtyModelList = new ArrayList <>(); | |
| 284 | + if (StringUtils.isNotEmpty(babyQuery.getBuildId()) || StringUtils.isNotEmpty(babyQuery.getYyProject())) { | |
| 287 | 285 | babyQuery.setYn(YnEnums.YES.getId()); |
| 288 | 286 | babyQuery.setHospitalId(hospitalId); |
| 289 | 287 | babyQuery.setSort("checkDate"); |
| 290 | 288 | |
| ... | ... | @@ -293,9 +291,9 @@ |
| 293 | 291 | for (int i = 0; i < babyNutritionSpecialtyModelList.size(); i++) { |
| 294 | 292 | BabyNutritionSpecialtyModel babyNutritionSpecialtyModel = babyNutritionSpecialtyModelList.get(i); |
| 295 | 293 | BabyNutritionSpecialtyResult babyNutritionSpecialtyResult = new BabyNutritionSpecialtyResult(); |
| 296 | - if(babyNutritionSpecialtyModel !=null ){ | |
| 294 | + if (babyNutritionSpecialtyModel != null) { | |
| 297 | 295 | babyNutritionSpecialtyResult.convertToResult(babyNutritionSpecialtyModel); |
| 298 | - if(StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getHospitalId())){ | |
| 296 | + if (StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getHospitalId())) { | |
| 299 | 297 | babyNutritionSpecialtyResult.setHospitalName(CommonsHelper.getHospitalName(babyNutritionSpecialtyModel.getHospitalId(), organizationService)); |
| 300 | 298 | } |
| 301 | 299 | babyNutritionSpecialtyResults.add(babyNutritionSpecialtyResult); |
| ... | ... | @@ -309,6 +307,49 @@ |
| 309 | 307 | |
| 310 | 308 | } |
| 311 | 309 | |
| 310 | + public BaseObjectResponse queryOneList(BabyNutritionSpecialtyModelQuery babyQuery, Integer userId) { | |
| 311 | + | |
| 312 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 313 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 314 | + Map map = new HashMap <>(); | |
| 315 | + map.put("dbznl",getBabyNutritionSpecialtyResults(babyQuery, hospitalId, "dbznl")); | |
| 316 | + map.put("pxet",getBabyNutritionSpecialtyResults(babyQuery, hospitalId, "pxet")); | |
| 317 | + map.put("jlbet",getBabyNutritionSpecialtyResults(babyQuery, hospitalId, "jlbet")); | |
| 318 | + map.put("fpetjc",getBabyNutritionSpecialtyResults(babyQuery, hospitalId, "fpetjc")); | |
| 319 | + br.setData(map); | |
| 320 | + br.setPageInfo(babyQuery.getPageInfo()); | |
| 321 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 322 | + br.setErrormsg("成功"); | |
| 323 | + return br; | |
| 324 | + | |
| 325 | + } | |
| 326 | + | |
| 327 | + private List <BabyNutritionSpecialtyResult> getBabyNutritionSpecialtyResults(BabyNutritionSpecialtyModelQuery babyQuery, String hospitalId, String yyProject) { | |
| 328 | + List <BabyNutritionSpecialtyResult> babyNutritionSpecialtyResults = new ArrayList <>(); | |
| 329 | + babyQuery.setYyProject(yyProject); | |
| 330 | + //单人多条专病记录 | |
| 331 | + List <BabyNutritionSpecialtyModel> babyNutritionSpecialtyModelList = new ArrayList <>(); | |
| 332 | + if (StringUtils.isNotEmpty(babyQuery.getBuildId()) || StringUtils.isNotEmpty(babyQuery.getYyProject())) { | |
| 333 | + babyQuery.setYn(YnEnums.YES.getId()); | |
| 334 | + babyQuery.setHospitalId(hospitalId); | |
| 335 | + babyQuery.setSort("checkDate"); | |
| 336 | + babyNutritionSpecialtyModelList = babyBabyNSService.queryOne(babyQuery); | |
| 337 | + | |
| 338 | + } | |
| 339 | + for (int i = 0; i < babyNutritionSpecialtyModelList.size(); i++) { | |
| 340 | + BabyNutritionSpecialtyModel babyNutritionSpecialtyModel = babyNutritionSpecialtyModelList.get(i); | |
| 341 | + BabyNutritionSpecialtyResult babyNutritionSpecialtyResult = new BabyNutritionSpecialtyResult(); | |
| 342 | + if (babyNutritionSpecialtyModel != null) { | |
| 343 | + babyNutritionSpecialtyResult.convertToResult(babyNutritionSpecialtyModel); | |
| 344 | + if (StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getHospitalId())) { | |
| 345 | + babyNutritionSpecialtyResult.setHospitalName(CommonsHelper.getHospitalName(babyNutritionSpecialtyModel.getHospitalId(), organizationService)); | |
| 346 | + } | |
| 347 | + babyNutritionSpecialtyResults.add(babyNutritionSpecialtyResult); | |
| 348 | + } | |
| 349 | + } | |
| 350 | + return babyNutritionSpecialtyResults; | |
| 351 | + } | |
| 352 | + | |
| 312 | 353 | /** |
| 313 | 354 | * 查询全部所有营养专科检查记录 |
| 314 | 355 | * |
| 315 | 356 | |
| 316 | 357 | |
| 317 | 358 | |
| 318 | 359 | |
| 319 | 360 | |
| 320 | 361 | |
| 321 | 362 | |
| ... | ... | @@ -321,34 +362,34 @@ |
| 321 | 362 | |
| 322 | 363 | BaseObjectResponse br = new BaseObjectResponse(); |
| 323 | 364 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 324 | - List<BabyNutritionSpecialtyResult> babyNutritionSpecialtyResults = new ArrayList<>(); | |
| 365 | + List <BabyNutritionSpecialtyResult> babyNutritionSpecialtyResults = new ArrayList <>(); | |
| 325 | 366 | //单人多条专病记录 |
| 326 | - List<BabyNutritionSpecialtyModel> babyNutritionSpecialtyModelList = new ArrayList<>(); | |
| 327 | - if(StringUtils.isEmpty(babyQuery.getBuildId()) ){ | |
| 367 | + List <BabyNutritionSpecialtyModel> babyNutritionSpecialtyModelList = new ArrayList <>(); | |
| 368 | + if (StringUtils.isEmpty(babyQuery.getBuildId())) { | |
| 328 | 369 | babyQuery.setNeed("true"); |
| 329 | 370 | babyQuery.setYn(YnEnums.YES.getId()); |
| 330 | 371 | babyQuery.setHospitalId(hospitalId); |
| 331 | 372 | babyQuery.setSort("createDate"); |
| 332 | - if(babyQuery.getCheckDateEnd()!=null){ | |
| 373 | + if (babyQuery.getCheckDateEnd() != null) { | |
| 333 | 374 | babyQuery.setCheckDateEnd(DateUtil.getDayLastSecond(babyQuery.getCheckDateEnd())); |
| 334 | 375 | } |
| 335 | - if(babyQuery.getNextDateEnd()!=null){ | |
| 376 | + if (babyQuery.getNextDateEnd() != null) { | |
| 336 | 377 | babyQuery.setNextDateEnd(DateUtil.getDayLastSecond(babyQuery.getNextDateEnd())); |
| 337 | 378 | } |
| 338 | - if(babyQuery.getBirthEnd()!=null){ | |
| 379 | + if (babyQuery.getBirthEnd() != null) { | |
| 339 | 380 | babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); |
| 340 | 381 | } |
| 341 | - if(babyQuery.getcCDateEnd()!=null){ | |
| 342 | - babyQuery.setcCDateEnd(DateUtil.getDayLastSecond(babyQuery.getcCDateEnd())); | |
| 343 | - } | |
| 382 | + if (babyQuery.getcCDateEnd() != null) { | |
| 383 | + babyQuery.setcCDateEnd(DateUtil.getDayLastSecond(babyQuery.getcCDateEnd())); | |
| 384 | + } | |
| 344 | 385 | |
| 345 | - babyNutritionSpecialtyModelList = babyBabyNSService.queryAll(babyQuery); | |
| 386 | + babyNutritionSpecialtyModelList = babyBabyNSService.queryAll(babyQuery); | |
| 346 | 387 | System.out.println(babyQuery.convertToQuery().convertToMongoQuery()); |
| 347 | 388 | } |
| 348 | 389 | for (int i = 0; i < babyNutritionSpecialtyModelList.size(); i++) { |
| 349 | 390 | BabyNutritionSpecialtyModel babyNutritionSpecialtyModel = babyNutritionSpecialtyModelList.get(i); |
| 350 | - BabyNutritionSpecialtyResult babyNutritionSpecialtyResult= new BabyNutritionSpecialtyResult(); | |
| 351 | - if(babyNutritionSpecialtyModel !=null ){ | |
| 391 | + BabyNutritionSpecialtyResult babyNutritionSpecialtyResult = new BabyNutritionSpecialtyResult(); | |
| 392 | + if (babyNutritionSpecialtyModel != null) { | |
| 352 | 393 | babyNutritionSpecialtyResult.convertToResult(babyNutritionSpecialtyModel); |
| 353 | 394 | babyNutritionSpecialtyResult.setHospitalId(CommonsHelper.getHospitalName(babyNutritionSpecialtyModel.getHospitalId(), organizationService)); |
| 354 | 395 | babyNutritionSpecialtyResults.add(babyNutritionSpecialtyResult); |