From 44c0ac235b54704e550b33c88cb597b8b1d00e01 Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期三, 14 八月 2024 17:56:19 +0800 Subject: [PATCH] update --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 53 insertions(+), 1 deletions(-) diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java index ecb22ee..6b0f76d 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java @@ -1,12 +1,19 @@ package cn.lihu.jh.module.ecg.controller.admin.appointment; +import cn.hutool.core.bean.BeanUtil; +import cn.lihu.jh.framework.common.enums.CommonStatusEnum; import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO; import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; +import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO; +import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO; import cn.lihu.jh.module.ecg.feign.RemoteDataService; import cn.lihu.jh.module.ecg.feign.RestApiReqBodyVo; import cn.lihu.jh.module.ecg.feign.RestApiResult; import cn.lihu.jh.module.ecg.feign.dto.AppointmentExternal; import cn.lihu.jh.module.ecg.service.queue.QueueService; +import cn.lihu.jh.module.ecg.service.room.RoomService; +import cn.lihu.jh.module.system.api.dept.DeptApi; +import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO; import com.alibaba.fastjson.JSONObject; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; @@ -22,6 +29,7 @@ import java.time.format.ResolverStyle; import java.util.*; import java.io.IOException; +import java.util.function.Supplier; import java.util.stream.Collectors; import cn.lihu.jh.framework.common.pojo.PageParam; @@ -58,7 +66,13 @@ private QueueService queueService; @Resource + private RoomService roomService; + + @Resource private RemoteDataService remoteDataService; + + @Resource + private DeptApi deptApi; @PostMapping("/create") @Operation(summary = "鍒涘缓棰勭害") @@ -132,7 +146,9 @@ List<AppointmentExternal> list = result.getRow().stream().map( rawItem -> { - AppointmentExternal appointmentExternal = JSONObject.parseObject(JSONObject.toJSONString(rawItem), AppointmentExternal.class); + //AppointmentExternal appointmentExternal = JSONObject.parseObject(JSONObject.toJSONString(rawItem), AppointmentExternal.class); + AppointmentExternal appointmentExternal = BeanUtil.toBeanIgnoreCase( rawItem, AppointmentExternal.class, true); + return appointmentExternal; } ).collect(Collectors.toList()); @@ -171,6 +187,42 @@ queueService.createqueue(queueSaveReqVO); + + // 鑾峰彇鍊欒瘖鍑嗗鐨勯厤缃汉鏁� 锛� 钀ヤ笟鐨勮瘖瀹� + +/* + List<DeptDO> list = deptService.getDeptList( + new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); + return success(BeanUtils.toBean(list, DeptSimpleRespVO.class)); +*/ + + List<DeptRespDTO> deptRespDTOList = deptApi.getSimpleDeptList(); + Optional<DeptRespDTO> ecgDept = deptRespDTOList.stream() + .filter(a -> a.getName().equals("ECG")) + .findAny(); + + if (ecgDept.isPresent()){ + System.out.println(ecgDept.get().getName()); + + List<DeptRespDTO> list2 = deptRespDTOList.stream() + .filter(a -> Objects.equals(a.getParentId(), ecgDept.get().getId())) + .toList(); + list2.forEach(System.out::println); + list2.size(); + } + + // 鑾峰彇闂ㄨ瘖瀹� 璇婄枟搴婄殑缁熻 + List<RoomStatisticsDO> roomStatisticsList = roomService.roomStatistics(); + roomStatisticsList.size(); + + // 鑾峰彇 姣忎釜钀ヤ笟鐨勮瘖瀹� 鍊欒瘖鍑嗗鐨勫綋鍓嶄汉鏁� 灏辫瘖涓殑褰撳墠浜烘暟 + // queueService.get + List statusList = new ArrayList<Byte>(); + statusList.add((byte)20); + statusList.add((byte)30); + List<QueueStatisticDO> queueStatisticDOList = queueService.queueStatistics(statusList); + queueStatisticDOList.size(); + return success("hello"); } } -- Gitblit v1.9.3