Explorar o código

医生信息同步修改

zdm %!s(int64=5) %!d(string=hai) anos
pai
achega
81f35ad7a6

+ 3 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -1404,7 +1404,7 @@ public class EntranceService {
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            resp = MqSdkUtil.xml2jsonArrayRootRowMS02003(resp);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
@ -1415,9 +1415,9 @@ public class EntranceService {
            sbs.append("<MsgInfo><endNum>10000</endNum><Msg></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            resp = MqSdkUtil.xml2jsonArrayRootRowMS02003(resp);
        }
            net.sf.json.JSONArray jsonArray = ConvertUtil.convertListEnvelopInBodyRow(resp);
            net.sf.json.JSONArray jsonArray = ConvertUtil.convertListEnvelopInBodyRowMS02003(resp);
            for (Object object : jsonArray) {
                net.sf.json.JSONObject jsonObjectBody = (net.sf.json.JSONObject) object;
                String doctorCode = "";

+ 33 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/util/ConvertUtil.java

@ -1,7 +1,5 @@
package com.yihu.jw.hospital.prescription.service.entrance.util;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@ -180,4 +178,37 @@ public class ConvertUtil {
        }
        return  null;
    }
    /**
     * 返回对象数组数据解析
     * @param obj
     * @return
     * @throws Exception
     */
    public static  JSONArray convertListEnvelopInBodyRowMS02003(String obj)throws Exception{
        JSONObject jsonObject=JSONObject.fromObject(obj);
        JSONArray jsonArray=new JSONArray();
        if(null!=jsonObject&&"1".equals(jsonObject.get("code").toString())){
            JSONArray jsonObjectMgsInfo=(JSONArray)jsonObject.get("MsgInfo");
            if(null!=jsonObjectMgsInfo){
                for (Object object : jsonObjectMgsInfo) {
                    if(object instanceof JSONArray){
                        //获取到数组中的CDATA进行再解析
                        net.sf.json.JSONArray jsonArraySub = (net.sf.json.JSONArray) object;
                        for (Object objectSub : jsonArraySub) {
                            if(null!=objectSub){
                                jsonArray.add(objectSub) ;
                            }
                        }
                        }
                }
                return jsonArray;
            }else {
                return null;
            }
        }else {
            return  null;
        }
    }
}

+ 44 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/util/MqSdkUtil.java

@ -357,5 +357,49 @@ public class MqSdkUtil {
        return "";
    }
    /**
     * 将xml字符串<STRONG>转换</STRONG>为JSON字符串,msg的根节点为row
     * XML中Msg为数组
     *
     * @param xmlString xml字符串
     * @return JSON<STRONG>对象</STRONG>
     */
    public static String xml2jsonArrayRootRowMS02003(String xmlString) throws Exception {
        XMLSerializer xmlSerializer = new XMLSerializer();
        JSON json = xmlSerializer.read(xmlString);
        Object retInfo=  ((JSONObject) json).get("RetInfo");
        Object retCode= ((JSONObject) retInfo).get("RetCode");
        if(retCode.equals("1")){
            //成功
            Object jsonObject = ((net.sf.json.JSONObject) json).get("MsgInfo");
            net.sf.json.JSONArray jsonArray1 = new net.sf.json.JSONArray();
            if (null != jsonObject) {
                net.sf.json.JSONObject jsonObject1 = (net.sf.json.JSONObject) jsonObject;
                Object objectMsg=jsonObject1.get("Msg");
                if(objectMsg instanceof String){
                    JSON jsonsub = xmlSerializer.read(jsonObject1.get("Msg").toString());
                    Object jsonsubBody=  ((JSONObject) jsonsub).get("body");
                    jsonArray1.add(jsonsubBody);
                    //重新封装到json中
                    ((net.sf.json.JSONObject) json).element("MsgInfo", jsonArray1);
                }else if(objectMsg instanceof JSONArray){
                    //获取到数组中的CDATA进行再解析
                    net.sf.json.JSONArray jsonArray = (net.sf.json.JSONArray) jsonObject1.get("Msg");
                    for (Object object : jsonArray) {
                        JSON jsonsub = xmlSerializer.read(object.toString());
                        jsonArray1.add(jsonsub);
                    }
                    //重新封装到json中
                    ((net.sf.json.JSONObject) json).element("MsgInfo", jsonArray1);
                }
            }
        }else if(retCode.equals("0")){
            //重新封装到json中
            ((net.sf.json.JSONObject) json).element("MsgInfo",   ((JSONObject) retInfo).get("RetCon"));
        }
        return getMsgInfo(json);
    }
}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
business/base-service/src/mqConfig/mqdata/MS02003.json


+ 5 - 0
svr/svr-internet-hospital-entrance/pom.xml

@ -158,6 +158,11 @@
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>xom</groupId>
            <artifactId>xom</artifactId>
            <version>1.2.5</version>
        </dependency>
    </dependencies>