소스 검색

修改bug

chenweida 9 년 전
부모
커밋
8fdcdbf2a0

+ 8 - 7
Hos-Resource-Rest/src/main/java/com/yihu/hos/gateway/control/GatewayControl.java

@ -42,15 +42,19 @@ public class GatewayControl {
     * @return
     */
    @RequestMapping("/transfer")
    public RestResponseResult transfer(HttpServletRequest request) {
    public Object transfer(HttpServletRequest request) {
        String resultData = null;
        RestRequsetResult restRequsetResult = new RestRequsetResult();
        RestResponseResult restResponseResult = new RestResponseResult();
        try {
            BeanUtils.populate(restRequsetResult, request.getParameterMap());
            //---start  扩展type和data两个参数 作用于API和param一样
            restRequsetResult.setApi(restRequsetResult.getType());
            restRequsetResult.setParam(restRequsetResult.getData());
            if (StringUtils.isEmpty(restRequsetResult.getApi())) {
                restRequsetResult.setApi(restRequsetResult.getType());
            }
            if (StringUtils.isEmpty(restRequsetResult.getParam())) {
                restRequsetResult.setParam(restRequsetResult.getData());
            }
            //---end
            //判断参数是否为空
            paramsIsNotNull(restRequsetResult.getApi());
@ -58,8 +62,7 @@ public class GatewayControl {
            ResourceRestDetailModel resourceRestDetailModel = gatewayService.getResourceRestDetailModelByCode(restRequsetResult.getApi());
            //根据资源对象的信息还有访问的参数通过httpclient得到数据
            resultData = getResultData(resourceRestDetailModel, restRequsetResult.getParam());
            restResponseResult = (RestResponseResult) JSONObject.toBean(JSONObject.fromObject(resultData), RestResponseResult.class);
            restResponseResult.setRequestId(restRequsetResult.getRequestId());
            return resultData;
        } catch (Exception e) {
            e.printStackTrace();
            if (e instanceof EHRException) {
@ -71,8 +74,6 @@ public class GatewayControl {
                return RestResponseResult.getError(EHRExceptionConstant.EHREXCEPTION_SYSTEMEXCEPTION, EHRExceptionConstant.EHREXCEPTION_SYSTEMEXCEPTION_MESSAGE);
            }
        }
        return restResponseResult;
    }
    /**

+ 12 - 12
Hos-Resource-Rest/src/main/java/com/yihu/hos/qlc/controller/QLCController.java

@ -59,12 +59,12 @@ public class QLCController {
        SQLResponResult restResponseResult = new SQLResponResult();
        Object s = null;
        try {
            isEmpty(EventType, "EventType为空");
            isEmpty(EventNo, "EventNo为空");
            isEmpty(CardType, "CardType为空");
            isEmpty(CardNo, "CardNo为空");
            isEmpty(PatientId, "PatientId为空");
            isEmpty(HospitalId, "HospitalId为空");
            isEmpty(EventType, "EventType is null");
            isEmpty(EventNo, "EventNo is null");
            isEmpty(CardType, "CardType is null");
            isEmpty(CardNo, "CardNo is null");
            isEmpty(PatientId, "PatientId is null");
            isEmpty(HospitalId, "HospitalId is null");
            String param = "<Req><TransactionCode>5001</TransactionCode><Data><CardType>" + CardType + "</CardType><CardNo>" + CardNo + "</CardNo><PatientId>" + PatientId + "</PatientId></Data></Req>";
            String apiparam = "{\"ChannelId\"=\"" + Config.channelId + "\"," +
@ -129,12 +129,12 @@ public class QLCController {
        SQLResponResult restResponseResult = new SQLResponResult();
        Object s = null;
        try {
            isEmpty(CardType, "CardType为空");
            isEmpty(CardNo, "CardNo为空");
            isEmpty(ReportType, "ReportType为空");
            isEmpty(ReportId, "ReportId为空");
            isEmpty(State, "State为空");
            isEmpty(HospitalId, "HospitalId为空");
            isEmpty(CardType, "CardType is null");
            isEmpty(CardNo, "CardNo is null");
            isEmpty(ReportType, "ReportType is null");
            isEmpty(ReportId, "ReportId is null");
            isEmpty(State, "State is null");
            isEmpty(HospitalId, "HospitalId is null");
            if ("1".equals(State)) {
                throw new Exception("报告未出,结束");