package thyyxxk.webserver.controller.medicaladvice.patientinfo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
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.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.MzZyReq;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.ZyBedPreMsg;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.patientinfo.ZyBedMi;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.patientinfo.ZyBedMiParam;
import thyyxxk.webserver.service.medicaladvice.patientinfo.AdjustBedService;
import thyyxxk.webserver.utils.ResultVoUtil;

import java.util.List;
import java.util.Map;

/**
 * @Description:整理床位
 * @Author:lihong
 * @Date: 2023/5/31
 */
@RestController
@RequestMapping("/medicalAdvice/adjustBed/")
public class AdjustBedController {
    @Autowired
    private AdjustBedService service;


    @PostMapping("preAllocationBed")
    @PassToken
    public ResultVo<String> preAllocationBed(@RequestBody MzZyReq mzZyReq){
        return service.preAllocationBed(mzZyReq);
    }

    @PostMapping("confirmPreBed")
    public ResultVo<String> confirmPreBed(@RequestBody ZyBedPreMsg msg){
        return service.confirmPreBed(msg);
    }

    @PostMapping("queryZyBedPreMsg")
    public ResultVo<IPage<ZyBedPreMsg>> queryZyBedPreMsg(@RequestBody ZyBedPreMsg msg){
        return service.queryZyBedPreMsg(msg);
    }
    @PostMapping("getIdleBedNoList")
    public ResultVo<List<Map>> getIdleBedNoList(@RequestBody ZyBedPreMsg msg){
        return service.getIdleBedNoList(msg);
    }

    @PostMapping("queryZybedMi")
    public ResultVo<Map<String,Object>> queryZybedMi(@RequestBody ZyBedMi param){
        return ResultVoUtil.success(service.queryZybedMi(param));
    }

    @PostMapping("clearBed")
    public ResultVo<String> clearBed(@RequestBody ZyBedMi param){
        return service.clearBed(param);
    }

    @PostMapping("addBed")
    public ResultVo<String> addBed(@RequestBody ZyBedMi param){
        return service.addBed(param);
    }

    @PostMapping("saveBed")
    public ResultVo<String> saveBed(@RequestBody ZyBedMiParam params){
        return service.saveBed(params);
    }
    @PostMapping("queryIsPreBed")
    public ResultVo<String> queryIsPreBed(@RequestBody ZyBedMi param){
        return service.queryIsPreBed(param);
    }

}
