Commit 51c32018337e6ba5be12e9679ab5bc57430cadb2
1 parent
b9046d3ac3
Exists in
master
and in
6 other branches
听力诊断模块
Showing 6 changed files with 87 additions and 33 deletions
- platform-biz-service/src/main/resources/mainOrm/master/HighriskChangeHospital.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEarController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearingDiagnoseController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
platform-biz-service/src/main/resources/mainOrm/master/HighriskChangeHospital.xml
View file @
51c3201
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <mapper namespace="com.lyms.platform.permission.dao.master.HighriskChangeHospitalMapper"> |
4 | 4 | |
5 | 5 | <resultMap id="HighriskChangeHospitalResultMap" type="com.lyms.platform.permission.model.HighriskChangeHospital"> |
6 | - <result column="ID" property="id" jdbcType="VARCHAR"/> | |
6 | + <id column="ID" property="id" jdbcType="VARCHAR"/> | |
7 | 7 | <result column="TARGET_TYPE" property="targetType" jdbcType="INTEGER"/> |
8 | 8 | <result column="TARGET_ID" property="targetId" jdbcType="VARCHAR"/> |
9 | 9 | <result column="OUT_ORGID" property="outOrgid" jdbcType="VARCHAR"/> |
... | ... | @@ -31,9 +31,6 @@ |
31 | 31 | <update id="updateHighriskChangeHospital" parameterType="com.lyms.platform.permission.model.HighriskChangeHospital"> |
32 | 32 | update HIGHRISK_CHANGE_HOSPITAL |
33 | 33 | <set> |
34 | - <if test="id != null and id != ''"> | |
35 | - ID = #{id,jdbcType=VARCHAR}, | |
36 | - </if> | |
37 | 34 | <if test="targetType != null and targetType >= 0"> |
38 | 35 | TARGET_TYPE = #{targetType,jdbcType=INTEGER}, |
39 | 36 | </if> |
... | ... | @@ -83,6 +80,7 @@ |
83 | 80 | SCRREEN_ID = #{scrreenId,jdbcType=VARCHAR}, |
84 | 81 | </if> |
85 | 82 | </set> |
83 | + where id = #{id,jdbcType=VARCHAR} | |
86 | 84 | </update> |
87 | 85 | |
88 | 86 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEarController.java
View file @
51c3201
... | ... | @@ -139,8 +139,9 @@ |
139 | 139 | @RequestMapping(value = "/babyearsrc/{babyId}",method = RequestMethod.GET) |
140 | 140 | @ResponseBody |
141 | 141 | @TokenRequired |
142 | - public BaseResponse getBabyIdBabySrc(@PathVariable("babyId")String babyId){ | |
143 | - return babyEarFacade.findBabyEarSrc(babyId); | |
142 | + public BaseResponse getBabyIdBabySrc(@PathVariable("babyId")String babyId,HttpServletRequest httpServletRequest){ | |
143 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
144 | + return babyEarFacade.findBabyEarSrc(babyId, loginState.getId()); | |
144 | 145 | } |
145 | 146 | /** |
146 | 147 | * 获取听筛记录 |
... | ... | @@ -164,8 +165,9 @@ |
164 | 165 | @RequestMapping(value = "/babyearListsrc",method = RequestMethod.GET) |
165 | 166 | @ResponseBody |
166 | 167 | @TokenRequired |
167 | - public BaseResponse babyearListsrc(EarScreenListRequest earScreenListRequest){ | |
168 | - return babyEarFacade.findListBabyEarSrc(earScreenListRequest); | |
168 | + public BaseResponse babyearListsrc(EarScreenListRequest earScreenListRequest,HttpServletRequest httpServletRequest){ | |
169 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
170 | + return babyEarFacade.findListBabyEarSrc(earScreenListRequest,loginState.getId()); | |
169 | 171 | } |
170 | 172 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FollowUpController.java
View file @
51c3201
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | import com.lyms.platform.common.result.BaseResponse; |
12 | 12 | import com.lyms.platform.common.utils.DateUtil; |
13 | 13 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
14 | +import com.lyms.platform.operate.web.facade.BabyEarFacade; | |
14 | 15 | import com.lyms.platform.operate.web.request.FollowUpRequest; |
15 | 16 | import com.lyms.platform.operate.web.result.FollowUpListResult; |
16 | 17 | import com.lyms.platform.operate.web.result.FollowUpOneResult; |
17 | 18 | |
... | ... | @@ -57,8 +58,9 @@ |
57 | 58 | private OrganizationService organizationService; |
58 | 59 | @Autowired |
59 | 60 | private BabyBookbuildingService babyBookbuildingService; |
61 | + @Autowired | |
62 | + private BabyEarFacade babyEarFacade; | |
60 | 63 | |
61 | - | |
62 | 64 | /** |
63 | 65 | * 根据babyId获取随访记录 |
64 | 66 | * |
65 | 67 | |
66 | 68 | |
... | ... | @@ -74,17 +76,19 @@ |
74 | 76 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请传入儿童ID"); |
75 | 77 | } |
76 | 78 | |
77 | - BabyPatientExtendEarFollowUpQuery query = new BabyPatientExtendEarFollowUpQuery(); | |
78 | - query.setBabyId(babyId); | |
79 | - query.setSort("follow_time"); | |
80 | 79 | //获取当前登录用户ID |
81 | 80 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
82 | 81 | if (loginState == null) { |
83 | 82 | return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("请重新登录"); |
84 | 83 | } |
84 | + | |
85 | + BabyPatientExtendEarFollowUpQuery query = new BabyPatientExtendEarFollowUpQuery(); | |
86 | + query.setBabyId(babyId); | |
87 | + query.setSort("follow_time"); | |
85 | 88 | //当前登录人医院Id |
86 | - // String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); | |
87 | - // query.setHospitalId(hospitalId); | |
89 | + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); | |
90 | + List hospitalIds = babyEarFacade.getOrgHospitalIds(hospitalId); | |
91 | + query.setCheckHospitalIds((String[]) hospitalIds.toArray(new String[hospitalIds.size()])); | |
88 | 92 | |
89 | 93 | List<BabyPatientExtendEarFollowUp> followUpList = babyPatientExtendEarFollowUpService.queryBabyPatientExtendEarFollowUpByBaby(query); |
90 | 94 | List<Map<String,String>> list = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HearingDiagnoseController.java
View file @
51c3201
... | ... | @@ -267,7 +267,11 @@ |
267 | 267 | hospitalIds.add(h.getOutOrgid()); |
268 | 268 | } |
269 | 269 | } |
270 | - // query.setCheckHospitalIds((String[]) hospitalIds.toArray(new String[hospitalIds.size()])); | |
270 | + | |
271 | + //当前登录人医院Id | |
272 | + List hospiIds = babyEarFacade.getOrgHospitalIds(hospitalId); | |
273 | + hospitalIds.addAll(hospiIds); | |
274 | + query.setCheckHospitalIds((String[]) hospitalIds.toArray(new String[hospitalIds.size()])); | |
271 | 275 | query.setSort("diagnose_time"); |
272 | 276 | List<BabyPatientExtendEarHearingDiagnose> behdList = hearingDiagnoseService.queryBabyPatientExtendEarHearingDiagnose(query); |
273 | 277 | List<Map<String, String>> list = new ArrayList<>(); |
... | ... | @@ -322,6 +326,9 @@ |
322 | 326 | //当前医院 |
323 | 327 | outOrgids.add(hospitalId); |
324 | 328 | } else {//4.全部医院/默认全部医院 |
329 | + //当前登录人区域医院Id | |
330 | + List hospiIds = babyEarFacade.getOrgHospitalIds(hospitalId); | |
331 | + outOrgids.addAll(hospiIds); | |
325 | 332 | //当前医院 |
326 | 333 | outOrgids.add(hospitalId); |
327 | 334 | //转诊过来的医院id |
... | ... | @@ -338,6 +345,9 @@ |
338 | 345 | } |
339 | 346 | } |
340 | 347 | } else { |
348 | + //当前登录人区域医院Id | |
349 | + List hospiIds = babyEarFacade.getOrgHospitalIds(hospitalId); | |
350 | + outOrgids.addAll(hospiIds); | |
341 | 351 | //当前医院 |
342 | 352 | outOrgids.add(hospitalId); |
343 | 353 | } |
... | ... | @@ -358,6 +368,8 @@ |
358 | 368 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("没有找到数据"); |
359 | 369 | } |
360 | 370 | } |
371 | + | |
372 | + | |
361 | 373 | |
362 | 374 | scrQuery.setCheckHospitalIds((String[]) outOrgids.toArray(new String[outOrgids.size()])); |
363 | 375 | if(scrQuery.getCheckHospitalIds()==null||scrQuery.getCheckHospitalIds().length==0){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
51c3201
... | ... | @@ -158,23 +158,23 @@ |
158 | 158 | //区域范围内孕妇 |
159 | 159 | if (isRegion) { |
160 | 160 | List<String> hospitalList = null; |
161 | - //王平说的 必须要给区域医院权限,不然他就是蠢逼 201611124 16:41 | |
162 | - hospitalList = new ArrayList<>(); | |
163 | - String hospital = autoMatchFacade.getHospitalId(userId); | |
164 | - if (null != hospital) { | |
165 | - hospitalList.add(hospital); | |
166 | - } | |
167 | - DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
168 | - dataPermissionsModelQuery.setUserId(userId); | |
169 | - List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
170 | - if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
171 | - Set<String> set = permissionsModels.get(0).getData().keySet(); | |
172 | - Iterator<String> it = set.iterator(); | |
173 | - while (it.hasNext()) { | |
174 | - String id = it.next(); | |
175 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(id) && !hospitalList.contains(id)) { | |
176 | - hospitalList.add(id); | |
161 | + //王平说的 必须要给区域医院权限,不然他就是蠢逼 201611124 16:41 | |
162 | + hospitalList = new ArrayList<>(); | |
163 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
164 | + if (null != hospital) { | |
165 | + hospitalList.add(hospital); | |
177 | 166 | } |
167 | + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
168 | + dataPermissionsModelQuery.setUserId(userId); | |
169 | + List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
170 | + if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
171 | + Set<String> set = permissionsModels.get(0).getData().keySet(); | |
172 | + Iterator<String> it = set.iterator(); | |
173 | + while (it.hasNext()) { | |
174 | + String id = it.next(); | |
175 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(id) && !hospitalList.contains(id)) { | |
176 | + hospitalList.add(id); | |
177 | + } | |
178 | 178 | } |
179 | 179 | } |
180 | 180 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
View file @
51c3201
... | ... | @@ -22,6 +22,7 @@ |
22 | 22 | import com.lyms.platform.permission.service.*; |
23 | 23 | import com.lyms.platform.pojo.BabyModel; |
24 | 24 | import com.lyms.platform.pojo.BasicConfig; |
25 | +import com.lyms.platform.pojo.OrganizationGroupsItems; | |
25 | 26 | import com.lyms.platform.pojo.PersonModel; |
26 | 27 | import com.lyms.platform.query.BabyModelQuery; |
27 | 28 | import com.lyms.platform.query.PersonModelQuery; |
... | ... | @@ -91,6 +92,8 @@ |
91 | 92 | private BasicConfigService basicConfigService; |
92 | 93 | @Autowired |
93 | 94 | private AntenatalExaminationFacade examinationFacade; |
95 | + @Autowired | |
96 | + private OrganizationGroupsFacade groupsFacade; | |
94 | 97 | |
95 | 98 | //处理儿童person信息 |
96 | 99 | private PersonModel handBabyPerson(BabyModel baby) { |
97 | 100 | |
98 | 101 | |
... | ... | @@ -1273,16 +1276,46 @@ |
1273 | 1276 | } |
1274 | 1277 | |
1275 | 1278 | /** |
1279 | + * 获取当前医院机构里医院列表 | |
1280 | + * @param hospitalId | |
1281 | + * @return | |
1282 | + */ | |
1283 | + public List<String> getOrgHospitalIds(String hospitalId){ | |
1284 | + List<String> hospitalIds = new ArrayList<>(); | |
1285 | + String groupId= groupsFacade.findItemIdByCurrentUserId(hospitalId); | |
1286 | + if(org.apache.commons.lang.StringUtils.isNotEmpty(groupId)) { | |
1287 | + OrganizationGroupsItems groupsItems = groupsFacade.findById(groupId); | |
1288 | + if (groupsItems!=null) { | |
1289 | + List<Integer> hIds = groupsItems.gethId(); | |
1290 | + for(Integer hd:hIds){ | |
1291 | + hospitalIds.add(String.valueOf(hd)); | |
1292 | + } | |
1293 | + }else{ | |
1294 | + hospitalIds.add(hospitalId); | |
1295 | + } | |
1296 | + }else{ | |
1297 | + hospitalIds.add(hospitalId); | |
1298 | + } | |
1299 | + | |
1300 | + return hospitalIds; | |
1301 | + } | |
1302 | + | |
1303 | + /** | |
1276 | 1304 | * 根据儿童id查询听力筛查记录 |
1277 | 1305 | * |
1278 | 1306 | * @param babyId 听力筛查id |
1279 | 1307 | * @return |
1280 | 1308 | */ |
1281 | - public BaseResponse findBabyEarSrc(String babyId) { | |
1309 | + public BaseResponse findBabyEarSrc(String babyId,Integer userId) { | |
1282 | 1310 | BabyPatientExtendEarScreenQuery query = new BabyPatientExtendEarScreenQuery(); |
1283 | 1311 | query.setBabyId(babyId); |
1284 | 1312 | query.setStatus(0); |
1285 | 1313 | query.setSort("create_date"); |
1314 | + //当前登录人医院Id | |
1315 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
1316 | + List hospitalIds = getOrgHospitalIds(hospitalId); | |
1317 | + String[] checkHospitalIds = (String[])hospitalIds.toArray(new String[hospitalIds.size()]); | |
1318 | + query.setCheckHospitalIds(checkHospitalIds); | |
1286 | 1319 | List<BabyPatientExtendEarScreen> babyPatientExtendEarScreens = babyPatientExtendEarScreenService.queryBabyPatientExtendEarScreen(query); |
1287 | 1320 | |
1288 | 1321 | |
... | ... | @@ -1484,7 +1517,7 @@ |
1484 | 1517 | * @param earScreenListRequest |
1485 | 1518 | * @return |
1486 | 1519 | */ |
1487 | - public BaseResponse findListBabyEarSrc(EarScreenListRequest earScreenListRequest) { | |
1520 | + public BaseResponse findListBabyEarSrc(EarScreenListRequest earScreenListRequest,Integer userId) { | |
1488 | 1521 | BabyPatientExtendEarScreenQuery screenQuery = new BabyPatientExtendEarScreenQuery(); |
1489 | 1522 | screenQuery.setSrcStartTime(earScreenListRequest.getSrcStartTime()); |
1490 | 1523 | screenQuery.setSrcEndTime(earScreenListRequest.getSrcEndTime()); |
... | ... | @@ -1495,6 +1528,11 @@ |
1495 | 1528 | screenQuery.setSrcSkill(earScreenListRequest.getSrcSkill()); |
1496 | 1529 | screenQuery.setNextStartTime(earScreenListRequest.getNextStartTime()); |
1497 | 1530 | screenQuery.setNextEndTime(earScreenListRequest.getNextEndTime()); |
1531 | + //当前登录人医院Id | |
1532 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
1533 | + List hospitalIds = getOrgHospitalIds(hospitalId); | |
1534 | + String[] checkHospitalIds = (String[])hospitalIds.toArray(new String[hospitalIds.size()]); | |
1535 | + screenQuery.setCheckHospitalIds(checkHospitalIds); | |
1498 | 1536 | |
1499 | 1537 | List<BabyPatientExtendEarScreen> babyPatientExtendEarScreens = babyPatientExtendEarScreenService.queryEarScreenList(screenQuery); |
1500 | 1538 | List<EarScreenResult> earScreenResults = new ArrayList<>(); |