Forráskód Böngészése

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/wechat/WechatMenuController.java
wangzhinan 4 éve
szülő
commit
12b52b4385

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

@ -1956,7 +1956,7 @@ public class EntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray BS10144(String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone, boolean demoFlag) throws Exception {
    public String BS10144(String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone, boolean demoFlag) throws Exception {
        String fid = "BS10144";
        String resp = "";
        if (demoFlag) {
@ -1972,10 +1972,10 @@ public class EntranceService {
            sbs.append("<as_xml><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root><resquest DeptCode=\""+deptCode+"\" DocCode=\""+docCode+"\" ampm=\"a\" StartTime=\""+startTime+"\" SSID=\""+sSID+"\" PatientName=\""+patientName+"\" PatientID=\""+patientID+"\" PatientPhone=\""+patientPhone+"\"></resquest></root>]]></as_xml>");
            sbs.append("</Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            resp = MqSdkUtil.xml2jsonArrayRootRowBS10144(resp);
            logger.info("resp"+resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return resp;
    }
    /**
@ -1991,7 +1991,7 @@ public class EntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray BS10145(String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone, boolean demoFlag) throws Exception {
    public String BS10145(String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone, boolean demoFlag) throws Exception {
        String fid = "BS10145";
        String resp = "";
        if (demoFlag) {
@ -2007,10 +2007,10 @@ public class EntranceService {
            sbs.append("<as_xml><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root><resquest DeptCode=\""+deptCode+"\" DocCode=\""+docCode+"\" ampm=\"a\" StartTime=\""+startTime+"\" SSID=\""+sSID+"\" PatientName=\""+patientName+"\" PatientID=\""+patientID+"\" PatientPhone=\""+patientPhone+"\"></resquest></root>]]></as_xml>");
            sbs.append("</Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
            resp = MqSdkUtil.xml2jsonArrayRootRowBS10144(resp);
            logger.info("resp"+resp);
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return resp;
    }

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

@ -428,5 +428,31 @@ public class MqSdkUtil {
        return json;
    }
    /**
     * 将xml字符串<STRONG>转换</STRONG>为JSON字符串,msg的根节点为row
     * XML中Msg为数组
     *
     * @param xmlString xml字符串
     * @return JSON<STRONG>对象</STRONG>
     */
    public static String xml2jsonArrayRootRowBS10144(String xmlString) throws Exception {
        XMLSerializer xmlSerializer = new XMLSerializer();
        JSON json = xmlSerializer.read(xmlString);
        log.info("xmlString"+json);
        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.JSONObject) json).element("MsgInfo",  jsonObject);
            log.info("xmlString===="+json);
        }else if(retCode.equals("0")){
            //重新封装到json中
            ((net.sf.json.JSONObject) json).element("MsgInfo",   ((JSONObject) retInfo).get("RetCon"));
        }
        return getMsgInfo(json);
    }
}

+ 4 - 4
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -407,7 +407,7 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @GetMapping(value = "/BS10144")
    @ApiOperation(value = "核酸预约")
    public ListEnvelop BS10144(@ApiParam(name = "deptCode", value = "科室code")
    public Envelop BS10144(@ApiParam(name = "deptCode", value = "科室code")
                               @RequestParam(value = "deptCode", required = true) String deptCode,
                               @ApiParam(name = "docCode", value = "医生code")
                               @RequestParam(value = "docCode", required = true) String docCode,
@ -422,13 +422,13 @@ public class MqSdkController extends EnvelopRestEndpoint {
                               @ApiParam(name = "patientPhone", value = "患者手机号")
                                   @RequestParam(value = "patientPhone", required = true) String patientPhone) throws Exception{
        //String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone
        JSONArray  obj = entranceService.BS10144(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag);
        String   obj = entranceService.BS10144(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/BS10145")
    @ApiOperation(value = "核酸预约")
    public ListEnvelop BS10145(@ApiParam(name = "deptCode", value = "科室code")
    public Envelop BS10145(@ApiParam(name = "deptCode", value = "科室code")
                               @RequestParam(value = "deptCode", required = true) String deptCode,
                               @ApiParam(name = "docCode", value = "医生code")
                               @RequestParam(value = "docCode", required = true) String docCode,
@ -443,7 +443,7 @@ public class MqSdkController extends EnvelopRestEndpoint {
                               @ApiParam(name = "patientPhone", value = "患者手机号")
                               @RequestParam(value = "patientPhone", required = true) String patientPhone) throws Exception{
        //String deptCode,String docCode,String startTime,String sSID,String patientName,String patientID,String patientPhone
        JSONArray  obj = entranceService.BS10145(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag);
        String  obj = entranceService.BS10145(deptCode,docCode,startTime,sSID,patientName,patientID,patientPhone,demoFlag);
        return success(obj);
    }