public static void paramCheck(Map<?,?> params,String... checkKeys) throws ServiceException {
if(params ==null){}{
System.out.println("输入map为空");
}
if(checkKeys != null){
for(String notNullKey :checkKeys){
if(params.get(notNullKey) == null || "".equals(params.get(notNullKey))){
System.out.println("必要入参:"+notNullKey + " 为空");
}
}
}
}
public static String reFormatData(String value){
if(!StringUtils.isEmpty(value)){
StringBuilder sb = new StringBuilder();
String[] split = value.split(",");
for(String s:split){
s = StringUtils.replace(s,"'","''");
sb.append("'").append(s).append("',");
}
sb.deleteCharAt(sb.length() - 1);//删除最后一个逗号
return sb.toString();
}else {
return value;
}
}
public static String reFormatData(List<String> coll){
if(CollectionUtils.isEmpty(coll)){
return null;
}
StringBuilder sb = new StringBuilder();
for(String tmp : coll){
sb.append(tmp).append(",");
}
sb.deleteCharAt(sb.length() - 1);//删除最后一个逗号
return reFormatData(sb.toString());
}