Commit 7e986872 by 吴佳

前端请求没有params参数时,获取params子元素前先判空

parent d22d266a
......@@ -5,6 +5,7 @@ import com.brilliance.mda.runtime.mda.IDatafield;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import java.util.List;
......@@ -19,11 +20,13 @@ public class CheckedParams {
public static void checkedParamsInit(BaseVO req) {
List<Integer> chkIds = null;
String chkDst = null;
if(req.getParams().containsKey(CHK_IDS)){
chkIds = (List<Integer>) req.getParams().get(CHK_IDS);
}
if(req.getParams().containsKey(CHK_DST)){
chkDst = (String)req.getParams().get(CHK_DST);
if(!MdaUtils.isEmpty(req.getParams())) {
if (req.getParams().containsKey(CHK_IDS)) {
chkIds = (List<Integer>) req.getParams().get(CHK_IDS);
}
if (req.getParams().containsKey(CHK_DST)) {
chkDst = (String) req.getParams().get(CHK_DST);
}
}
if(chkDst == null){
return ;
......
......@@ -4,6 +4,7 @@ import com.brilliance.mda.runtime.mda.*;
import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.driver.MdaEnv;
import com.brilliance.mda.runtime.mda.impl.StreamImpl;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Strings;
import com.brilliance.mda.runtime.mda.util.Systems;
......@@ -24,11 +25,13 @@ public class SelectedParams {
public static void selectedParamsInit(BaseVO req){
List<Integer> selIds = null;
String selDst = null;
if(req.getParams().containsKey(SEL_IDS)){
selIds = (List<Integer>) req.getParams().get(SEL_IDS);
}
if(req.getParams().containsKey(SEL_DST)){
selDst = (String)req.getParams().get(SEL_DST);
if(!MdaUtils.isEmpty(req.getParams())) {
if (req.getParams().containsKey(SEL_IDS)) {
selIds = (List<Integer>) req.getParams().get(SEL_IDS);
}
if (req.getParams().containsKey(SEL_DST)) {
selDst = (String) req.getParams().get(SEL_DST);
}
}
if(selIds == null || selIds.size() == 0){
......@@ -65,9 +68,11 @@ public class SelectedParams {
Systems.setAttribute(dist.getParent(),dist.getName(),ButtonIndex,selIds.get(0));
String selBtnId = "";
if(req.getParams().containsKey(SEL_BTN_ID)){
selBtnId = (String) req.getParams().get(SEL_BTN_ID);
Systems.setAttribute(dist.getParent(),dist.getName(),ButtonId,selBtnId);
if(!MdaUtils.isEmpty(req.getParams())) {
if (req.getParams().containsKey(SEL_BTN_ID)) {
selBtnId = (String) req.getParams().get(SEL_BTN_ID);
Systems.setAttribute(dist.getParent(), dist.getName(), ButtonId, selBtnId);
}
}
}
}
......
......@@ -7,6 +7,7 @@ import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.driver.MdaEnv;
import com.brilliance.mda.runtime.mda.impl.AbstractScopeEmitter;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.util.MdaUtils;
import com.brilliance.mda.runtime.mda.util.Modules;
import com.brilliance.mda.runtime.request.BaseVO;
import com.brilliance.mda.runtime.request.CheckedParams;
......@@ -100,8 +101,10 @@ public abstract class AbstractRouteService<V extends BaseVO> {
Map<String, Object> params = null;
if (req != null) {
params = req.getParams();
if (req.getParams().containsKey("trn")) {
return new ResponseSet<V>(req);
if(!MdaUtils.isEmpty(params)) {
if (req.getParams().containsKey("trn")) {
return new ResponseSet<V>(req);
}
}
}
stopWatch.stop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment