luqingbin 3 жил өмнө
commit
71f3089ee4

+ 42 - 0
pom.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.github</groupId>
+    <artifactId>yxyl120-opensdk</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.14</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.13.0</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 51 - 0
src/main/java/com/github/yxyl120/opensdk/Utils/AesUtil.java

@@ -0,0 +1,51 @@
+package com.github.yxyl120.opensdk.Utils;
+
+import org.apache.commons.codec.binary.Hex;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+public class AesUtil {
+    private static final String CHARSET_NAME = "UTF-8";
+    private static final String INSTANCE_NAME = "AES/CBC/PKCS5Padding";
+    private static final String ENCRYPT_METHOD = "AES";
+
+    public AesUtil() {
+    }
+
+    public static String decrypt(String str, String key, String ivStr) {
+        try {
+            if (str != null && str.trim().length() >= 1) {
+                SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(), ENCRYPT_METHOD);
+                IvParameterSpec iv = new IvParameterSpec(ivStr.getBytes());
+                Cipher cipher = Cipher.getInstance(INSTANCE_NAME);
+                cipher.init(2, skeySpec, iv);
+                byte[] encrypted = Hex.decodeHex(str.toCharArray());
+                byte[] original = cipher.doFinal(encrypted);
+                return new String(original, CHARSET_NAME);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static String encrypt(String str, String key, String ivStr) {
+        try {
+            if (str != null && str.trim().length() >= 1) {
+                SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(), ENCRYPT_METHOD);
+                IvParameterSpec iv = new IvParameterSpec(ivStr.getBytes());
+                Cipher cipher = Cipher.getInstance(INSTANCE_NAME);
+                cipher.init(1, skeySpec, iv);
+                byte[] encrypted = str.getBytes(CHARSET_NAME);
+                byte[] original = cipher.doFinal(encrypted);
+                return Hex.encodeHexString(original);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+}

+ 96 - 0
src/main/java/com/github/yxyl120/opensdk/Utils/HttpUtils.java

@@ -0,0 +1,96 @@
+package com.github.yxyl120.opensdk.Utils;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.yxyl120.opensdk.domain.RequestParameter;
+import com.github.yxyl120.opensdk.domain.order.OrderInfo;
+import com.github.yxyl120.opensdk.YxException;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.nio.charset.Charset;
+
+public class HttpUtils {
+
+    private static final Charset CHARSET = Charset.forName("UTF-8");
+
+    /**
+     * 推送订单到一线平台
+     *
+     * @param api       接口
+     * @param parameter 接口参数
+     * @return 推送结果
+     * @throws YxException
+     */
+    public static String pushOrder(String api, RequestParameter<OrderInfo> parameter) throws YxException {
+        ParameterCheckUtils.checkParameters(parameter);
+        String sign = SignUtils.sign(parameter);
+        parameter.setSig(sign);
+        return post(api, toJson(parameter));
+    }
+
+    /**
+     * 请求一线api专用post请求
+     *
+     * @param api     接口请求url
+     * @param jsonStr 提交的参数转换后json字符串
+     * @return 请求结果
+     * @throws Exception -
+     */
+    public static String post(String api, String jsonStr) throws YxException {
+        StringBuilder result = new StringBuilder();
+        DataOutputStream out = null;
+        BufferedReader bufferedReader = null;
+        try {
+            URL url = new URL(api);
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            connection.setRequestMethod("POST");
+            connection.setRequestProperty("Content-Type", "application/json");
+            connection.setRequestProperty("Connection", "Keep-Alive");
+            connection.setUseCaches(false);
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+
+            // 得到请求的输出流对象
+            out = new DataOutputStream(connection.getOutputStream());
+            out.write(jsonStr.getBytes(CHARSET));
+            out.flush();
+            out.close();
+            // 建立实际的连接
+            connection.connect();
+            // 定义 BufferedReader输入流来读取URL的响应
+            bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), CHARSET));
+            String getLine;
+            while ((getLine = bufferedReader.readLine()) != null) {
+                result.append(getLine);
+            }
+        } catch (Exception e) {
+            throw new YxException("请求接口" + api + "发生错误", e);
+        } finally {
+            close(out);
+            close(bufferedReader);
+        }
+        return result.toString();
+    }
+
+    private static String toJson(Object object) {
+        ObjectMapper mapper = new ObjectMapper();
+        try {
+            return mapper.writeValueAsString(object);
+        } catch (JsonProcessingException e) {
+            return "";
+        }
+    }
+
+    private static void close(Closeable closeable) {
+        try {
+            if (closeable == null) {
+                return;
+            }
+            closeable.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 53 - 0
src/main/java/com/github/yxyl120/opensdk/Utils/ParameterCheckUtils.java

@@ -0,0 +1,53 @@
+package com.github.yxyl120.opensdk.Utils;
+
+import com.github.yxyl120.opensdk.YxException;
+import com.github.yxyl120.opensdk.annotation.ApiFieldProperty;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ParameterCheckUtils {
+    /**
+     * 用于缓存类的属性字段
+     */
+    private static final Map<String, Map<Field, ApiFieldProperty>> fieldPropertys = new HashMap<>();
+
+    public static void checkParameters(Object parameter) throws YxException {
+        if (parameter == null) {
+            throw new YxException("参数不能为空");
+        }
+        String simpleName = parameter.getClass().getName();
+        Map<Field, ApiFieldProperty> propertyMap = fieldPropertys.get(simpleName);
+        if (null == propertyMap) {
+            propertyMap = new HashMap<>();
+            for (Field field : parameter.getClass().getDeclaredFields()) {
+                field.setAccessible(true);
+                propertyMap.put(field, field.getAnnotation(ApiFieldProperty.class));
+            }
+            fieldPropertys.put(simpleName, propertyMap);
+        }
+
+        try {
+            for (Map.Entry<Field, ApiFieldProperty> entry : propertyMap.entrySet()) {
+                ApiFieldProperty value = entry.getValue();
+                Field key = entry.getKey();
+                String name = key.getType().getName();
+                if (value.required()) {
+                    Object o = key.get(parameter);
+                    if (o == null || ("java.lang.String".equals(name) && isEmpty((String) o))) {
+                        throw new YxException("参数[" + key.getName() + "]不能为空,字段描述:" + value.notes());
+                    }
+                }
+                if (value.multipartField()) {
+                    checkParameters(key.get(parameter));
+                }
+            }
+        } catch (IllegalAccessException ignored) {
+        }
+    }
+
+    private static boolean isEmpty(String str) {
+        return str == null || str.trim().length() == 0;
+    }
+}

+ 39 - 0
src/main/java/com/github/yxyl120/opensdk/Utils/SignUtils.java

@@ -0,0 +1,39 @@
+package com.github.yxyl120.opensdk.Utils;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.yxyl120.opensdk.YxException;
+import com.github.yxyl120.opensdk.domain.RequestParameter;
+import org.apache.commons.codec.digest.DigestUtils;
+
+import java.nio.charset.Charset;
+import java.util.LinkedList;
+import java.util.List;
+
+public class SignUtils {
+    private static final Charset UTF_8 = Charset.forName("UTF-8");
+
+    public static String sign(RequestParameter parameter) throws YxException {
+        try {
+            long timestamp = System.currentTimeMillis();
+            parameter.setTimestamp(timestamp);
+
+            List<String> list = new LinkedList<>();
+
+            list.add(parameter.getAct_id());
+            list.add(parameter.getManu_id());
+            list.add(parameter.getApp_id());
+            list.add(String.valueOf(timestamp));
+            // 大于等于1.0之后的版本需要将传参也带上进行签名
+            if (parameter.getVersion() >= 1.0) {
+                ObjectMapper mapper = new ObjectMapper();
+                list.add(mapper.writeValueAsString(parameter.getData()));
+            }
+            byte[] bytes = String.join("&", list).getBytes(UTF_8);
+            return DigestUtils.md5Hex(bytes).toUpperCase();
+        } catch (Exception ex) {
+            throw new YxException("签名失败", ex);
+        }
+    }
+
+
+}

+ 15 - 0
src/main/java/com/github/yxyl120/opensdk/YxException.java

@@ -0,0 +1,15 @@
+package com.github.yxyl120.opensdk;
+
+public class YxException extends Exception {
+
+    public YxException() {
+    }
+
+    public YxException(String message) {
+        super(message);
+    }
+
+    public YxException(String msg, Throwable throwable) {
+        super(msg, throwable);
+    }
+}

+ 26 - 0
src/main/java/com/github/yxyl120/opensdk/annotation/ApiFieldProperty.java

@@ -0,0 +1,26 @@
+package com.github.yxyl120.opensdk.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 标记参数实体属性
+ */
+@Target({ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ApiFieldProperty {
+
+    /**
+     * 指定是否需要该参数。默认必须
+     */
+    boolean required() default true;
+
+    boolean multipartField() default false;
+    /**
+     *
+     * @return
+     */
+    String notes() default "";
+}

+ 18 - 0
src/main/java/com/github/yxyl120/opensdk/domain/JsonResponse.java

@@ -0,0 +1,18 @@
+package com.github.yxyl120.opensdk.domain;
+
+import java.io.Serializable;
+
+public class JsonResponse<T> implements Serializable {
+    /**
+     * 结果的描述
+     */
+    private String msg;
+    /**
+     * 操作结果识别码
+     */
+    private Integer code;
+    /**
+     * 返回的结果对象
+     */
+    private T data;
+}

+ 100 - 0
src/main/java/com/github/yxyl120/opensdk/domain/RequestParameter.java

@@ -0,0 +1,100 @@
+package com.github.yxyl120.opensdk.domain;
+
+import com.github.yxyl120.opensdk.annotation.ApiFieldProperty;
+
+public class RequestParameter<T> {
+
+    /**
+     * 操作码
+     */
+    @ApiFieldProperty(notes = "操作码")
+    private String act_id;
+    /**
+     * 为对接厂商提供的编码
+     */
+    @ApiFieldProperty(notes = "为对接厂商提供的编码")
+    private String manu_id;
+    /**
+     * 分配给厂商对接的互联网医院编码
+     */
+    @ApiFieldProperty(notes = "分配给厂商对接的互联网医院编码")
+    private String app_id;
+
+    @ApiFieldProperty(notes = "接口版本")
+    private double version;
+
+
+    /**
+     * 请求的时间戳
+     */
+    @ApiFieldProperty(notes = "请求的时间戳")
+    private long timestamp;
+    /**
+     * 签名结果
+     */
+    @ApiFieldProperty(notes = "签名结果",required = false)
+    private String sig;
+
+    @ApiFieldProperty(notes = "本次提交的数据参数", multipartField = true)
+    private T data;
+
+    public RequestParameter() {
+
+    }
+
+    public String getAct_id() {
+        return act_id;
+    }
+
+    public void setAct_id(String act_id) {
+        this.act_id = act_id;
+    }
+
+    public String getManu_id() {
+        return manu_id;
+    }
+
+    public void setManu_id(String manu_id) {
+        this.manu_id = manu_id;
+    }
+
+    public String getApp_id() {
+        return app_id;
+    }
+
+    public void setApp_id(String app_id) {
+        this.app_id = app_id;
+    }
+
+    public double getVersion() {
+        return version;
+    }
+
+    public void setVersion(double version) {
+        this.version = version;
+    }
+
+    public long getTimestamp() {
+        return timestamp;
+    }
+
+    public void setTimestamp(long timestamp) {
+        this.timestamp = timestamp;
+    }
+
+    public String getSig() {
+        return sig;
+    }
+
+    public void setSig(String sig) {
+        this.sig = sig;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+}

+ 159 - 0
src/main/java/com/github/yxyl120/opensdk/domain/order/DrugInfo.java

@@ -0,0 +1,159 @@
+package com.github.yxyl120.opensdk.domain.order;
+
+import com.github.yxyl120.opensdk.annotation.ApiFieldProperty;
+
+public class DrugInfo {
+    /**
+     * 药品名称(通用名)
+     */
+    @ApiFieldProperty( notes = "药品名称(通用名)")
+    private String drug_common_name;
+
+    /**
+     * 药品规格
+     */
+    @ApiFieldProperty( notes = "药品规格")
+    private String drug_specification;
+
+    /**
+     * 使用方法
+     */
+    @ApiFieldProperty( notes = "使用方法", required = false)
+    private String usage_method;
+
+    /**
+     * 药品频次
+     */
+    @ApiFieldProperty( notes = "药品频次", required = false)
+    private String usage_frequency_unit;
+
+    /**
+     * 每次用药数量
+     */
+    @ApiFieldProperty( notes = "每次用药数量", required = false)
+    private String usage_per_use_count;
+
+    /**
+     * 每次用药单位
+     */
+    @ApiFieldProperty( notes = "每次用药单位", required = false)
+    private String usage_per_use_unit;
+
+    /**
+     * 天数
+     */
+    @ApiFieldProperty( notes = "天数", required = false)
+    private String usage_days;
+
+    /**
+     * 药品数量
+     */
+    @ApiFieldProperty( notes = "药品数量")
+    private String sale_amount;
+
+    /**
+     * 药品数量单位
+     */
+    @ApiFieldProperty( notes = "药品数量单位", required = false)
+    private String sale_unit;
+
+    /**
+     * 药品说明书
+     */
+    @ApiFieldProperty( notes = "药品说明书", required = false)
+    private String instructions;
+
+    /**
+     * 药品产品批准文号              
+     */
+    @ApiFieldProperty( notes = "药品产品批准文号")
+    private String approval_number;
+
+    public String getDrug_common_name() {
+        return drug_common_name;
+    }
+
+    public void setDrug_common_name(String drug_common_name) {
+        this.drug_common_name = drug_common_name;
+    }
+
+    public String getDrug_specification() {
+        return drug_specification;
+    }
+
+    public void setDrug_specification(String drug_specification) {
+        this.drug_specification = drug_specification;
+    }
+
+    public String getUsage_method() {
+        return usage_method;
+    }
+
+    public void setUsage_method(String usage_method) {
+        this.usage_method = usage_method;
+    }
+
+    public String getUsage_frequency_unit() {
+        return usage_frequency_unit;
+    }
+
+    public void setUsage_frequency_unit(String usage_frequency_unit) {
+        this.usage_frequency_unit = usage_frequency_unit;
+    }
+
+    public String getUsage_per_use_count() {
+        return usage_per_use_count;
+    }
+
+    public void setUsage_per_use_count(String usage_per_use_count) {
+        this.usage_per_use_count = usage_per_use_count;
+    }
+
+    public String getUsage_per_use_unit() {
+        return usage_per_use_unit;
+    }
+
+    public void setUsage_per_use_unit(String usage_per_use_unit) {
+        this.usage_per_use_unit = usage_per_use_unit;
+    }
+
+    public String getUsage_days() {
+        return usage_days;
+    }
+
+    public void setUsage_days(String usage_days) {
+        this.usage_days = usage_days;
+    }
+
+    public String getSale_amount() {
+        return sale_amount;
+    }
+
+    public void setSale_amount(String sale_amount) {
+        this.sale_amount = sale_amount;
+    }
+
+    public String getSale_unit() {
+        return sale_unit;
+    }
+
+    public void setSale_unit(String sale_unit) {
+        this.sale_unit = sale_unit;
+    }
+
+    public String getInstructions() {
+        return instructions;
+    }
+
+    public void setInstructions(String instructions) {
+        this.instructions = instructions;
+    }
+
+    public String getApproval_number() {
+        return approval_number;
+    }
+
+    public void setApproval_number(String approval_number) {
+        this.approval_number = approval_number;
+    }
+}

+ 486 - 0
src/main/java/com/github/yxyl120/opensdk/domain/order/OrderInfo.java

@@ -0,0 +1,486 @@
+package com.github.yxyl120.opensdk.domain.order;
+
+import com.github.yxyl120.opensdk.annotation.ApiFieldProperty;
+
+import java.util.ArrayList;
+
+/**
+ *
+ */
+public class OrderInfo {
+    /**
+     * 药品类型:01西药 02中药
+     */
+    @ApiFieldProperty(notes = "药品类型:01西药 02中药", required = false)
+    private String rp_type;
+
+    /**
+     * 处方单ID(唯一ID)
+     */
+    @ApiFieldProperty(notes = "处方单ID(唯一ID)")
+    private String rp_id;
+
+    /**
+     * 门店ID
+     */
+    @ApiFieldProperty(notes = "门店ID")
+    private String pharmacy_code;
+
+    /**
+     * 门店名称
+     */
+    @ApiFieldProperty(notes = "门店名称")
+    private String pharmacy_name;
+
+    /**
+     * 病情描述(主诉)
+     */
+    @ApiFieldProperty(notes = "病情描述(主诉)")
+    private String chief_complaint;
+
+    /**
+     * 现病史
+     */
+    @ApiFieldProperty(notes = "现病史", required = false)
+    private String now_illness;
+
+    /**
+     * 既往史
+     */
+    @ApiFieldProperty(notes = "既往史", required = false)
+    private String history_illness;
+
+    /**
+     * 患者年龄
+     */
+    @ApiFieldProperty(notes = "患者年龄")
+    private Integer patient_age;
+
+    /**
+     * 患者姓名
+     */
+    @ApiFieldProperty(notes = "患者姓名")
+    private String patient_name;
+
+    /**
+     * 体重
+     */
+    @ApiFieldProperty(notes = "体重", required = false)
+    private Integer weight;
+
+    /**
+     * 对应icd名称
+     */
+    @ApiFieldProperty(notes = "对应icd名称", required = false)
+    private String icd_name;
+
+    /**
+     * 对应icd名称2
+     */
+    @ApiFieldProperty(notes = "对应icd名称2", required = false)
+    private String icd_name2;
+
+    /**
+     * 是否有过敏史(传值:是/否)
+     */
+    @ApiFieldProperty(notes = "是否有过敏史(传值:是/否)")
+    private String is_history_allergic;
+
+    /**
+     * 过敏史
+     */
+    @ApiFieldProperty(notes = "过敏史", required = false)
+    private String history_allergic;
+
+    /**
+     * 肝功能是否异常(传值:是/否)
+     */
+    @ApiFieldProperty(notes = "肝功能是否异常(传值:是/否)")
+    private String liver_unusual;
+
+    /**
+     * 肾功能是否异常(传值:是/否)
+     */
+    @ApiFieldProperty(notes = "肾功能是否异常(传值:是/否)")
+    private String renal_unusual;
+
+    /**
+     * 是否是备孕/怀孕/哺乳期(传值:是/否)
+     */
+    @ApiFieldProperty(notes = "是否是备孕/怀孕/哺乳期(传值:是/否)")
+    private String lactation_flag;
+
+    /**
+     * 患者手机号(通过订单号去订单中心查)
+     */
+    @ApiFieldProperty(notes = "患者手机号(通过订单号去订单中心查)")
+    private String patient_tel;
+
+    /**
+     * 患者性别(传数字,1男
+     */
+    @ApiFieldProperty(notes = "患者性别(传数字,1男,2女)")
+    private String patient_gender;
+
+    /**
+     * 复诊凭证
+     */
+    @ApiFieldProperty(notes = "复诊凭证链接数组", required = false)
+    private ArrayList<String> record_pic;
+
+    /**
+     * 处方开具时间(来互联网医院开方的时间)
+     */
+    @ApiFieldProperty(notes = "处方开具时间(来互联网医院开方的时间)")
+    private String rp_create_time;
+
+    /**
+     * 处方文件格式(传值:png/jpg)
+     */
+    @ApiFieldProperty(notes = "处方文件格式(传值:png/jpg)")
+    private String rp_url_type;
+
+    /**
+     * 药师ID
+     */
+    @ApiFieldProperty(notes = "药师ID", required = false)
+    private String pharmacist_id;
+
+    /**
+     * 药师名称
+     */
+    @ApiFieldProperty(notes = "药师名称", required = false)
+    private String pharmacist_name;
+
+    /**
+     * 药师签名地址
+     */
+    @ApiFieldProperty(notes = "药师签名地址", required = false)
+    private String pharmacist_autograph;
+
+    /**
+     * 发药药师ID
+     */
+    @ApiFieldProperty(notes = "发药药师ID", required = false)
+    private String dispensing_pharmacist_id;
+
+    /**
+     * 发药药师名称
+     */
+    @ApiFieldProperty(notes = "发药药师名称", required = false)
+    private String dispensing_pharmacist_name;
+
+    /**
+     * 发药药师签名地址
+     */
+    @ApiFieldProperty(notes = "发药药师签名地址", required = false)
+    private String dispensing_pharmacist_autograph;
+
+    /**
+     * 配药药师ID
+     */
+    @ApiFieldProperty(notes = "配药药师ID", required = false)
+    private String deployment_pharmacist_id;
+
+    /**
+     * 配药药师名称
+     */
+    @ApiFieldProperty(notes = "配药药师名称", required = false)
+    private String deployment_pharmacist_name;
+
+    /**
+     * 配药药师签名地址
+     */
+    @ApiFieldProperty(notes = "配药药师签名地址", required = false)
+    private String deployment_pharmacist_autograph;
+
+    /**
+     * 是否提供药师审核,0-不使用一线平台的药师审核,1-使用一线平台的药师审核
+     */
+    @ApiFieldProperty(notes = "是否提供药师审核,0-不使用一线平台的药师审核,1-使用一线平台的药师审核", required = false)
+    private Integer is_pharmacist_audit;
+
+    /**
+     * 回调地址,如果填写,审核完处方后自动回调到第三方药房服务接口,参考3.1.4
+     */
+    @ApiFieldProperty(notes = "回调地址,如果填写,审核完处方后自动回调到第三方药房服务接口,参考3.1.4", required = false)
+    private String callback_url;
+
+    /**
+     * 订单药品列表
+     */
+    @ApiFieldProperty(notes = "订单药品列表", multipartField = true)
+    private ArrayList<DrugInfo> drug_list;
+
+    public String getRp_type() {
+        return rp_type;
+    }
+
+    public void setRp_type(String rp_type) {
+        this.rp_type = rp_type;
+    }
+
+    public String getRp_id() {
+        return rp_id;
+    }
+
+    public void setRp_id(String rp_id) {
+        this.rp_id = rp_id;
+    }
+
+    public String getPharmacy_code() {
+        return pharmacy_code;
+    }
+
+    public void setPharmacy_code(String pharmacy_code) {
+        this.pharmacy_code = pharmacy_code;
+    }
+
+    public String getPharmacy_name() {
+        return pharmacy_name;
+    }
+
+    public void setPharmacy_name(String pharmacy_name) {
+        this.pharmacy_name = pharmacy_name;
+    }
+
+    public String getChief_complaint() {
+        return chief_complaint;
+    }
+
+    public void setChief_complaint(String chief_complaint) {
+        this.chief_complaint = chief_complaint;
+    }
+
+    public String getNow_illness() {
+        return now_illness;
+    }
+
+    public void setNow_illness(String now_illness) {
+        this.now_illness = now_illness;
+    }
+
+    public String getHistory_illness() {
+        return history_illness;
+    }
+
+    public void setHistory_illness(String history_illness) {
+        this.history_illness = history_illness;
+    }
+
+    public Integer getPatient_age() {
+        return patient_age;
+    }
+
+    public void setPatient_age(Integer patient_age) {
+        this.patient_age = patient_age;
+    }
+
+    public String getPatient_name() {
+        return patient_name;
+    }
+
+    public void setPatient_name(String patient_name) {
+        this.patient_name = patient_name;
+    }
+
+    public Integer getWeight() {
+        return weight;
+    }
+
+    public void setWeight(Integer weight) {
+        this.weight = weight;
+    }
+
+    public String getIcd_name() {
+        return icd_name;
+    }
+
+    public void setIcd_name(String icd_name) {
+        this.icd_name = icd_name;
+    }
+
+    public String getIcd_name2() {
+        return icd_name2;
+    }
+
+    public void setIcd_name2(String icd_name2) {
+        this.icd_name2 = icd_name2;
+    }
+
+    public String getIs_history_allergic() {
+        return is_history_allergic;
+    }
+
+    public void setIs_history_allergic(String is_history_allergic) {
+        this.is_history_allergic = is_history_allergic;
+    }
+
+    public String getHistory_allergic() {
+        return history_allergic;
+    }
+
+    public void setHistory_allergic(String history_allergic) {
+        this.history_allergic = history_allergic;
+    }
+
+    public String getLiver_unusual() {
+        return liver_unusual;
+    }
+
+    public void setLiver_unusual(String liver_unusual) {
+        this.liver_unusual = liver_unusual;
+    }
+
+    public String getRenal_unusual() {
+        return renal_unusual;
+    }
+
+    public void setRenal_unusual(String renal_unusual) {
+        this.renal_unusual = renal_unusual;
+    }
+
+    public String getLactation_flag() {
+        return lactation_flag;
+    }
+
+    public void setLactation_flag(String lactation_flag) {
+        this.lactation_flag = lactation_flag;
+    }
+
+    public String getPatient_tel() {
+        return patient_tel;
+    }
+
+    public void setPatient_tel(String patient_tel) {
+        this.patient_tel = patient_tel;
+    }
+
+    public String getPatient_gender() {
+        return patient_gender;
+    }
+
+    public void setPatient_gender(String patient_gender) {
+        this.patient_gender = patient_gender;
+    }
+
+    public ArrayList<String> getRecord_pic() {
+        return record_pic;
+    }
+
+    public void setRecord_pic(ArrayList<String> record_pic) {
+        this.record_pic = record_pic;
+    }
+
+    public String getRp_create_time() {
+        return rp_create_time;
+    }
+
+    public void setRp_create_time(String rp_create_time) {
+        this.rp_create_time = rp_create_time;
+    }
+
+    public String getRp_url_type() {
+        return rp_url_type;
+    }
+
+    public void setRp_url_type(String rp_url_type) {
+        this.rp_url_type = rp_url_type;
+    }
+
+    public String getPharmacist_id() {
+        return pharmacist_id;
+    }
+
+    public void setPharmacist_id(String pharmacist_id) {
+        this.pharmacist_id = pharmacist_id;
+    }
+
+    public String getPharmacist_name() {
+        return pharmacist_name;
+    }
+
+    public void setPharmacist_name(String pharmacist_name) {
+        this.pharmacist_name = pharmacist_name;
+    }
+
+    public String getPharmacist_autograph() {
+        return pharmacist_autograph;
+    }
+
+    public void setPharmacist_autograph(String pharmacist_autograph) {
+        this.pharmacist_autograph = pharmacist_autograph;
+    }
+
+    public String getDispensing_pharmacist_id() {
+        return dispensing_pharmacist_id;
+    }
+
+    public void setDispensing_pharmacist_id(String dispensing_pharmacist_id) {
+        this.dispensing_pharmacist_id = dispensing_pharmacist_id;
+    }
+
+    public String getDispensing_pharmacist_name() {
+        return dispensing_pharmacist_name;
+    }
+
+    public void setDispensing_pharmacist_name(String dispensing_pharmacist_name) {
+        this.dispensing_pharmacist_name = dispensing_pharmacist_name;
+    }
+
+    public String getDispensing_pharmacist_autograph() {
+        return dispensing_pharmacist_autograph;
+    }
+
+    public void setDispensing_pharmacist_autograph(String dispensing_pharmacist_autograph) {
+        this.dispensing_pharmacist_autograph = dispensing_pharmacist_autograph;
+    }
+
+    public String getDeployment_pharmacist_id() {
+        return deployment_pharmacist_id;
+    }
+
+    public void setDeployment_pharmacist_id(String deployment_pharmacist_id) {
+        this.deployment_pharmacist_id = deployment_pharmacist_id;
+    }
+
+    public String getDeployment_pharmacist_name() {
+        return deployment_pharmacist_name;
+    }
+
+    public void setDeployment_pharmacist_name(String deployment_pharmacist_name) {
+        this.deployment_pharmacist_name = deployment_pharmacist_name;
+    }
+
+    public String getDeployment_pharmacist_autograph() {
+        return deployment_pharmacist_autograph;
+    }
+
+    public void setDeployment_pharmacist_autograph(String deployment_pharmacist_autograph) {
+        this.deployment_pharmacist_autograph = deployment_pharmacist_autograph;
+    }
+
+    public Integer getIs_pharmacist_audit() {
+        return is_pharmacist_audit;
+    }
+
+    public void setIs_pharmacist_audit(Integer is_pharmacist_audit) {
+        this.is_pharmacist_audit = is_pharmacist_audit;
+    }
+
+    public String getCallback_url() {
+        return callback_url;
+    }
+
+    public void setCallback_url(String callback_url) {
+        this.callback_url = callback_url;
+    }
+
+    public ArrayList<DrugInfo> getDrug_list() {
+        return drug_list;
+    }
+
+    public void setDrug_list(ArrayList<DrugInfo> drug_list) {
+        this.drug_list = drug_list;
+    }
+}

+ 24 - 0
src/main/java/com/github/yxyl120/opensdk/domain/order/RespondOder.java

@@ -0,0 +1,24 @@
+package com.github.yxyl120.opensdk.domain.order;
+
+public class RespondOder {
+//     {
+//        "rp_id": "c80f1d2b38abb34ce83967b373bd896d", //处方单ID(唯一ID)
+//        "depart_name": "",   //科室名称
+//        "doctor_name": "汤云霞", //医生名字
+//        "rp_url": null,   //处方图片地址
+//        "diagnose": "",   //诊断
+//        "rp_msg": "已开方",
+//        "audit_reason": null,    //医生拒方原因
+//        "drugInfo": [
+//            {
+//                "drug_name": "阿莫西林胶囊-阿莫仙",   //药品名称
+//                "sale_amount": 2, //药品数量
+//                "drug_specification": "0.5g*24S"//药品规格
+//            }
+//        ],
+//        "create_date": "2021-04-09 14:37:34",
+//        "pharmacy_code": 489,    //药店ID
+//        "pharmacy_name": "康爱多大药房",    //药店名称
+//        "doctor_id": "1133"  //医生ID
+//    }
+}

+ 27 - 0
src/test/java/APITest.java

@@ -0,0 +1,27 @@
+import com.github.yxyl120.opensdk.Utils.HttpUtils;
+import com.github.yxyl120.opensdk.YxException;
+import com.github.yxyl120.opensdk.domain.RequestParameter;
+import com.github.yxyl120.opensdk.domain.order.OrderInfo;
+
+public class APITest {
+
+    public static void main(String[] args) {
+        try {
+            RequestParameter<OrderInfo> parameter = new RequestParameter<>();
+            parameter.setAct_id("uporder");
+            parameter.setManu_id("Y001");
+            parameter.setApp_id("aaaab");
+            parameter.setVersion(1.0);
+            parameter.setData(new OrderInfo());
+            OrderInfo data = parameter.getData();
+            data.setIs_history_allergic("否");
+            data.setPharmacy_code("0");
+            data.setRp_id("dfafefawe");
+
+            String pushOrder = HttpUtils.pushOrder("", parameter);
+            System.out.println(pushOrder);
+        } catch (YxException e) {
+            System.out.println(e.getMessage());
+        }
+    }
+}