yinyitong-zhongyuyuan-dll-s.../src/main/java/com/dpkj/modules/chs/controller/HispayController.java

59 lines
2.0 KiB
Java
Raw Normal View History

2025-03-24 22:12:01 +08:00
package com.dpkj.modules.chs.controller;
2025-05-20 18:03:31 +08:00
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
2025-03-24 22:12:01 +08:00
import cn.hutool.core.lang.Console;
2025-05-22 18:36:38 +08:00
import cn.hutool.core.util.StrUtil;
2025-03-24 22:12:01 +08:00
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;
2025-05-22 18:36:38 +08:00
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
2025-03-24 22:12:01 +08:00
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
2025-05-20 18:03:31 +08:00
import org.springframework.web.bind.annotation.RequestParam;
2025-03-24 22:12:01 +08:00
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 {
2025-05-20 18:03:31 +08:00
private final IHispayService iHispayService;
2025-03-24 22:12:01 +08:00
2025-05-22 18:36:38 +08:00
/**
* 通过医保卡或医保电子凭证读卡
*
* @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) {
2025-03-24 22:12:01 +08:00
try {
2025-05-22 18:36:38 +08:00
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);
2025-03-24 22:12:01 +08:00
} catch (Exception e) {
e.printStackTrace();
2025-05-22 18:36:38 +08:00
log.error("[HispayController][getPatientInfo][医保读卡] {}", e.getMessage());
return Result.error(e.getMessage());
2025-03-24 22:12:01 +08:00
}
}
}