2025-03-24 22:12:01 +08:00
|
|
|
|
package com.dpkj.modules.chs.controller;
|
|
|
|
|
|
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;
|
2025-06-12 11:30:33 +08:00
|
|
|
|
import com.dpkj.common.vo.ResultData;
|
2025-03-24 22:12:01 +08:00
|
|
|
|
import com.dpkj.modules.chs.service.IHispayService;
|
2025-06-12 11:30:33 +08:00
|
|
|
|
import com.dpkj.modules.chs.vo.OutpatientBeginModel;
|
|
|
|
|
import com.dpkj.modules.chs.vo.OutpatientFinalModel;
|
2025-03-24 22:12:01 +08:00
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2025-05-29 17:41:06 +08:00
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
2025-05-22 18:36:38 +08:00
|
|
|
|
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;
|
|
|
|
|
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-06-17 14:51:57 +08:00
|
|
|
|
private final IHispayService hispayService;
|
2025-03-24 22:12:01 +08:00
|
|
|
|
|
|
|
|
|
|
2025-05-22 18:36:38 +08:00
|
|
|
|
/**
|
|
|
|
|
* 通过医保卡或医保电子凭证读卡
|
|
|
|
|
*
|
|
|
|
|
* @return com.dpkj.common.vo.Result<?>
|
|
|
|
|
* @author 萧道子 2025/5/20
|
|
|
|
|
*/
|
2025-05-29 17:41:06 +08:00
|
|
|
|
@PostMapping("findReadCode")
|
|
|
|
|
public Result<?> findReadCode() {
|
|
|
|
|
try {
|
2025-06-17 14:51:57 +08:00
|
|
|
|
JSONObject res = hispayService.readCode();
|
2025-05-29 17:41:06 +08:00
|
|
|
|
return Result.ok("成功", res);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("[HispayController][getPatientInfo][按医保电子凭证读卡] ERR:{}", e.getMessage());
|
|
|
|
|
return Result.error(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过医保卡获取患者信息
|
|
|
|
|
*
|
|
|
|
|
* @param data :
|
|
|
|
|
* @return com.dpkj.common.vo.Result<?>
|
|
|
|
|
* @author 萧道子 2025/5/28
|
|
|
|
|
*/
|
2025-05-22 18:36:38 +08:00
|
|
|
|
@PostMapping("findReadCard")
|
|
|
|
|
public Result<?> findReadCard(@RequestBody JSONObject data) {
|
2025-05-29 17:41:06 +08:00
|
|
|
|
try {
|
|
|
|
|
String password = data.getString("password");
|
|
|
|
|
if (StrUtil.isEmpty(password)) {
|
|
|
|
|
throw new RuntimeException("密码不可为空");
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-17 14:51:57 +08:00
|
|
|
|
JSONObject res = hispayService.readCard(password);
|
2025-05-29 17:41:06 +08:00
|
|
|
|
return Result.ok("成功", res);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("[HispayController][readCardByCard][按医保卡读卡] ERR:{}", e.getMessage());
|
|
|
|
|
return Result.error(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 门诊缴费-预算
|
|
|
|
|
*
|
|
|
|
|
* @param data :
|
|
|
|
|
* @return com.dpkj.common.vo.Result<?>
|
|
|
|
|
* @author 萧道子 2025/5/27
|
|
|
|
|
*/
|
2025-06-12 11:30:33 +08:00
|
|
|
|
@PostMapping("chsCodeAsOutpatientBegin")
|
|
|
|
|
public Result<?> chsCodeAsOutpatientBegin(@RequestBody @Validated OutpatientBeginModel data) {
|
2025-05-29 17:41:06 +08:00
|
|
|
|
try {
|
2025-06-12 11:30:33 +08:00
|
|
|
|
log.info("[HispayController][chsCodeAsOutpatientBegin][门诊缴费-预算-电子医保凭证] 参数:{}", data);
|
2025-06-17 14:51:57 +08:00
|
|
|
|
ResultData res = hispayService.chsCodeAsOutpatientBegin(data);
|
2025-05-29 17:41:06 +08:00
|
|
|
|
return Result.ok("成功", res);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
2025-06-12 11:30:33 +08:00
|
|
|
|
log.info("[HispayController][chsCodeAsOutpatientBegin][门诊缴费-预算-电子医保凭证] 失败:{}", e.getMessage());
|
2025-05-29 17:41:06 +08:00
|
|
|
|
return Result.error(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 门诊缴费-结算
|
|
|
|
|
*
|
|
|
|
|
* @param data :
|
|
|
|
|
* @return com.dpkj.common.vo.Result<?>
|
|
|
|
|
* @author 萧道子 2025/5/27
|
|
|
|
|
*/
|
2025-06-12 11:30:33 +08:00
|
|
|
|
@PostMapping("chsCodeAsOutpatientFinal")
|
|
|
|
|
public Result<?> chsCodeAsOutpatientFinal(@RequestBody @Validated OutpatientFinalModel data) {
|
2025-03-24 22:12:01 +08:00
|
|
|
|
try {
|
2025-06-12 11:30:33 +08:00
|
|
|
|
log.info("[HispayController][chsCodeAsOutpatientFinal][门诊缴费-结算-电子医保凭证] 参数:{}", data);
|
2025-06-17 14:51:57 +08:00
|
|
|
|
ResultData res = hispayService.chsCodeAsOutpatientFinal(data);
|
2025-06-12 11:30:33 +08:00
|
|
|
|
return Result.ok("成功", res);
|
2025-03-24 22:12:01 +08:00
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
2025-06-12 11:30:33 +08:00
|
|
|
|
log.info("[HispayController][chsCodeAsOutpatientFinal][门诊缴费-结算-电子医保凭证] 失败:{}", e.getMessage());
|
2025-05-22 18:36:38 +08:00
|
|
|
|
return Result.error(e.getMessage());
|
2025-03-24 22:12:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-17 14:51:57 +08:00
|
|
|
|
|
2025-03-24 22:12:01 +08:00
|
|
|
|
}
|