| | |
| | | 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.feign.RemoteDataService; |
| | |
| | | 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.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; |
| | |
| | | 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; |
| | |
| | | |
| | | @Resource |
| | | private RemoteDataService remoteDataService; |
| | | |
| | | @Resource |
| | | private DeptApi deptApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建预约") |
| | |
| | | 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()); |
| | |
| | | |
| | | 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(); |
| | | } |
| | | |
| | | // 获取 每个营业的诊室 候诊准备的当前人数 就诊中的当前人数 |
| | | // queueService.get |
| | | |
| | | |
| | | return success("hello"); |
| | | } |
| | | } |