医保接口封装
parent
37b2ad9f8a
commit
ddd6b11265
@ -0,0 +1,11 @@
|
||||
package com.glxp.mipsdl.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class YbApiController {
|
||||
|
||||
|
||||
// public void get
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.glxp.mipsdl.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName(value = "thr_yb_setup")
|
||||
public class ThrYbSetup implements Serializable {
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Integer id;
|
||||
|
||||
@TableField(value = "url")
|
||||
private String url;
|
||||
|
||||
@TableField(value = "appId")
|
||||
private String appId;
|
||||
|
||||
@TableField(value = "appSecret")
|
||||
private String appSecret;
|
||||
|
||||
@TableField(value = "signKey")
|
||||
private String signKey;
|
||||
|
||||
@TableField(value = "encKey")
|
||||
private String encKey;
|
||||
/**
|
||||
* 就医地医保区划
|
||||
*/
|
||||
@TableField(value = "mdtrtarea_admvs")
|
||||
private String mdtrtarea_admvs;
|
||||
|
||||
/**
|
||||
* 参保地医保区划
|
||||
*/
|
||||
@TableField(value = "insuplc_admdvs")
|
||||
private String insuplc_admdvs;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
@TableField(value = "opter")
|
||||
private String opter;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@TableField(value = "opter_name")
|
||||
private String opter_name;
|
||||
|
||||
/**
|
||||
* 定点医药机构编号
|
||||
*/
|
||||
@TableField(value = "fixmedins_code")
|
||||
private String fixmedins_code;
|
||||
|
||||
/**
|
||||
* 定点医药机构名称
|
||||
*/
|
||||
@TableField(value = "fixmedins_name")
|
||||
private String fixmedins_name;
|
||||
|
||||
/**
|
||||
* 接口版本号
|
||||
*/
|
||||
@TableField(value = "infver")
|
||||
private String infver;
|
||||
|
||||
/**
|
||||
* 接收方系统代码
|
||||
*/
|
||||
@TableField(value = "recer_sys_code")
|
||||
private String recer_sys_code;
|
||||
/**
|
||||
* 经办人类别
|
||||
*/
|
||||
@TableField(value = "opter_type")
|
||||
private String opter_type;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.glxp.mipsdl.entity.system;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ThrYbSetupMapper extends BaseMapper<ThrYbSetup> {
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.glxp.mipsdl.req.yb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品库存变更
|
||||
*/
|
||||
@Data
|
||||
public class Kcbg3502Request {
|
||||
|
||||
/**
|
||||
* 医疗目录编码
|
||||
*/
|
||||
private String med_list_codg;
|
||||
/**
|
||||
* 库存变更类型
|
||||
*/
|
||||
private String inv_chg_type;
|
||||
/**
|
||||
* 定点医药机构目录编号
|
||||
*/
|
||||
private String fixmedins_hilist_id;
|
||||
/**
|
||||
* 定点医药机构目录名称
|
||||
*/
|
||||
private String fixmedins_hilist_name;
|
||||
/**
|
||||
* 定点医药机构批次流水号
|
||||
*/
|
||||
private String fixmedins_bchno;
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal pric;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer cnt;
|
||||
/**
|
||||
* 处方药标志
|
||||
*/
|
||||
private String rx_flag;
|
||||
/**
|
||||
* 库存变更时间
|
||||
*/
|
||||
private Date inv_chg_time;
|
||||
/**
|
||||
* 库存变更经办人姓名
|
||||
*/
|
||||
private String inv_chg_opter_name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 拆零标志
|
||||
*/
|
||||
private String trdn_flag;
|
||||
/**
|
||||
* 溯源码节点信息
|
||||
*/
|
||||
private String drugtracinfo;
|
||||
/**
|
||||
* 药品追溯码
|
||||
*/
|
||||
private String drug_trac_codg;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.glxp.mipsdl.req.yb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品盘存上传
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class Pcsc3501Request {
|
||||
|
||||
/**
|
||||
* 医疗目录编码
|
||||
*/
|
||||
private String med_list_codg;
|
||||
/**
|
||||
* 定点医药机构目录编号
|
||||
*/
|
||||
private String fixmedins_hilist_id;
|
||||
/**
|
||||
* 定点医药机构目录名称
|
||||
*/
|
||||
private String fixmedins_hilist_name;
|
||||
/**
|
||||
* 处方药标志
|
||||
*/
|
||||
private String rx_flag;
|
||||
/**
|
||||
* 盘存日期
|
||||
*/
|
||||
private Date invdate;
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Integer inv_cnt;
|
||||
/**
|
||||
* 生产批号
|
||||
*/
|
||||
private String manu_lotnum;
|
||||
/**
|
||||
* 定点医药机构批次流水号
|
||||
*/
|
||||
private String fixmedins_bchno;
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private Date manu_date;
|
||||
/**
|
||||
* 有效期止
|
||||
*/
|
||||
private Date expy_end;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
/**
|
||||
* 溯源码节点信息
|
||||
*/
|
||||
private String drugtracinfo;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
package com.glxp.mipsdl.req.yb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 药品销售
|
||||
*/
|
||||
@Data
|
||||
public class Xsck3505Request {
|
||||
|
||||
|
||||
/**
|
||||
* 医疗目录编码
|
||||
*/
|
||||
private String med_list_codg;
|
||||
|
||||
/**
|
||||
* 定点医药机构目录编号
|
||||
*/
|
||||
private String fixmedins_hilist_id;
|
||||
|
||||
/**
|
||||
* 定点医药机构目录名称
|
||||
*/
|
||||
private String fixmedins_hilist_name;
|
||||
|
||||
/**
|
||||
* 定点医药机构批次流水号
|
||||
*/
|
||||
private String fixmedins_bchno;
|
||||
|
||||
/**
|
||||
* 开方医师证件类型
|
||||
*/
|
||||
private String prsc_dr_cert_type;
|
||||
|
||||
/**
|
||||
* 开方医师证件号码
|
||||
*/
|
||||
private String prsc_dr_certno;
|
||||
|
||||
/**
|
||||
* 开方医师姓名
|
||||
*/
|
||||
private String prsc_dr_name;
|
||||
|
||||
/**
|
||||
* 药师证件类型
|
||||
*/
|
||||
private String phar_cert_type;
|
||||
|
||||
/**
|
||||
* 药师证件号码
|
||||
*/
|
||||
private String phar_certno;
|
||||
|
||||
/**
|
||||
* 药师姓名
|
||||
*/
|
||||
private String phar_name;
|
||||
|
||||
/**
|
||||
* 药师执业资格证号
|
||||
*/
|
||||
private String phar_prac_cert_no;
|
||||
|
||||
/**
|
||||
* 医保费用结算类型
|
||||
*/
|
||||
private String hi_feesetl_type;
|
||||
|
||||
/**
|
||||
* 结算ID
|
||||
*/
|
||||
private String setl_id;
|
||||
|
||||
/**
|
||||
* 就医流水号
|
||||
*/
|
||||
private String mdtrt_sn;
|
||||
|
||||
/**
|
||||
* 人员编号
|
||||
*/
|
||||
private String psn_no;
|
||||
|
||||
/**
|
||||
* 人员证件类型
|
||||
*/
|
||||
private String psn_cert_type;
|
||||
|
||||
/**
|
||||
* 证件号码
|
||||
*/
|
||||
private String certno;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
private String psn_name;
|
||||
|
||||
/**
|
||||
* 生产批号
|
||||
*/
|
||||
private String manu_lotnum;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private Date manu_date;
|
||||
|
||||
/**
|
||||
* 有效期止
|
||||
*/
|
||||
private Date expy_end;
|
||||
|
||||
/**
|
||||
* 处方药标志
|
||||
*/
|
||||
private String rx_flag;
|
||||
|
||||
/**
|
||||
* 拆零标志
|
||||
*/
|
||||
private String trdn_flag;
|
||||
|
||||
/**
|
||||
* 最终成交单价
|
||||
*/
|
||||
private BigDecimal finl_trns_pric;
|
||||
|
||||
/**
|
||||
* 处方号
|
||||
*/
|
||||
private String rxno;
|
||||
|
||||
/**
|
||||
* 外购处方标志
|
||||
*/
|
||||
private String rx_circ_flag;
|
||||
|
||||
/**
|
||||
* 零售单据号
|
||||
*/
|
||||
private String rtal_docno;
|
||||
|
||||
/**
|
||||
* 销售出库单据号
|
||||
*/
|
||||
private String stoout_no;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String bchno;
|
||||
|
||||
|
||||
/**
|
||||
* 药品条形码
|
||||
*/
|
||||
private String drug_prod_barc;
|
||||
|
||||
/**
|
||||
* 货架位
|
||||
*/
|
||||
private String shelf_posi;
|
||||
|
||||
/**
|
||||
* 销售/退货数量
|
||||
*/
|
||||
private Integer sel_retn_cnt;
|
||||
|
||||
/**
|
||||
* 销售/退货时间
|
||||
*/
|
||||
private Date sel_retn_time;
|
||||
|
||||
/**
|
||||
* 销售/退货经办人姓名
|
||||
*/
|
||||
private String sel_retn_opter_name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
/**
|
||||
* 就诊结算类型
|
||||
*/
|
||||
private String mdtrt_setl_type;
|
||||
|
||||
/**
|
||||
* 溯源码节点信息
|
||||
*/
|
||||
private String drugtracinfo;
|
||||
|
||||
private String drug_trac_codg;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package com.glxp.mipsdl.req.yb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 销售退货
|
||||
*/
|
||||
@Data
|
||||
public class Xsth3506Request {
|
||||
|
||||
|
||||
/**
|
||||
* 医疗目录编码
|
||||
*/
|
||||
private String med_list_codg;
|
||||
|
||||
/**
|
||||
* 定点医药机构目录编号
|
||||
*/
|
||||
private String fixmedins_hilist_id;
|
||||
|
||||
/**
|
||||
* 定点医药机构目录名称
|
||||
*/
|
||||
private String fixmedins_hilist_name;
|
||||
|
||||
/**
|
||||
* 定点医药机构批次流水号
|
||||
*/
|
||||
private String fixmedins_bchno;
|
||||
|
||||
/**
|
||||
* 结算ID
|
||||
*/
|
||||
private String setl_id;
|
||||
|
||||
/**
|
||||
* 人员编号
|
||||
*/
|
||||
private String psn_no;
|
||||
|
||||
/**
|
||||
* 人员证件类型
|
||||
*/
|
||||
private String psn_cert_type;
|
||||
|
||||
/**
|
||||
* 证件号码
|
||||
*/
|
||||
private String certno;
|
||||
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
private String psn_name;
|
||||
|
||||
/**
|
||||
* 生产批号
|
||||
*/
|
||||
private String manu_lotnum;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private Date manu_date;
|
||||
|
||||
/**
|
||||
* 有效期止
|
||||
*/
|
||||
private Date expy_end;
|
||||
|
||||
/**
|
||||
* 处方药标志
|
||||
*/
|
||||
private String rx_flag;
|
||||
|
||||
/**
|
||||
* 拆零标志
|
||||
*/
|
||||
private String trdn_flag;
|
||||
|
||||
/**
|
||||
* 最终成交单价
|
||||
*/
|
||||
private BigDecimal finl_trns_pric;
|
||||
|
||||
/**
|
||||
* 销售/退货数量
|
||||
*/
|
||||
private BigDecimal sel_retn_cnt;
|
||||
|
||||
/**
|
||||
* 销售/退货时间
|
||||
*/
|
||||
private Date sel_retn_time;
|
||||
|
||||
/**
|
||||
* 销售/退货经办人姓名
|
||||
*/
|
||||
private String sel_retn_opter_name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
/**
|
||||
* 商品销售流水号
|
||||
*/
|
||||
private String medins_prod_sel_no;
|
||||
|
||||
/**
|
||||
* 就医流水号
|
||||
*/
|
||||
private String mdtrt_sn;
|
||||
|
||||
/**
|
||||
* 溯源码节点信息
|
||||
*/
|
||||
private String drugtracinfo;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.mipsdl.req.yb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Yljg1201Request {
|
||||
|
||||
/**
|
||||
* 定点医疗服务机构类型
|
||||
*/
|
||||
private String fixmedins_type;
|
||||
|
||||
/**
|
||||
* 定点医药机构名称
|
||||
*/
|
||||
private String fixmedins_name;
|
||||
|
||||
/**
|
||||
* 定点医药机构编号
|
||||
*/
|
||||
private String fixmedins_code;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.glxp.mipsdl.res.yb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class YbResponse {
|
||||
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
private String retRslt;
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
private String msgRslt;
|
||||
|
||||
/**
|
||||
* 医疗目录编码
|
||||
*/
|
||||
private String med_list_codg;
|
||||
|
||||
/**
|
||||
* 发票变更类型
|
||||
*/
|
||||
private String inv_chg_type;
|
||||
|
||||
/**
|
||||
* 定点医药机构目录编号
|
||||
*/
|
||||
private String fixmedins_hilist_id;
|
||||
|
||||
/**
|
||||
* 定点医药机构目录名称
|
||||
*/
|
||||
private String fixmedins_hilist_name;
|
||||
|
||||
/**
|
||||
* 定点医药机构批次流水号
|
||||
*/
|
||||
private String fixmedins_bchno;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String memo;
|
||||
|
||||
// Getters and Setters
|
||||
|
||||
// Getters and Setters
|
||||
|
||||
// Constructor, toString, equals, hashCode methods if necessary
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.mipsdl.service.system;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.glxp.mipsdl.entity.system.ThrYbSetup;
|
||||
import com.glxp.mipsdl.entity.system.ThrYbSetupMapper;
|
||||
|
||||
@Service
|
||||
public class ThrYbSetupService extends ServiceImpl<ThrYbSetupMapper, ThrYbSetup> {
|
||||
|
||||
public ThrYbSetup getSetUp() {
|
||||
List<ThrYbSetup> thrYbSetups = list();
|
||||
if (CollUtil.isNotEmpty(thrYbSetups))
|
||||
return thrYbSetups.get(0);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.glxp.mipsdl.service.yb;
|
||||
|
||||
import cn.hsa.zephyr.apisdk.ZephyrMedicalClient;
|
||||
import cn.hsa.zephyr.apisdk.internal.exception.ZephyrApiException;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.EncryptionModeEnum;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.SignTypeEnum;
|
||||
import cn.hsa.zephyr.apisdk.request.ZephyrMedicalRequest;
|
||||
import cn.hsa.zephyr.apisdk.response.ChsMedicalResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.glxp.mipsdl.entity.system.ThrYbSetup;
|
||||
import com.glxp.mipsdl.service.system.ThrYbSetupService;
|
||||
import com.glxp.mipsdl.util.DateUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class YbClient {
|
||||
|
||||
@Resource
|
||||
ThrYbSetupService thrYbSetupService;
|
||||
|
||||
public ChsMedicalResponse ybPost(String apiNo, JSONObject requestData) {
|
||||
|
||||
|
||||
ThrYbSetup thrYbSetup = thrYbSetupService.getSetUp();
|
||||
if (thrYbSetup == null)
|
||||
throw new RuntimeException("未配置医保接口");
|
||||
String infno = apiNo;
|
||||
SignTypeEnum signType = SignTypeEnum.SM3;
|
||||
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
|
||||
String msgId = thrYbSetup.getFixmedins_code() + DateUtil.formatYbDateTime(new Date()) + "0001";
|
||||
try {
|
||||
ZephyrMedicalClient client = new ZephyrMedicalClient(thrYbSetup.getUrl(), infno, thrYbSetup.getAppId(), thrYbSetup.getAppSecret(),
|
||||
signType, thrYbSetup.getSignKey(), encType, thrYbSetup.getEncKey());
|
||||
ZephyrMedicalRequest req = new ZephyrMedicalRequest();
|
||||
req.setMsgid(msgId);
|
||||
req.setMdtrtAreaAdmdvs(thrYbSetup.getMdtrtarea_admvs());
|
||||
req.setInsuplcAdmdvs(thrYbSetup.getInsuplc_admdvs());
|
||||
req.setOpter(thrYbSetup.getOpter());
|
||||
req.setOpterType(thrYbSetup.getOpter_type());
|
||||
req.setOpterName(thrYbSetup.getOpter_name());
|
||||
req.setInfTime(DateUtil.formatDateTime(new Date()));
|
||||
req.setFixmedinsCode(thrYbSetup.getFixmedins_code());
|
||||
req.setFixmedinsName(thrYbSetup.getFixmedins_name());
|
||||
req.setInput(requestData);
|
||||
ChsMedicalResponse resp = client.execute(req);
|
||||
return resp;
|
||||
} catch (ZephyrApiException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.mipsdl.entity.system.ThrYbSetupMapper">
|
||||
<resultMap id="BaseResultMap" type="com.glxp.mipsdl.entity.system.ThrYbSetup">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table thr_yb_setup-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="url" jdbcType="VARCHAR" property="url" />
|
||||
<result column="appId" jdbcType="INTEGER" property="appId" />
|
||||
<result column="appSecret" jdbcType="VARCHAR" property="appSecret" />
|
||||
<result column="signKey" jdbcType="VARCHAR" property="signKey" />
|
||||
<result column="encKey" jdbcType="VARCHAR" property="encKey" />
|
||||
<result column="insuplc_admdvs" jdbcType="VARCHAR" property="insuplc_admdvs" />
|
||||
<result column="opter" jdbcType="VARCHAR" property="opter" />
|
||||
<result column="opter_name" jdbcType="VARCHAR" property="opter_name" />
|
||||
<result column="fixmedins_code" jdbcType="VARCHAR" property="fixmedins_code" />
|
||||
<result column="fixmedins_name" jdbcType="VARCHAR" property="fixmedins_name" />
|
||||
<result column="infver" jdbcType="VARCHAR" property="infver" />
|
||||
<result column="recer_sys_code" jdbcType="VARCHAR" property="recer_sys_code" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, url, appId, appSecret, signKey, encKey, insuplc_admdvs, opter, opter_name, fixmedins_code,
|
||||
fixmedins_name, infver, recer_sys_code
|
||||
</sql>
|
||||
</mapper>
|
Loading…
Reference in New Issue