更新部署方式
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user