package thyyxxk.webserver.controller.inpatient;

import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
import thyyxxk.webserver.entity.inpatient.ZyActpatient;
import thyyxxk.webserver.entity.transferInOfExpenses.data.CorrectInvoice;
import thyyxxk.webserver.service.inpatient.TransferInOfExpensesService;

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

/**
 * <p>
 * 描述： 门急诊费用 转入
 * </p>
 *
 * @author xc
 * @date 2021-05-25 17:33
 */
@RestController
@RequestMapping("/transferInOfExpenses")
public class TransferInOfExpensesController {

    private final TransferInOfExpensesService service;

    public TransferInOfExpensesController(TransferInOfExpensesService service) {
        this.service = service;
    }

    @GetMapping("/queryHuanZhe")
    public ResultVo<ZyActpatient> queryHuanZhe(@RequestParam("inpatientNo") String inpatientNo) {
        return service.queryHuanZhe(inpatientNo);
    }

    @GetMapping("/getSerialNo")
    public ResultVo<List<MzChargeDetail>> getSerialNo(Integer serialNo) {
        return service.getSerialNo(serialNo);
    }

    @GetMapping("/getZyJiMenZhenZhuangRuFeiYong")
    public ResultVo<Map<String, Object>> getZyJiMenZhenZhuangRuFeiYong(@RequestParam("inpatientNo") String inpatientNo,
                                                                       @RequestParam("chargeCodeMX") String chargeCodeMX,
                                                                       @RequestParam("admissTimes") String admissTimes,
                                                                       @RequestParam("currentPage") long currentPage,
                                                                       @RequestParam("pageSize") long pageSize) {
        return service.getZyJiMenZhenZhuangRuFeiYong(inpatientNo, chargeCodeMX, admissTimes, currentPage, pageSize);
    }

    @PostMapping("/shanChuFeiYong")
    public ResultVo<String> shanChuFeiYong(@RequestBody ZyDetailCharge param) {
        return service.shanChuFeiYong(param);
    }

    @PostMapping("/baoCunHuanZheZhuYuanFeiYong")
    public ResultVo<String> baoCunHuanZheZhuYuanFeiYong(@RequestBody ZyActpatient param) {
        return service.baoCunHuanZheZhuYuanFeiYong(param);
    }

    @GetMapping("/queryEntryName")
    public ResultVo<List<GetDropdownBox>> queryEntryName(String pyCode) {
        return service.queryEntryName(pyCode);
    }

    @PostMapping("/correctInvoice")
    public ResultVo<String> correctInvoice(@RequestBody CorrectInvoice.CorrectInvoiceReq param) {
        return service.correctInvoice(param);
    }

    @GetMapping("/getDzfpQrcodeBySerialNo")
    public ResultVo<CorrectInvoice.DzcfVo> getDzfpQrcodeBySerialNo(@RequestParam("serialNo") Integer serialNo) {
        return service.getDzfpQrcodeBySerialNo(serialNo);
    }

}
