| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | } |
| | | |
| | | /** |
| | | * 统计用户套餐使用情况 |
| | | * 统计用户所有套餐剩余 |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @return |
| | |
| | | Map<String,Object> selectMap=new HashMap<>(); |
| | | selectMap.put("hospitalId",hospitalId); |
| | | List<ProductOrderJoinDetail> productOrderDetailList=productOrderDetailService.findAllList(selectMap); |
| | | Long userAICount=0l; |
| | | if (productOrderDetailList.size()>0) { |
| | | // |
| | | //包含共享的数据 |
| | | List<ProductOrderJoinDetail> productOrderJoinDetailListShare=productOrderDetailList.stream().filter(f->f.getIsShare()).collect(Collectors.toList()); |
| | | //科室私有的数据 |
| | | List<ProductOrderJoinDetail> productOrderJoinDetailsListDep=productOrderDetailList.stream().filter((f->departmentId.equals(f.getDepartmentId())&&f.getIsShare()==false)).collect(Collectors.toList()); |
| | | //本医院可共享的读片总量 |
| | | Long shareCount=productOrderJoinDetailListShare.stream().collect(Collectors.summingLong(ProductOrderJoinDetail::getAilightCount)); |
| | | //本科室私有读片总量 |
| | | Long depCount=productOrderJoinDetailsListDep.stream().collect(Collectors.summingLong(ProductOrderJoinDetail::getAilightCount)); |
| | | //可用的总量 |
| | | userAICount=shareCount+depCount; |
| | | } |
| | | return null; |
| | | return ResultBody.ok().data(userAICount); |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed("医院和科室数据有误!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |