package thyyxxk.webserver.controller.datamodify;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.datamodify.TYzActOrderModify;
import thyyxxk.webserver.entity.datamodify.YzActOrder;
import thyyxxk.webserver.service.datamodify.YzActOrderModifyService;

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

/**
 * @author 肖蟾
 * @description医嘱修改 前端控制器
 * @since 2021-03-08
 */
@RestController
@RequestMapping("/yzActOrder")
public class YzActOrderModifyController {

    private final YzActOrderModifyService server;

    @Autowired
    public YzActOrderModifyController(YzActOrderModifyService server) {
        this.server = server;
    }

    @PostMapping("/queryYZ")
    public ResultVo<List<YzActOrder>> queryYz(@RequestBody YzActOrder param) {
        return server.queryYz(param);
    }

    @PostMapping("/yzModifyApply")
    public ResultVo<Boolean> yzModifyApply(@RequestBody TYzActOrderModify param) {
        return server.yzModifyApply(param);
    }

    @GetMapping("/chaKanZhuangTai")
    public ResultVo<Map<String, Object>> chaKanZhuangTai(@RequestParam("code") String code,
                                                         @RequestParam("actOrderNo") String actOrderNo,
                                                         @RequestParam("inpatientNo") String inpatientNo,
                                                         @RequestParam("currentPage") long currentPage,
                                                         @RequestParam("pageSize") long pageSize) {
        return server.chaKanZhuangTai(code, actOrderNo, inpatientNo, currentPage, pageSize);
    }

    @PostMapping("/danGeShenQing")
    public ResultVo<String> danGeShenQing(@RequestBody TYzActOrderModify param) {
        return server.danGeShenQing(param);
    }

}

