Переглянути джерело

Merge branch 'dev' of demon/patient-co-management into dev

zlf 8 роки тому
батько
коміт
1ebfc502df

+ 11 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/OutpatientService.java

@ -209,12 +209,22 @@ public class OutpatientService extends BaseService {
    public static void main(String[] args) {
        OutpatientService service = new OutpatientService();
        try {
            service.getOutpatientInfo("", "", "", "");
            service.getOutpatientCost("", "", "", "");
            service.getOutpatientExamReport("", "", "", "");
            service.getOutpatientLabReport("", "", "", "");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public JSONObject xmlToJson(String xml) throws Exception {
        JSONObject result = new JSONObject();
        //TODO  示例数据,未转成前端需要
        String xmlJson = XMLUtil.xml2json(xml);
        result  = new JSONObject(xmlJson);
        return result;
    }
}

+ 19 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/OutpatientController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -45,4 +46,22 @@ public class OutpatientController extends BaseController {
            return invalidUserException(e, -1, "获取门/急诊数据失败!");
        }
    }
    @ApiOperation("XML转JSOn")
    @RequestMapping(value = "/xmlToJson", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public String xmlToJson(@ApiParam(name="strSSID",value="xml",defaultValue = "B09036263193")
                                      @RequestParam(value="xml",required = true) String xml) {
        try {
            JSONObject result = outpatientService.xmlToJson(xml);
            return write(200, "获取JSOn数据成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取JSOn数据成功!");
        }
    }
}