| | |
| | | import com.kidgrow.oprationcenter.mapper.ConsumptionRecordMapper; |
| | | import com.kidgrow.oprationcenter.mapper.ProductOrderDetailMapper; |
| | | import com.kidgrow.oprationcenter.model.ConsumptionRecord; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderDetailService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderService; |
| | | import com.kidgrow.oprationcenter.vo.*; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | | import com.kidgrow.usercenter.feign.SysHospitalService; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | |
| | | private SysHospitalService sysHospitalService; |
| | | @Autowired |
| | | private ConsumptionRecordMapper consumptionRecordMapper; |
| | | @Autowired |
| | | private IProductOrderService iProductOrderService; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | public ResultBody UserProductDetailData(Long hospitalId,Long departmentId) |
| | | public ResultBody<UserProductData> UserProductDetailData(Long hospitalId,Long departmentId) |
| | | { |
| | | UserProductData userProductData=new UserProductData(); |
| | | userProductData.setEnd(true); |
| | |
| | | } |
| | | return ResultBody.ok().data(userProductData); |
| | | } |
| | | |
| | | /** |
| | | * 获取需要审核的套餐 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult all(Map<String, Object> params) { |
| | | Page<ProductOrderDetail> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<ProductOrderDetail> list = baseMapper.findList(page, params); |
| | | List<ProductOrderDetailVo> volist=new ArrayList<>(); |
| | | for (ProductOrderDetail productOrderDetail : list) { |
| | | ProductOrderDetailVo productOrderDetailVo=new ProductOrderDetailVo(); |
| | | BeanCopier beanCopier = BeanCopier.create(ProductOrderDetail.class, ProductOrderDetailVo.class, false); |
| | | beanCopier.copy(productOrderDetail,productOrderDetailVo,null); |
| | | //查询医院 |
| | | if(productOrderDetail.getOrderId()!=null){ |
| | | ProductOrder productOrder = iProductOrderService.getById(productOrderDetail.getOrderId()); |
| | | if(productOrder!=null){ |
| | | productOrderDetailVo.setDepartmentId(productOrder.getDepartmentId()); |
| | | productOrderDetailVo.setDepartmentName(productOrder.getDepartmentName()); |
| | | productOrderDetailVo.setHospitalId(productOrder.getHospitalId()); |
| | | productOrderDetailVo.setHospitalName(productOrder.getHospitalName()); |
| | | } |
| | | volist.add(productOrderDetailVo); |
| | | } |
| | | } |
| | | return PageResult.<ProductOrderDetailVo>builder().data(volist).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 获取科室试用次数 |
| | | * @param departmentId 科室ID |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int getEnabledCount(Long departmentId) { |
| | | int counts=baseMapper.getEnabledCount(departmentId); |
| | | return counts; |
| | | } |
| | | /** |
| | | * 统计获取数据量 |
| | | * @param datatype |
| | | * 0 试用审核量 |
| | | * 1 套餐总量 |
| | | * 2 未处理用户反馈 |
| | | * 3 未处理数据需求 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int oprationChart(int datatype) { |
| | | return baseMapper.oprationChart(datatype); |
| | | } |
| | | /** |
| | | * 按指定类型统计合同数量 |
| | | * @param params |
| | | * datatype 1 按年 |
| | | * 2 按月 |
| | | * 3 按天 |
| | | * 4 按周 |
| | | * beginTime 查询时间段的开始时间 |
| | | * endTime 结束时间 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OrderChartVo> productOrderChart(Map<String, Object> params) { |
| | | return baseMapper.productOrderChart(params); |
| | | } |
| | | /** |
| | | * 统计产品的使用数量 |
| | | * @return ccount 是数量 |
| | | * units 是产品名称 |
| | | */ |
| | | @Override |
| | | public List<OrderChartVo> proCountChart() { |
| | | return baseMapper.proCountChart(); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | | * @param params |
| | |
| | | //包含共享的数据 |
| | | userProductDetail.setProductOrderJoinDetailListShare(productOrderDetailList.stream().filter(f -> f.getIsShare()).collect(Collectors.toList())); |
| | | //科室私有的数据 |
| | | userProductDetail.setProductOrderJoinDetailsListDep(productOrderDetailList.stream().filter((f -> departmentId.equals(f.getDepartmentId()) && f.getIsShare() == false)).collect(Collectors.toList())); |
| | | userProductDetail.setProductOrderJoinDetailsListDep(productOrderDetailList.stream().filter((f -> departmentId.equals(f.getDepartmentId()) && !f.getIsShare())).collect(Collectors.toList())); |
| | | return userProductDetail; |
| | | } |
| | | return null; |