package thyyxxk.webserver.controller.medicine;

import org.springframework.validation.annotation.Validated;
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.medicine.MzDrugTracCodg;
import thyyxxk.webserver.entity.medicine.vo.YpCodgVo;
import thyyxxk.webserver.service.medicine.YpCodgMatchService;

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

/**
 * @ClassName YpCodgMatchController
 * @Author hsh
 * @Date 2025/6/20 0020 11:23
 * @Version 1.0
 * @Description 药品追溯码匹配Controller
 **/
@RestController
@RequestMapping("/ypMatch")
public class YpCodgMatchController {

    private final YpCodgMatchService service;


    public YpCodgMatchController(YpCodgMatchService service) {
        this.service = service;
    }

    @PostMapping("/selectMzChargePrescription")
    public ResultVo<List<Map<String, Object>>> selectMzChargePrescription(@RequestBody @Validated YpCodgVo vo){
        return service.selectMzChargePrescription(vo);
    }

    @PostMapping("/selectMzCfDetail")
    public ResultVo<List<Map<String, Object>>> selectMzCfDetail(@RequestBody @Validated YpCodgVo vo){
        return service.selectMzCfDetail(vo);
    }

    @PostMapping("/selectMatchCodgInfo")
    public ResultVo<Map<String, Object>> selectMatchCodgInfo(@RequestBody @Validated YpCodgVo vo){
        return service.selectMatchCodgInfo(vo);
    }

    @PostMapping("/updateMzDrugCodgData")
    public ResultVo<Map<String, Object>> updateMzDrugCodgData(@RequestBody @Validated List<MzDrugTracCodg> list){
        return service.updateMzDrugCodgData(list);
    }

    @PostMapping("/delMzDrugCodgByCode")
    public ResultVo<Map<String, Object>> delMzDrugCodgByCode(@RequestBody @Validated YpCodgVo vo){
        return service.delMzDrugCodgByCode(vo);
    }

    @PostMapping("/selectMzDrugTracCodgData")
    public ResultVo<Map<String, Object>> selectMzDrugTracCodgData(@RequestBody @Validated YpCodgVo vo){
        return service.selectMzDrugTracCodgData(vo);
    }

}
