From d3ca566eafa6fac343b7664c37d73b49de116a23 Mon Sep 17 00:00:00 2001 From: yangfei Date: Wed, 22 Nov 2017 16:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyms/platform/operate/web/controller/SyncDataController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java index 70a7128..dc03cb1 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java @@ -4,7 +4,6 @@ import com.lyms.platform.biz.service.SyncDataService; import com.lyms.platform.common.base.BaseController; import com.lyms.platform.common.constants.ErrorCodeConstants; import com.lyms.platform.common.pojo.SyncDataModel; -import com.lyms.platform.common.result.BaseListResponse; import com.lyms.platform.common.result.BaseResponse; import com.lyms.platform.common.utils.Config; import com.lyms.platform.common.utils.ExceptionUtils; @@ -87,18 +86,18 @@ public class SyncDataController extends BaseController { @RequestParam(value = "method", required = true) String method ) { //返回值 - BaseListResponse baseResponse = null; + BaseResponse baseResponse = new BaseResponse(); try { System.out.println("数据同步开始:action:" + action + ",method:" + method+",synForm:"+synForm); WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext(); if(StringUtils.isNotEmpty(synForm)){//如果有参数 Method mh = ReflectionUtils.findMethod(webApplicationContext.getBean(action).getClass(), method, new Class[]{String.class}); - baseResponse = (BaseListResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), synForm); + baseResponse = (BaseResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), synForm); }else{//无参数 Method mh = ReflectionUtils.findMethod(webApplicationContext.getBean(action).getClass(), method, null); if(mh!=null){ - baseResponse = (BaseListResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), null); + baseResponse = (BaseResponse) ReflectionUtils.invokeMethod(mh, webApplicationContext.getBean(action), null); }else{ baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); baseResponse.setErrormsg("没有找到:"+action+",中的:"+method+"方法!请确认传入参数"); -- 1.8.3.1