package com.dpkj.modules.chs.controller; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Console; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.dpkj.common.vo.Result; import com.dpkj.modules.chs.service.IHispayService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.Mapping; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * @Auther: 萧道子 * @Date: 2025/3/22 16:25 * @Description: 医保模块-HIS医保 */ @Slf4j @AllArgsConstructor @RestController @RequestMapping("/chs/hispay") public class HispayController { private final IHispayService iHispayService; /** * 通过医保卡或医保电子凭证读卡 * * @param data : type 1.就诊卡,2.医保卡,5.门诊号,6.患者姓名和电话号码,8.电子健康码/卡,9.医保电子凭证 * @return com.dpkj.common.vo.Result * @author 萧道子 2025/5/20 */ @PostMapping("findReadCard") public Result findReadCard(@RequestBody JSONObject data) { try { String type = data.getString("type"); if (StrUtil.isEmpty(type)) { throw new RuntimeException("参数缺失"); } log.info("[HispayController][getPatientInfo][医保读卡] 读卡类型:{}", type); JSONObject res = iHispayService.getPatientInfo(type, null); return Result.ok("成功", res); } catch (Exception e) { e.printStackTrace(); log.error("[HispayController][getPatientInfo][医保读卡] :{}", e.getMessage()); return Result.error(e.getMessage()); } } }