package thyyxxk.webserver.controller.medicaladvice.patientinfo;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.inpatient.ZyActpatient;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.patientinfo.ZkBedVo;
import thyyxxk.webserver.service.medicaladvice.patientinfo.ZkManageService;
import thyyxxk.webserver.utils.ResultVoUtil;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author:lihong
 * @Date: 2024/1/3
 */
@RestController
@RequestMapping("/medicalAdvice/zkManage/")
public class ZkManageController {
    @Resource
    private ZkManageService service;

    /**
     * @description: 查询待转科列表
     * @author: lihong
     * @date: 2024/1/3 15:43
     * @param: query
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<thyyxxk.webserver.entity.inpatient.ZyActpatient>>
     **/
    @PostMapping("queryZkPatient")
    public ResultVo<List<ZyActpatient>> queryZkPatient(@RequestBody Map<String,String> query){
        return ResultVoUtil.success(service.queryZkPatient(query));
    }

    /**
     * @description: 查询空闲的床位信息
     * @author: lihong
     * @date: 2024/1/3 16:47
     * @param: query
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<thyyxxk.webserver.entity.medicaladvice.medicamanage.patientinfo.ZkBedVo>>
     **/
    @PostMapping("queryZkBedVo")
    public ResultVo<List<ZkBedVo>> queryZkBedVo(@RequestBody Map<String,String> query){
        return ResultVoUtil.success(service.queryZkBedVo(query));
    }
     /**
      * @description: 检查是否可以转科
      * @author: lihong
      * @date: 2024/1/4 10:28
      * @param: param
      * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
      **/
    @PostMapping("checkZk")
    public ResultVo<String> checkZk(@RequestBody ZkBedVo param){
        return service.checkZk(param);
    }
    /**
     * @description: 保存转科数据
     * @author: lihong
     * @date: 2024/1/4 13:58
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("saveZkData")
    public ResultVo<String> saveZkData(@RequestBody List<ZkBedVo> param){
        return service.saveZkData(param);
    }

    @PostMapping("createPatientDoor")
    public ResultVo<String> createPatientDoor(@RequestBody List<ZkBedVo> param){
        return service.createPatientDoor(param);
    }

}
