Commit 0e137c46d4e960597f9211a81a3157db2909262a
1 parent
903e4acdae
Exists in
master
and in
8 other branches
修改儿童管理接口,只有传入特定的值才会按区域划分
Showing 3 changed files with 63 additions and 33 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
0e137c4
| ... | ... | @@ -189,7 +189,8 @@ |
| 189 | 189 | @RequestParam("limit") Integer limit, |
| 190 | 190 | |
| 191 | 191 | @RequestParam(value = "areaId",required = false) String areaId, |
| 192 | - @RequestParam(value = "hospitalId",required = false) String hospitalId){ | |
| 192 | + @RequestParam(value = "hospitalId",required = false) String hospitalId, | |
| 193 | + @RequestParam(value = "isArea",required = false) String isArea){ | |
| 193 | 194 | LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); |
| 194 | 195 | BabyManageRequest request = new BabyManageRequest(); |
| 195 | 196 | request.setBcardNo(bcardNo); |
| ... | ... | @@ -213,6 +214,8 @@ |
| 213 | 214 | request.setAreaId(areaId); |
| 214 | 215 | // 建档医院 |
| 215 | 216 | request.setHospitalId(hospitalId); |
| 217 | + // 是否区域 | |
| 218 | + request.setIsArea(isArea); | |
| 216 | 219 | |
| 217 | 220 | return babyBookbuildingFacade.queryBabyList(request,loginState.getId()); |
| 218 | 221 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
0e137c4
| ... | ... | @@ -1435,38 +1435,42 @@ |
| 1435 | 1435 | */ |
| 1436 | 1436 | public BaseListResponse queryBabyList(BabyManageRequest request, Integer userId) { |
| 1437 | 1437 | |
| 1438 | - // HuJiaqi注释开始 | |
| 1439 | - // String hospitalId = ""; | |
| 1440 | - | |
| 1441 | - | |
| 1442 | - //得到当前登录的医院id | |
| 1443 | - // if (userId != null) { | |
| 1444 | - // Users dbuser = usersService.getUsers(userId); | |
| 1445 | - // if (dbuser != null) { | |
| 1446 | - // hospitalId = String.valueOf(dbuser.getOrgId()); | |
| 1447 | - // } | |
| 1448 | - // } | |
| 1449 | - // HuJiaqi注释结束 | |
| 1450 | - // 更改原因-从一个医院更改为list | |
| 1451 | 1438 | List<String> hospitalIdList = new ArrayList<>(); |
| 1452 | - if(request.getHospitalId()==null){ | |
| 1453 | - // 没有传入医院,取所有有权限的医院 | |
| 1454 | - OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 1455 | - List<Integer> typeList = new ArrayList<>(); | |
| 1456 | - typeList.add(OrganizationTypeEnum.NY.getId()); | |
| 1457 | - typeList.add(OrganizationTypeEnum.FB.getId()); | |
| 1458 | - typeList.add(OrganizationTypeEnum.JMQY.getId()); | |
| 1459 | - typeList.add(OrganizationTypeEnum.TY.getId()); | |
| 1460 | - organizationQuery.setTypeList(typeList); | |
| 1461 | - List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
| 1462 | - for (Organization organization : organizationList) { | |
| 1463 | - hospitalIdList.add(String.valueOf(organization.getId())); | |
| 1439 | + | |
| 1440 | + if(request.getIsArea().equals(String.valueOf(YnEnums.YES.getId()))){ | |
| 1441 | + // 更改原因-从一个医院更改为list | |
| 1442 | + if(request.getHospitalId()==null){ | |
| 1443 | + // 没有传入医院,取所有有权限的医院 | |
| 1444 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 1445 | + List<Integer> typeList = new ArrayList<>(); | |
| 1446 | + typeList.add(OrganizationTypeEnum.NY.getId()); | |
| 1447 | + typeList.add(OrganizationTypeEnum.FB.getId()); | |
| 1448 | + typeList.add(OrganizationTypeEnum.JMQY.getId()); | |
| 1449 | + typeList.add(OrganizationTypeEnum.TY.getId()); | |
| 1450 | + organizationQuery.setTypeList(typeList); | |
| 1451 | + List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
| 1452 | + for (Organization organization : organizationList) { | |
| 1453 | + hospitalIdList.add(String.valueOf(organization.getId())); | |
| 1454 | + } | |
| 1455 | + }else{ | |
| 1456 | + // 传入了医院,取传入的医院 | |
| 1457 | + hospitalIdList.add(request.getHospitalId()); | |
| 1464 | 1458 | } |
| 1465 | 1459 | }else{ |
| 1466 | - // 传入了医院,取传入的医院 | |
| 1467 | - hospitalIdList.add(request.getHospitalId()); | |
| 1460 | + String hospitalId = ""; | |
| 1461 | + //得到当前登录的医院id | |
| 1462 | + if (userId != null) { | |
| 1463 | + Users dbuser = usersService.getUsers(userId); | |
| 1464 | + if (dbuser != null) { | |
| 1465 | + hospitalId = String.valueOf(dbuser.getOrgId()); | |
| 1466 | + } | |
| 1467 | + } | |
| 1468 | + hospitalIdList.add(hospitalId); | |
| 1468 | 1469 | } |
| 1469 | 1470 | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1470 | 1474 | BabyModelQuery babyQuery = new BabyModelQuery(); |
| 1471 | 1475 | babyQuery.setHospitalIdList(hospitalIdList); |
| 1472 | 1476 | List<BabyModel> models = getBabayListByCondition(request, true, babyQuery); |
| 1473 | 1477 | |
| 1474 | 1478 | |
| 1475 | 1479 | |
| 1476 | 1480 | |
| ... | ... | @@ -1496,16 +1500,29 @@ |
| 1496 | 1500 | |
| 1497 | 1501 | // 开始查询省市区街道 |
| 1498 | 1502 | // 省 |
| 1499 | - String provinceName = basicConfigService.getOneBasicConfigById(model.getProvinceId()).getName(); | |
| 1503 | + BasicConfig provinceName = basicConfigService.getOneBasicConfigById(model.getProvinceId()); | |
| 1500 | 1504 | // 市 |
| 1501 | - String cityName = basicConfigService.getOneBasicConfigById(model.getCityId()).getName(); | |
| 1505 | + BasicConfig cityName = basicConfigService.getOneBasicConfigById(model.getCityId()); | |
| 1502 | 1506 | // 区 |
| 1503 | - String areaName = basicConfigService.getOneBasicConfigById(model.getAreaId()).getName(); | |
| 1507 | + BasicConfig areaName = basicConfigService.getOneBasicConfigById(model.getAreaId()); | |
| 1504 | 1508 | // 街道 |
| 1505 | - String streetName = basicConfigService.getOneBasicConfigById(model.getStreetId()).getName(); | |
| 1509 | + BasicConfig streetName = basicConfigService.getOneBasicConfigById(model.getStreetId()); | |
| 1506 | 1510 | // 具体 |
| 1507 | 1511 | String address = model.getAddress(); |
| 1508 | - String completeAddress = provinceName+cityName+areaName+streetName+address; | |
| 1512 | + String completeAddress = ""; | |
| 1513 | + if(provinceName!=null){ | |
| 1514 | + completeAddress+=provinceName.getName(); | |
| 1515 | + } | |
| 1516 | + if(cityName!=null){ | |
| 1517 | + completeAddress+=cityName.getName(); | |
| 1518 | + } | |
| 1519 | + if(areaName!=null){ | |
| 1520 | + completeAddress+=areaName.getName(); | |
| 1521 | + } | |
| 1522 | + if(streetName!=null){ | |
| 1523 | + completeAddress+=streetName.getName(); | |
| 1524 | + } | |
| 1525 | + completeAddress+=address; | |
| 1509 | 1526 | result.setCompleteAddress(completeAddress); |
| 1510 | 1527 | |
| 1511 | 1528 | String diagnose = ""; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
View file @
0e137c4
| ... | ... | @@ -62,6 +62,16 @@ |
| 62 | 62 | |
| 63 | 63 | private String hospitalId; |
| 64 | 64 | |
| 65 | + private String isArea; | |
| 66 | + | |
| 67 | + public String getIsArea() { | |
| 68 | + return isArea; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setIsArea(String isArea) { | |
| 72 | + this.isArea = isArea; | |
| 73 | + } | |
| 74 | + | |
| 65 | 75 | public String getDateRange() { |
| 66 | 76 | return dateRange; |
| 67 | 77 | } |