本文整理汇总了Java中jodd.util.StringUtil.isNotBlank方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.isNotBlank方法的具体用法?Java StringUtil.isNotBlank怎么用?Java StringUtil.isNotBlank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jodd.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.isNotBlank方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: allArea
import jodd.util.StringUtil; //导入方法依赖的package包/类
public EArea allArea(WMap query) {
//处理查询条件
Criteria cnd = Cnd.cri();
cnd.where().andEquals("del_flag", Constans.POS_NEG.NEG);
if (query.get("extId") != null && StringUtil.isNotBlank(query.get("extId").toString())) {
cnd.where().andNotIn("id", query.get("extId").toString());
cnd.where().andNotLike("parent_ids", "%," + query.get("extId").toString() + ",%");
}
cnd.getOrderBy().asc("sort");
List<EArea> allAreas = query(cnd);
List<ITreeNode<EArea>> allNodes = new ArrayList<>();
EArea root = new EArea();
root.setId(0L);
allNodes.add(root);
if (allAreas != null && !allAreas.isEmpty()) {
allNodes.addAll(allAreas);
}
return (EArea) root.buildTree(allNodes);
}
示例2: getUser
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping(value = "/currInfo", method = RequestMethod.GET)
public ActionResultObj getUser() {
ActionResultObj result = new ActionResultObj();
// 获取当前用户
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if (StringUtil.isNotBlank(userDetails.getUsername())) {
EUser currentUser = userDao.fetchByName(userDetails.getUsername());
EAccount account = accountDao.fetch(currentUser);
EOrg org = orgDao.fetch(currentUser.getOrgId());
WMap map = new WMap();
map.put("userName", account != null ? account.getFullName() : currentUser.getUsername());
map.put("accountId", account != null ? account.getId() : "");
map.put("orgName", org.getName());
result.ok(map);
} else {
result.errorMsg("获取失败");
}
return result;
}
示例3: save
import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
* 新增一个用户,同时增加account和user
*
* @param account
* @return
*/
@RequestMapping(value = "/save")
public ActionResultObj save(@RequestBody EAccount account) {
ActionResultObj result = new ActionResultObj();
try {
account = userDetailsService.saveUser(account);
if (account.getId() != null && account.getId() != 0) {
result.okMsg("保存成功!");
} else {
result.errorMsg("保存失败!");
}
} catch (Exception e) {
LOG.error("保存失败,原因:" + e.getMessage());
result.error(e);
EUser user = account.getUser();
if (user.getUsername() != null && StringUtil.isNotBlank(user.getUsername())) {
if (userDetailsService.isUserExisted(user.getUsername())) {
result.errorMsg("用户 " + user.getUsername() + " 已存在!");
}
}
}
return result;
}
示例4: findByType
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping(value="type/{type}")
public ActionResultObj findByType(@PathVariable String type){
ActionResultObj result = new ActionResultObj();
try{
if(StringUtil.isNotBlank(type)){
List<EDict> dictList = dictDao.query(Cnd.where("type", "=", type).and("del_flag", "=", Constans.POS_NEG.NEG).orderBy("sort", "asc"));
//处理返回值
WMap map = new WMap();
map.put("type", type);
map.put("data", dictList);
result.ok(map);
result.okMsg("查询成功!");
}else{
result.errorMsg("查询失败,字典类型不存在!");
}
}catch(Exception e){
e.printStackTrace();
LOG.error("查询失败,原因:"+e.getMessage());
result.error(e);
}
return result;
}
示例5: findAllmenu
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping(value = "/allMenu", method = RequestMethod.POST)
public ActionResultObj findAllmenu(@RequestBody SearchQueryJS queryJs) {
ActionResultObj result = new ActionResultObj();
try {
WMap query = queryJs.getQuery();
//处理查询条件
Criteria cnd = Cnd.cri();
cnd.where().andEquals("del_flag", Constans.POS_NEG.NEG);
if (query.get("extId") != null && StringUtil.isNotBlank(query.get("extId").toString())) {
cnd.where().andNotIn("id", query.get("extId").toString());
cnd.where().andNotLike("parent_ids", "%," + query.get("extId").toString() + ",%");
}
cnd.getOrderBy().asc("sort");
List<EMenu> allMenus = menuDao.query(cnd);
EMenu menu = menuDao.buildMenuTree(allMenus);
WMap map = new WMap();
map.put("data", menu.getItems());
result.setData(map);
result.okMsg("查询成功!");
} catch (Exception e) {
e.printStackTrace();
LOG.error("查询失败,原因:" + e.getMessage());
result.error(e);
}
return result;
}
示例6: getDruidPlugin
import jodd.util.StringUtil; //导入方法依赖的package包/类
/**
* ��ȡDruid���ӳ�
*
* @param druidConfig
* @return
*/
public static DruidPlugin getDruidPlugin(Properties druidConfig) {
DruidPlugin druidPlugin = new DruidPlugin(druidConfig.getProperty("jdbc.url"), druidConfig.getProperty("jdbc.username"), druidConfig.getProperty("jdbc.password"), druidConfig.getProperty("jdbc.driverClass"));
if(StringUtil.isNotBlank(druidConfig.getProperty("jdbc.MaxActive"))) {
druidPlugin = druidPlugin.setMaxActive(Integer.parseInt(druidConfig.getProperty("jdbc.MaxActive")));
}
if(StringUtil.isNotBlank(druidConfig.getProperty("jdbc.MinIdle"))) {
druidPlugin = druidPlugin.setMinIdle(Integer.parseInt(druidConfig.getProperty("jdbc.MinIdle")));
}
if(StringUtil.isNotBlank(druidConfig.getProperty("jdbc.MaxActive"))) {
druidPlugin = druidPlugin.setInitialSize(Integer.parseInt(druidConfig.getProperty("jdbc.InitialSize")));
}
if(StringUtil.isNotBlank(druidConfig.getProperty("jdbc.MinEvictableIdleTimeMillis"))) {
druidPlugin = druidPlugin.setMinEvictableIdleTimeMillis(Integer.parseInt(druidConfig.getProperty("jdbc.MinEvictableIdleTimeMillis")));
}
if(StringUtil.isNotBlank(druidConfig.getProperty("jdbc.MaxPoolPreparedStatementPerConnectionSize"))) {
druidPlugin = druidPlugin.setMaxPoolPreparedStatementPerConnectionSize(Integer.parseInt(druidConfig.getProperty("jdbc.MaxPoolPreparedStatementPerConnectionSize")));
}
if(StringUtil.isNotBlank(druidConfig.getProperty("jdbc.timeBetweenEvictionRunsMillis"))) {
druidPlugin = druidPlugin.setTimeBetweenEvictionRunsMillis(Integer.parseInt(druidConfig.getProperty("jdbc.timeBetweenEvictionRunsMillis")));
}
if(StringUtil.isNotBlank(druidConfig.getProperty("jdbc.minEvictableIdleTimeMillis"))) {
druidPlugin = druidPlugin.setMinEvictableIdleTimeMillis(Integer.parseInt(druidConfig.getProperty("jdbc.minEvictableIdleTimeMillis")));
}
return druidPlugin;
}
示例7: getPids
import jodd.util.StringUtil; //导入方法依赖的package包/类
public List<Long> getPids() {
if (!StringUtil.equals(parentIds, ",0,")) {
pids = new ArrayList<>();
parentIds = StringUtil.replace(parentIds, ",0,", "");
String[] pidsStr = StringUtil.split(parentIds, ",");
for (String pidStr : pidsStr) {
if (StringUtil.isNotBlank(pidStr) && !StringUtil.equals(pidStr, "0")) {
pids.add(Long.parseLong(pidStr));
}
}
return pids;
}
return new ArrayList<>();
}
示例8: parseLong
import jodd.util.StringUtil; //导入方法依赖的package包/类
public static Long parseLong(Object number) {
if (number != null && number instanceof Number) {
return ((Number) number).longValue();
} else if (number != null && number instanceof BigDecimal) {
return ((Number) number).longValue();
} else if (number != null && StringUtil.isNotBlank(number.toString())) {
return Long.parseLong(number.toString().trim());
}
return null;
}
示例9: parseDouble
import jodd.util.StringUtil; //导入方法依赖的package包/类
public static Double parseDouble(Object number) {
if (number != null && number instanceof Number) {
return ((Number) number).doubleValue();
} else if (number != null && number instanceof BigDecimal) {
return ((Number) number).doubleValue();
} else if (number != null && StringUtil.isNotBlank(number.toString())) {
return Double.parseDouble(number.toString().trim());
}
return null;
}
示例10: getOrgsByListByType
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping(value = "/getOrgs/{type}")
public ActionResultObj getOrgsByListByType(@PathVariable String type) {
ActionResultObj result = new ActionResultObj();
try {
if (StringUtil.isNotBlank(type)) {
// 处理查询条件
Criteria cnd = Cnd.cri();
if(!type.equals("all")){
cnd.where().andEquals("type", type);
}
cnd.getOrderBy().desc("id");
// 分页查询
List<EOrg> orgList = orgDao.query(cnd);
// 处理返回值
WMap map = new WMap();
map.put("data", orgList);
result.ok(map);
result.okMsg("查询成功!");
} else {
result.errorMsg("删除失败,链接不存在!");
}
} catch (Exception e) {
e.printStackTrace();
LOG.error("查询失败,原因:" + e.getMessage());
result.error(e);
}
return result;
}
示例11: list
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping(value="list")
public ActionResultObj list(@RequestBody SearchQueryJS queryJs){
ActionResultObj result = new ActionResultObj();
try{
Pager pager = queryJs.toPager();
WMap query = queryJs.getQuery();
//处理查询条件
Criteria cnd = Cnd.cri();
if(query.get("type") != null && StringUtil.isNotBlank(query.get("type").toString())){
cnd.where().andEquals("type", query.get("type").toString());
}
cnd.getGroupBy().groupBy("type");
cnd.getOrderBy().desc("sort");
//分页查询
List<EDict> projectList = dictDao.query(cnd, pager);
//处理返回值
WMap map = new WMap();
if(queryJs.getQuery() != null){
map.putAll(queryJs.getQuery());
}
map.put("data", projectList);
map.put("page", queryJs.toWPage(pager));
result.ok(map);
result.okMsg("查询成功!");
}catch(Exception e){
e.printStackTrace();
LOG.error("查询失败,原因:"+e.getMessage());
result.error(e);
}
return result;
}
示例12: list
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping(value = "/list")
public ActionResultObj list(@RequestBody SearchQueryJS queryJs) {
ActionResultObj result = new ActionResultObj();
try {
Pager pager = queryJs.toPager();
WMap query = queryJs.getQuery();
//处理查询条件
Criteria cnd = Cnd.cri();
cnd.where().andEquals("del_flag", Constans.POS_NEG.NEG);
if (query.get("name") != null && StringUtil.isNotBlank(query.get("name").toString())) {
cnd.where().andLike("name", query.get("name").toString()).orLike("full_name", query.get("name").toString());
}
cnd.getOrderBy().asc("sort");
//分页查询
List<EArea> areaList = areaDao.query(cnd, pager);
pager.setRecordCount(areaDao.count(cnd));
//处理返回值
WMap map = new WMap();
if (queryJs.getQuery() != null) {
map.putAll(queryJs.getQuery());
}
map.put("data", areaList);
map.put("page", queryJs.toWPage(pager));
result.ok(map);
result.okMsg("查询成功!");
} catch (Exception e) {
e.printStackTrace();
LOG.error("查询失败,原因:" + e.getMessage());
result.error(e);
}
return result;
}
示例13: list
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping(value="/list")
public ActionResultObj list(@RequestBody SearchQueryJS queryJs){
ActionResultObj result = new ActionResultObj();
try{
Pager pager = queryJs.toPager();
WMap query = queryJs.getQuery();
//处理查询条件
Criteria cnd = Cnd.cri();
if(query.get("type") != null && StringUtil.isNotBlank(query.get("type").toString())){
cnd.where().andEquals("type", query.get("type").toString());
}
cnd.getGroupBy().groupBy("type");
cnd.getOrderBy().desc("sort");
//分页查询
List<EFile> projectList = fileDao.query(cnd, pager);
//处理返回值
WMap map = new WMap();
if(queryJs.getQuery() != null){
map.putAll(queryJs.getQuery());
}
map.put("data", projectList);
map.put("page", queryJs.toWPage(pager));
result.ok(map);
result.okMsg("查询成功!");
}catch(Exception e){
e.printStackTrace();
LOG.error("查询失败,原因:"+e.getMessage());
result.error(e);
}
return result;
}
示例14: permission
import jodd.util.StringUtil; //导入方法依赖的package包/类
@RequestMapping("permission.html")
@ResponseBody
public Object permission(int roleId, String resourceIds)
{
Map<String, Object> map = new HashMap<String, Object>();
try
{
List<Integer> list = new ArrayList<Integer>();
if(StringUtil.isNotBlank(resourceIds))
{
for (String id : resourceIds.split(",")) {
list.add(Integer.valueOf(id));
}
}
boolean result = roleService.addRolePermBatch(roleId, list);
if(result)
{
map.put("success", Boolean.TRUE);
map.put("data", null);
map.put("message", "授权成功");
}else
{
map.put("success", Boolean.FALSE);
map.put("data", null);
map.put("message", "授权失败");
}
}catch(Exception e)
{
throw new AjaxException(e);
}
return map;
}
示例15: isAccessAllowed
import jodd.util.StringUtil; //导入方法依赖的package包/类
@Override
protected boolean isAccessAllowed(ServletRequest request,
ServletResponse response, Object mappedValue) throws Exception {
HttpServletRequest httpRequest = (HttpServletRequest)request;
String uri = httpRequest.getRequestURI();
String contextPath = httpRequest.getContextPath();
if(null != contextPath)
{
uri = uri.replace(contextPath, "");
if(uri.startsWith("/openapi/") || uri.equals("/") || uri.equals("/index.html") || uri.equals("login.html") || uri.equals("signin.html"))
{
return Boolean.TRUE;
}
}
String uriParam = httpRequest.getParameter("baseUri");
if(uriParam != null)
{
uriParam = uriParam.replace(contextPath, "");
if(uriParam.equals("/") || uriParam.equals("/index.html"))
return Boolean.TRUE;
}
String gridPager = httpRequest.getParameter("gridPager");
//导出时不做过滤
if(StringUtil.isNotBlank(gridPager))
{
Pager pager = JSON.parseObject(gridPager, Pager.class);
if(pager.getIsExport())
{
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}