package thyyxxk.webserver.api.zyFeeReceive;

import cn.hutool.core.convert.Convert;
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.service.executeItem.StoreProcedureConvertService;
import thyyxxk.webserver.utils.ResultVoUtil;

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

/**
 * @Description: 费用接收
 * @Author:lihong
 * @Date: 2024/8/27
 */
@RestController
@RequestMapping("/api/zyReceiveApi")
public class ZyFeeReceiveController {
    @Resource
    private StoreProcedureConvertService service;

    /**
     * @description: 住院医嘱接收
     * @author: lihong
     * @date: 2024/8/27 15:42
     * @param: params
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PassToken
    @PostMapping("/zyReceiveDrug")
    public ResultVo<String> zyReceiveDrug(@RequestBody Map<String,Object> params){
        service.zyReceiveDrug(Convert.toStr(params.get("patNo")),Convert.toInt(params.get("times")));
        return ResultVoUtil.success();
    }

    /**
     * @description: 住院药品费用接收
     * @author: lihong
     * @date: 2024/8/27 15:43
     * @param: params
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PassToken
    @PostMapping("/zyReceiveOne")
    public ResultVo<String> zyReceiveOne(@RequestBody Map<String,Object> params){
        service.zyReceiveOne(Convert.toStr(params.get("patNo")),Convert.toInt(params.get("times")));
        return ResultVoUtil.success();
    }


}
