更新部署方式

This commit is contained in:
2025-05-20 18:03:31 +08:00
parent d9d73434f6
commit bdd33043b3
19 changed files with 222 additions and 70 deletions

View File

@@ -1,4 +1,14 @@
package com.dpkj.modules.chs.service;
public interface IHispayService {
/**
* 门诊病人读卡
*
* @param type : 1.就诊卡2.医保卡5.门诊号6.患者姓名和电话号码8.电子健康码/卡9.医保电子凭证
* @param content : 医保卡: 密码 医保电子凭证:条码内容
* @return void
* @author 萧道子 2025/4/28
*/
void getPatientInfo(String type, String content);
}

View File

@@ -1,12 +1,28 @@
package com.dpkj.modules.chs.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.XmlUtil;
import com.alibaba.fastjson.JSONObject;
import com.dpkj.common.config.HisConfig;
import com.dpkj.common.utils.IDGenerator;
import com.dpkj.modules.chs.dll.HispayDll;
import com.dpkj.modules.chs.service.IHispayService;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.w3c.dom.Document;
import javax.annotation.PostConstruct;
import java.lang.reflect.Method;
import java.util.Map;
/**
* @Auther: 萧道子
@@ -17,13 +33,12 @@ import javax.annotation.PostConstruct;
@Service
public class HispayServiceImpl implements IHispayService {
private HispayDll.Dll dll = HispayDll.instance();
@Autowired
private HisConfig hisConfig;
private static ActiveXComponent dll = HispayDll.instance();
public HispayServiceImpl() throws HispayDll.DllRegistrationException {
}
@PostConstruct
// @PostConstruct
public void postConstruct() {
log.info("[HispayServiceImpl][postConstruct][医保DLL-HIS] 初始化动态链接库");
initPrinter();
@@ -31,8 +46,35 @@ public class HispayServiceImpl implements IHispayService {
private void initPrinter() {
Console.log(dll);
}
@Override
public void getPatientInfo(String type, String content) {
String soleid = IDGenerator.getSnowflakeIdToStr();
JSONObject req = new JSONObject() {{
put("timestamp", DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")); // 请求发送时间
put("requestid", soleid); // 唯一请求id
put("operid", hisConfig.getOperationId()); // 调用者代码
put("password", content); // 密码
put("params", new JSONObject() {{
put("cardtype", type); // 1.就诊卡2.医保卡5.门诊号6.患者姓名和电话号码8.电子健康码/卡9.医保电子凭证
put("cardno", ""); // 患者就诊卡号
put("sfzh", ""); // 身份证号
put("hzxm", ""); // 患者姓名
put("phone", ""); // 患者电话号码
}});
}};
Document document = XmlUtil.mapToXml(req, "request");
String reqParams = XmlUtil.toStr(document, "UTF-8", true, true);
Console.log("75 - {}\n", reqParams);
String rest = "";
Variant call = Dispatch.call(dll.getObject(), "fRun", "BMZXX010", reqParams, rest);
Console.log("82 - {}\n", call);
}
}