| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.github.pagehelper.ISelect; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())){ |
| | | //全部病区 |
| | | String deptInfo = user.getDeptInfo(); |
| | | Gson gson = new Gson(); |
| | | // 3. 定义 List 类型(核心) |
| | | TypeToken<List<String>> typeToken = new TypeToken<List<String>>() {}; |
| | | List<String> leavehospitaldistrictcodes = gson.fromJson(deptInfo, typeToken.getType()); |
| | | List<String> leavehospitaldistrictcodes = JSON.parseArray(deptInfo) |
| | | .stream() |
| | | .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | serviceSubtaskCountReq.setLeavehospitaldistrictcodes(leavehospitaldistrictcodes); |
| | | } |
| | | }else if(statisticaltype==2){ |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())){ |
| | | //全部科室 |
| | | String hospInfo = user.getHospInfo(); |
| | | Gson gson = new Gson(); |
| | | // 3. 定义 List 类型(核心) |
| | | TypeToken<List<String>> typeToken = new TypeToken<List<String>>() {}; |
| | | List<String> deptCodes = gson.fromJson(hospInfo, typeToken.getType()); |
| | | List<String> deptCodes = JSON.parseArray(hospInfo) |
| | | .stream() |
| | | .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | serviceSubtaskCountReq.setDeptcodes(deptCodes); |
| | | } |
| | | } |