| | |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.oprationcenter.model.HospitalInfo; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return productOrderDetailService.all(params); |
| | | } |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("alldetail") |
| | | public PageResult alldetail(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.departmentProductDetail(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | |
| | | } |
| | | return productOrderDetailService.groupList(params); |
| | | } |
| | | |
| | | /** |
| | | * 查询到期列表 |
| | | */ |
| | | @ApiOperation(value = "查询到期列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/productEnd") |
| | | public PageResult productEndList(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.productEndList(params); |
| | | } |
| | | /** |
| | | * 获取医院套餐是否到期和到期时间 |
| | | * data内 isend为true说明套餐到期 |
| | |
| | | * |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @param diagnosticId |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "获取医院套餐是否到期和到期时间") |
| | | @GetMapping("/UserProductDetailData") |
| | | public ResultBody UserProductDetailData(@RequestParam Long hospitalId, @RequestParam Long departmentId) { |
| | | return productOrderDetailService.UserProductDetailData(hospitalId, departmentId); |
| | | public ResultBody<UserProductData> serProductDetailData(@RequestParam Long hospitalId, @RequestParam Long departmentId,@RequestParam String diagnosticId) { |
| | | return productOrderDetailService.userProductDetailData(hospitalId, departmentId,diagnosticId); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiOperation(value = "获取医院套餐是否到期和到期时间") |
| | | @PostMapping("/serviceperiod") |
| | | public ResultBody<UserProductData> ServicePeriod(@RequestBody HospitalInfo hospitalInfo) { |
| | | return productOrderDetailService.UserProductDetailData(hospitalInfo.getHospitalId(), hospitalInfo.getDepartmentId()); |
| | | public ResultBody<UserProductData> servicePeriod(@RequestBody HospitalInfo hospitalInfo) { |
| | | return productOrderDetailService.userProductDetailData(hospitalInfo.getHospitalId(), hospitalInfo.getDepartmentId(),hospitalInfo.getDiagnosticId()); |
| | | } |
| | | |
| | | /** |
| | |
| | | List<OrderChartVo> orderChartVo=productOrderDetailService.proCountChart(); |
| | | return ResultBody.ok().data(orderChartVo).msg("数据获取成功!") ; |
| | | } |
| | | |
| | | /** |
| | | * 获取软件服务周期 和 读片总量 |
| | | * |
| | | */ |
| | | @ApiOperation(value = "获取软件服务周期") |
| | | @GetMapping("/getContractBeginEndTimeAndNum") |
| | | public ResultBody getContractBeginEndTimeAndNum(@RequestParam("departmentId") Long departmentId) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("department_id",departmentId); |
| | | map.put("enabled",true); |
| | | map.put("is_del",false); |
| | | List<ProductOrder> productOrders = productOrderService.listByMap(map); |
| | | map = new HashMap<>(); |
| | | if(productOrders!=null&&productOrders.size()>0){ |
| | | IntSummaryStatistics intSummaryStatistics = productOrders.stream().filter(a-> a.getContractNum()!=null&&a.getEnabled()).mapToInt((x) -> x.getContractNum()).summaryStatistics(); |
| | | Date minDate = productOrders.stream().filter(a->a.getEnabled()).map(e -> e.getContractBeginTime()).min((e1, e2) -> e1.compareTo(e2)).get(); |
| | | Date manDate = productOrders.stream().filter(a->a.getEnabled()).map(e -> e.getContractEndTime()).max((e1, e2) -> e1.compareTo(e2)).get(); |
| | | map.put("count", intSummaryStatistics.getSum()); |
| | | map.put("beginTime",DateUtils.formatDate(minDate,"yyyy-MM-dd HH:mm:ss")); |
| | | map.put("endTime",DateUtils.formatDate(manDate,"yyyy-MM-dd HH:mm:ss")); |
| | | } |
| | | return ResultBody.ok().data(map); |
| | | } |
| | | } |