|
|
@@ -9,6 +9,8 @@ import java.util.Map;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
+import com.uas.eis.entity.ErrorMsg;
|
|
|
+import com.uas.eis.exception.SystemException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -223,24 +225,24 @@ public class QueryServiceImpl implements QueryService {
|
|
|
private void checkParam(String code, String param){
|
|
|
com.alibaba.fastjson.JSONObject json = JSON.parseObject(param);
|
|
|
if(StringUtils.isEmpty(code)){
|
|
|
- BaseUtil.showError("查询方案编号不能为空", "NULL_QUERY_CODE");
|
|
|
+ throw new SystemException(ErrorMsg.NULL_QUERY_CODE);
|
|
|
}
|
|
|
if(json == null){
|
|
|
- BaseUtil.showError("传入的参数个数不正确", "PARAM_AMOUNT_ERROR");
|
|
|
+ throw new SystemException(ErrorMsg.PARAM_AMOUNT_ERROR);
|
|
|
}
|
|
|
String getInParamsSql = "select * from queryArgs where qa_qccode = ? and qa_relation is null";
|
|
|
List<QueryArgs> inParamList = baseDao.query(getInParamsSql, QueryArgs.class, code);
|
|
|
if(inParamList.size() != json.size()){
|
|
|
- BaseUtil.showError("传入的参数个数不正确", "PARAM_AMOUNT_ERROR");
|
|
|
+ throw new SystemException(ErrorMsg.PARAM_AMOUNT_ERROR);
|
|
|
}else{
|
|
|
for(QueryArgs queryArgs : inParamList){
|
|
|
if(json.getString(queryArgs.getQa_param()) == null){
|
|
|
- BaseUtil.showError("传入的参数名不正确", "PARAM_NAME_ERROR");
|
|
|
+ throw new SystemException(ErrorMsg.PARAM_NAME_ERROR);
|
|
|
}else{
|
|
|
if("array".equals(queryArgs.getQa_paramtype())){
|
|
|
String stringArray = json.getString(queryArgs.getQa_param());
|
|
|
if(!(stringArray.contains("[") && stringArray.contains("]"))){
|
|
|
- BaseUtil.showError("传入的参数:"+queryArgs.getQa_param()+"格式不正确", "PARAM_FORMAT_ERROR");
|
|
|
+ throw new SystemException(ErrorMsg.PARAM_FORMAT_ERROR);
|
|
|
}
|
|
|
}
|
|
|
}
|