com.alibaba.druid.util.StringUtils Java Examples

The following examples show how to use com.alibaba.druid.util.StringUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PmsRolePermissionServiceImpl.java    From roncoo-pay with Apache License 2.0 6 votes vote down vote up
/**
 * 保存角色和权限之间的关联关系
 */
@Transactional(rollbackFor = Exception.class)
public void saveRolePermission(Long roleId, String rolePermissionStr){
	// 删除原来的角色与权限关联
	pmsRolePermissionDao.deleteByRoleId(roleId);
	if (!StringUtils.isEmpty(rolePermissionStr)) {
		// 创建新的关联
		String[] permissionIds = rolePermissionStr.split(",");
		for (int i = 0; i < permissionIds.length; i++) {
			Long permissionId = Long.valueOf(permissionIds[i]);
			PmsRolePermission item = new PmsRolePermission();
			item.setPermissionId(permissionId);
			item.setRoleId(roleId);
			pmsRolePermissionDao.insert(item);
		}
	}
}
 
Example #2
Source File: DxpReceMsgSqlProvide.java    From maintain with MIT License 6 votes vote down vote up
public String getDxpReceMsgByMsgGuidSql(final String msgGuid) {
	return new SQL() {{
		this.SELECT("msg_guid");
		this.SELECT("encoding");
		this.SELECT("msg_size");
		this.SELECT("msg_blob");
		this.SELECT("biz_blob");
		this.SELECT("note");
		this.SELECT("sys_days");
		this.SELECT("sys_date");
		this.FROM("dxp_rece_msg");
		
		if (!StringUtils.isEmpty(msgGuid)) {
			OracleTool.where(this, "msg_guid", msgGuid);
		} else {
			this.WHERE("1 = 2");
		}
	}}.toString();
}
 
Example #3
Source File: FinanceConsumer.java    From ZTuoExchange_framework with MIT License 6 votes vote down vote up
/**
 * 异步打钱后返回状态
 * @param record
 */
@KafkaListener(topics = {"withdraw-notify"})
public void withdrawNotify(ConsumerRecord<String, String> record){
    logger.info("topic={},accessKey={},value={}", record.topic(), record.key(), record.value());
    if (StringUtils.isEmpty(record.value())) {
        return;
    }
    JSONObject json = JSON.parseObject(record.value());
    Long withdrawId = json.getLong("withdrawId");
    WithdrawRecord withdrawRecord=withdrawRecordService.findOne(withdrawId);
    if(withdrawRecord==null){
        return;
    }
    String txid=json.getString("txid");
    int status=json.getInteger("status");
    //转账失败,状态变回等待放币
    if(status==0){
        withdrawRecord.setStatus(WithdrawStatus.WAITING);
        withdrawRecordService.save(withdrawRecord);
    }else if(status==1){
        withdrawRecordService.withdrawSuccess(withdrawId, txid);
    }
}
 
Example #4
Source File: FinanceConsumer.java    From ZTuoExchange_framework with MIT License 6 votes vote down vote up
/**
 * 处理充值消息,key值为币种的名称(注意是全称,如Bitcoin)
 *
 * @param record
 */
@KafkaListener(topics = {"deposit"})
public void handleDeposit(ConsumerRecord<String, String> record) {
    logger.info("topic={},key={},value={}", record.topic(), record.key(), record.value());
    if (StringUtils.isEmpty(record.value())) {
        return;
    }
    JSONObject json = JSON.parseObject(record.value());
    if (json == null) {
        return;
    }
    BigDecimal amount = json.getBigDecimal("amount");
    String txid = json.getString("txid");
    String address = json.getString("address");
    Coin coin = coinService.findOne(record.key());
    logger.info("coin={}", coin);

    if (coin != null && walletService.findDeposit(address, txid) == null) {
        MessageResult mr = walletService.recharge(coin, address, amount, txid);
        logger.info("wallet recharge result:{}", mr);
    }
}
 
Example #5
Source File: FinanceConsumer.java    From ZTuoExchange_framework with MIT License 6 votes vote down vote up
/**
 * 处理充值消息,key值为币种的名称(注意是全称,如Bitcoin)
 *
 * @param record
 */
@KafkaListener(topics = {"deposit"})
public void handleDeposit(ConsumerRecord<String, String> record) {
    logger.info("topic={},key={},value={}", record.topic(), record.key(), record.value());
    if (StringUtils.isEmpty(record.value())) {
        return;
    }
    JSONObject json = JSON.parseObject(record.value());
    if (json == null) {
        return;
    }
    BigDecimal amount = json.getBigDecimal("amount");
    String txid = json.getString("txid");
    String address = json.getString("address");
    Coin coin = coinService.findOne(record.key());
    logger.info("coin={}", coin);

    if (coin != null && walletService.findDeposit(address, txid) == null) {
        MessageResult mr = walletService.recharge(coin, address, amount, txid);
        logger.info("wallet recharge result:{}", mr);
    }
}
 
Example #6
Source File: DistHeadSqlProvide.java    From maintain with MIT License 6 votes vote down vote up
public String getDistHeadByInvtNoSql(final String invtNo) {
	return new SQL() {{
		this.SELECT("pdh.seq_no");
		this.SELECT("pdh.dist_no");
		this.SELECT("pdh.customs_code");
		this.SELECT("pdh.decl_code");
		this.SELECT("pdh.decl_name");
		this.SELECT("pdh.dist_stat");
		this.SELECT("pdh.input_date");
		this.SELECT("pdh.decl_date");
		this.SELECT("pdh.return_reason");
		this.SELECT("pdh.note");
		this.FROM("pre_dist_head pdh");
		this.INNER_JOIN("pre_dist_bill_list pdbl on pdh.seq_no = pdbl.seq_no");
		
		if(!StringUtils.isEmpty(invtNo)) {
			this.WHERE("pdbl.bill_no = '" + invtNo + "'");
		} else {
			this.WHERE("1 = 2");
		}
	}}.toString();
}
 
Example #7
Source File: DtsRoleService.java    From dts-shop with GNU Lesser General Public License v3.0 6 votes vote down vote up
public List<DtsRole> querySelective(String roleName, Integer page, Integer size, String sort, String order) {
	DtsRoleExample example = new DtsRoleExample();
	DtsRoleExample.Criteria criteria = example.createCriteria();

	if (!StringUtils.isEmpty(roleName)) {
		criteria.andNameEqualTo("%" + roleName + "%");
	}
	criteria.andDeletedEqualTo(false);

	if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
		example.setOrderByClause(sort + " " + order);
	}

	PageHelper.startPage(page, size);
	return roleMapper.selectByExample(example);
}
 
Example #8
Source File: DtsCouponService.java    From dts-shop with GNU Lesser General Public License v3.0 6 votes vote down vote up
public List<DtsCoupon> querySelective(String name, Short type, Short status, Integer page, Integer limit,
		String sort, String order) {
	DtsCouponExample example = new DtsCouponExample();
	DtsCouponExample.Criteria criteria = example.createCriteria();

	if (!StringUtils.isEmpty(name)) {
		criteria.andNameLike("%" + name + "%");
	}
	if (type != null) {
		criteria.andTypeEqualTo(type);
	}
	if (status != null) {
		criteria.andStatusEqualTo(status);
	}
	criteria.andDeletedEqualTo(false);

	if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
		example.setOrderByClause(sort + " " + order);
	}

	PageHelper.startPage(page, limit);
	return couponMapper.selectByExample(example);
}
 
Example #9
Source File: LitemallRoleServiceImpl.java    From BigDataPlatform with GNU General Public License v3.0 6 votes vote down vote up
public List<LitemallRole> querySelective(String name, Integer page, Integer limit, String sort, String order) {
    LitemallRoleExample example = new LitemallRoleExample();
    LitemallRoleExample.Criteria criteria = example.createCriteria();

    if (!StringUtils.isEmpty(name)) {
        criteria.andNameLike("%" + name + "%");
    }
    criteria.andDeletedEqualTo(false);

    if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
        example.setOrderByClause(sort + " " + order);
    }

    PageHelper.startPage(page, limit);
    return roleMapper.selectByExample(example);
}
 
Example #10
Source File: LitemallCouponService.java    From mall with MIT License 6 votes vote down vote up
public List<LitemallCoupon> querySelective(String name, Short type, Short status, Integer page, Integer limit, String sort, String order) {
    LitemallCouponExample example = new LitemallCouponExample();
    LitemallCouponExample.Criteria criteria = example.createCriteria();

    if (!StringUtils.isEmpty(name)) {
        criteria.andNameLike("%" + name + "%");
    }
    if (type != null) {
        criteria.andTypeEqualTo(type);
    }
    if (status != null) {
        criteria.andStatusEqualTo(status);
    }
    criteria.andDeletedEqualTo(false);

    if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
        example.setOrderByClause(sort + " " + order);
    }

    PageHelper.startPage(page, limit);
    return couponMapper.selectByExample(example);
}
 
Example #11
Source File: LitemallCouponService.java    From litemall with MIT License 6 votes vote down vote up
public List<LitemallCoupon> querySelective(String name, Short type, Short status, Integer page, Integer limit, String sort, String order) {
    LitemallCouponExample example = new LitemallCouponExample();
    LitemallCouponExample.Criteria criteria = example.createCriteria();

    if (!StringUtils.isEmpty(name)) {
        criteria.andNameLike("%" + name + "%");
    }
    if (type != null) {
        criteria.andTypeEqualTo(type);
    }
    if (status != null) {
        criteria.andStatusEqualTo(status);
    }
    criteria.andDeletedEqualTo(false);

    if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
        example.setOrderByClause(sort + " " + order);
    }

    PageHelper.startPage(page, limit);
    return couponMapper.selectByExample(example);
}
 
Example #12
Source File: LitemallRoleService.java    From litemall with MIT License 6 votes vote down vote up
public List<LitemallRole> querySelective(String name, Integer page, Integer limit, String sort, String order) {
    LitemallRoleExample example = new LitemallRoleExample();
    LitemallRoleExample.Criteria criteria = example.createCriteria();

    if (!StringUtils.isEmpty(name)) {
        criteria.andNameLike("%" + name + "%");
    }
    criteria.andDeletedEqualTo(false);

    if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
        example.setOrderByClause(sort + " " + order);
    }

    PageHelper.startPage(page, limit);
    return roleMapper.selectByExample(example);
}
 
Example #13
Source File: UserUserSqlProvide.java    From maintain with MIT License 6 votes vote down vote up
public String getUsersSql(final UserUser user) {
	return new SQL() {{
		this.SELECT("user_id, login_name, user_name");
		this.FROM("user_user");
		this.WHERE("1 = 1");
		if (!StringUtils.isEmpty(user.getUserId())) {
			this.WHERE("user_id = '" + user.getUserId() + "'");
		}
		
		if (!StringUtils.isEmpty(user.getLoginName())) {
			this.WHERE("login_name like '%" + user.getLoginName() + "%'");
		}
		
		if (!StringUtils.isEmpty(user.getUserName())) {
			this.WHERE("user_name = '" + user.getUserName() + "'");
		}
		
		this.ORDER_BY("oper_time");
	}}.toString();
}
 
Example #14
Source File: LitemallCouponServiceImpl.java    From BigDataPlatform with GNU General Public License v3.0 6 votes vote down vote up
public List<LitemallCoupon> querySelective(String name, Short type, Short status, Integer page, Integer limit, String sort, String order) {
    LitemallCouponExample example = new LitemallCouponExample();
    LitemallCouponExample.Criteria criteria = example.createCriteria();

    if (!StringUtils.isEmpty(name)) {
        criteria.andNameLike("%" + name + "%");
    }
    if (type != null) {
        criteria.andTypeEqualTo(type);
    }
    if (status != null) {
        criteria.andStatusEqualTo(status);
    }
    criteria.andDeletedEqualTo(false);

    if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
        example.setOrderByClause(sort + " " + order);
    }

    PageHelper.startPage(page, limit);
    return couponMapper.selectByExample(example);
}
 
Example #15
Source File: PmsMenuRoleServiceImpl.java    From roncoo-pay with Apache License 2.0 6 votes vote down vote up
@Transactional(rollbackFor = Exception.class)
public void saveRoleMenu(Long roleId, String roleMenuStr){
	// 删除原来的角色与权限关联
	pmsMenuRoleDao.deleteByRoleId(roleId);
	if (!StringUtils.isEmpty(roleMenuStr)) {
		// 创建新的关联
		String[] menuIds = roleMenuStr.split(",");
		for (int i = 0; i < menuIds.length; i++) {
			Long menuId = Long.valueOf(menuIds[i]);
			PmsMenuRole item = new PmsMenuRole();
			item.setMenuId(menuId);
			item.setRoleId(roleId);
			pmsMenuRoleDao.insert(item);
		}
	}
}
 
Example #16
Source File: Tools.java    From jshERP with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 获取访问者IP
 *
 * 在一般情况下使用Request.getRemoteAddr()即可,但是经过nginx等反向代理软件后,这个方法会失效。
 *
 * 本方法先从Header中获取X-Real-IP,如果不存在再从X-Forwarded-For获得第一个IP(用,分割),
 * 如果还不存在则调用Request .getRemoteAddr()。
 *
 * @param request
 * @return
 */
public static String getIpAddr(HttpServletRequest request) {
    String ip = request.getHeader("X-Real-IP");
    if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip)) {
        return ip;
    }
    ip = request.getHeader("X-Forwarded-For");
    if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip)) {
        // 多次反向代理后会有多个IP值,第一个为真实IP。
        int index = ip.indexOf(',');
        if (index != -1) {
            return ip.substring(0, index);
        } else {
            return ip;
        }
    } else {
        return request.getRemoteAddr();
    }
}
 
Example #17
Source File: PersonsController.java    From maintain with MIT License 6 votes vote down vote up
@RequestMapping("/statistics")
public ModelAndView statistics(PersonalInfo personalInfo) {
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    if (null == personalInfo) {
    	personalInfo = new PersonalInfo();
	}

	if (StringUtils.isEmpty(personalInfo.getGroupOne())) {
		personalInfo.setGroupOne("to_char(pil1.sys_date, 'yyyy-mm-dd')");
		personalInfo.setSysDateStr(sdf.format(Calendar.getInstance().getTime()));
	}
	final Map<String, String> groupField = new LinkedHashMap<String, String>(){{
		this.put("to_char(pil1.sys_date, 'yyyy-mm-dd hh')", "按小时");
		this.put("to_char(pil1.sys_date, 'yyyy-mm-dd')", "按天");
		this.put("to_char(pil1.sys_date, 'yyyy-mm')", "按月");
		this.put("to_char(pil1.sys_date, 'yyyy')", "按年");
	}};
	PageInfo<PersonalInfo> pageInfo = this.getPageInfo(personalInfo, PersonalInfo.class, this.personalInfoService, "statisticsPersonalInfo");
	ModelAndView mv = this.buildBaseModelAndView("persons/statistics", pageInfo);
	mv.addObject("personalInfo", personalInfo);
	mv.addObject("personalInfoList", pageInfo.getList());
	mv.addObject("groupField", groupField);
	return mv;
}
 
Example #18
Source File: GoodsController.java    From maintain with MIT License 6 votes vote down vote up
@RequestMapping
public ModelAndView index(Good good) {
	AuthUser currUser = BaseController.getCurrUser();
	
	if (!StringUtils.isEmpty(currUser.getMember().getCompanyCode())) {
		if (null == good) {
			good = new Good();
		}
		good.setApplyCode(currUser.getMember().getCompanyCode());
	}
	
	PageInfo<Good> pageInfo = this.getPageInfo(good, Good.class, this.goodService, "getGoodList");
	ModelAndView mv = this.buildBaseModelAndView("goods/list", pageInfo);
	mv.addObject("good", good);
	mv.addObject("goodList", pageInfo.getList());
	mv.addObject("status", GoodConstant.getSTATUS());
	mv.addObject("country", ParaTool.getAllCountries(countryService));
	mv.addObject("unit", ParaTool.getAllUnits(unitService));
	return mv;
}
 
Example #19
Source File: ImpInvtHeadSqlProvide.java    From maintain with MIT License 6 votes vote down vote up
public String getInvtHeadListByInvtNoSql(final String invtNo) {
	return new SQL() {{
		this.SELECT("guid");
		this.SELECT("pre_no");
		this.SELECT("invt_no");
		this.SELECT("detailscode");
		this.SELECT("applycode");
		this.SELECT("audit_state");
		this.SELECT("bw_name");
		this.SELECT("apply_date");
		this.SELECT("payecode");
		this.SELECT("payename");
		this.FROM("imp_invt_head");
		
		if (!StringUtils.isEmpty(invtNo)) {
			this.WHERE("invt_no = '" + invtNo + "'");
		} else {
			this.WHERE("1 = 2");
		}
	}}.toString();
}
 
Example #20
Source File: ImpInvtHeadSqlProvide.java    From maintain with MIT License 6 votes vote down vote up
public String getInvtHeadListByCopNoSql(final String copNo) {
	return new SQL() {{
		this.SELECT("guid");
		this.SELECT("pre_no");
		this.SELECT("invt_no");
		this.SELECT("detailscode");
		this.SELECT("applycode");
		this.SELECT("audit_state");
		this.SELECT("bw_name");
		this.SELECT("apply_date");
		this.SELECT("payecode");
		this.SELECT("payename");
		this.FROM("imp_invt_head");
		
		if (!StringUtils.isEmpty(copNo)) {
			this.WHERE("cop_no = '" + copNo + "'");
		} else {
			this.WHERE("1 = 2");
		}
	}}.toString();
}
 
Example #21
Source File: MemberServiceImpl.java    From product-recommendation-system with MIT License 6 votes vote down vote up
@Override
public Member loginMember(String loginName, String password) {
	if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
		return null;
	}
	Member member = new Member();
	member.setLoginName(loginName);
	
	// 调用mapper去查询符合条件的用户列表
	List<Member> userList = this.memberMapper.listMember(member);
	if (userList.isEmpty()) {
		return null;
	}
	
	// 用户列表不为空则验证密码是否正确,正确则返回该用户
	Member plainUser = userList.get(0);
	String encryptedPassword = plainUser.getPassword();
	if (validatePsd(password, encryptedPassword)) {
		return plainUser;
	}
	
	return null;
}
 
Example #22
Source File: RegistMemberController.java    From product-recommendation-system with MIT License 6 votes vote down vote up
/**
 * 检查用户名是否存在
 * @param userName
 * @return
 */
@RequestMapping("/checkUser/{loginName}")
public @ResponseBody Map<String, String> checkUserName(@PathVariable(value="loginName") String loginName) {
	Map<String, String> messageMap = new HashMap<String, String>();
	messageMap.put("isExists", "false");
	
	if (StringUtils.isEmpty(loginName)) {
		// 用户名不存在,返回
		return messageMap;
	}
	// 1.创建member对象
	Member member = new Member();
	member.setLoginName(loginName);
	
	// 2.验证某个用户名是否存在
	List<Member> memeberList = memberService.listMember(member);
	if (memeberList.size() > 0) {
		messageMap.put("isExists", "true");
	}
	
	return messageMap;
}
 
Example #23
Source File: InvtHeadSqlProvide.java    From maintain with MIT License 6 votes vote down vote up
public String updateInvtStatusAndInvtNoSql(final InvtHead invtHead) {
	return new SQL(){{
		this.UPDATE("ceb2_invt_head");
		OracleTool.set(this, "app_status", invtHead.getAppStatus());
		if (!StringUtils.isEmpty(invtHead.getInvtNo())) {
			OracleTool.set(this, "invt_no", invtHead.getInvtNo());
		}
		if (StringUtils.isEmpty(invtHead.getOrderNo()) && StringUtils.isEmpty(invtHead.getCopNo())
				&& StringUtils.isEmpty(invtHead.getHeadGuid())) {
			this.WHERE("1 = 2");
		} else {
			OracleTool.where(this, "order_no", invtHead.getOrderNo());
			OracleTool.where(this, "cop_no", invtHead.getCopNo());
			OracleTool.where(this, "head_guid", invtHead.getHeadGuid());
		}
	}}.toString();
}
 
Example #24
Source File: VeHeadSqlProvide.java    From maintain with MIT License 6 votes vote down vote up
public String getVeHeadByVeNoSql(final String veNo) {
return new SQL() {{
	this.SELECT("ve_id");
	this.SELECT("ve_no");
	this.SELECT("ve_owner");
	this.SELECT("ve_run_num");
	this.SELECT("link_tel");
	this.SELECT("ve_cop_id");
	this.SELECT("ve_cop_name");
	this.SELECT("ic_card_id");
	this.SELECT("ve_e_no");
	this.SELECT("customs_code");
	this.SELECT("ve_wt");
	this.SELECT("input_date");
	this.FROM("pre_ve_head");
	
	if (!StringUtils.isEmpty(veNo)) {
		this.WHERE("ve_no = '" + veNo + "'");
	} else {
		this.WHERE("1 = 2");
	}
}}.toString();
}
 
Example #25
Source File: PaymentMessageSqlProvide.java    From maintain with MIT License 5 votes vote down vote up
public String getPaymentMessageListSql(final PaymentMessage paymentMessage) {
	return new SQL() {{
		this.SELECT("id");
		this.SELECT("xml_content");
		this.SELECT("created_date");
		this.SELECT("date_num");
		this.FROM("tb_recv_message");
		
		if (null != paymentMessage.getId()) {
			this.WHERE("id = " + paymentMessage.getId());
		}
		
		if (!StringUtils.isEmpty(paymentMessage.getXmlContent())) {
			this.WHERE("xml_content like '%" + paymentMessage.getXmlContent() + "%'");
		}
		
		if (!StringUtils.isEmpty(paymentMessage.getBeginCreateDate())) {
			this.WHERE("to_char(created_date, 'yyyymmddhh24miss') >= '" + paymentMessage.getBeginCreateDate() + "'");
		}
		
		if (null != paymentMessage.getDateNum()) {
			this.WHERE("date_num = " + paymentMessage.getDateNum());
		}
		
		if (null != paymentMessage.getBeginDateNum()) {
			this.WHERE("date_num >= " + paymentMessage.getBeginDateNum());
		}
		
		if (!StringUtils.isEmpty(paymentMessage.getOrderBy())) {
			this.ORDER_BY(paymentMessage.getOrderBy());
		}
	}}.toString();
}
 
Example #26
Source File: ParaTool.java    From maintain with MIT License 5 votes vote down vote up
public static String getWrapDesc(String wrapCode, WrapService wrapService) {
	String result = "";
	Para para = null;
	if (StringUtils.isEmpty(CommonConstant.getWRAP_TYPE_MAP().get(wrapCode))) {
		para = wrapService.getWrapByCode(wrapCode);
		if (null != para) {
			CommonConstant.getWRAP_TYPE_MAP().put(wrapCode, para.getName());
			result = para.getName();
		}
	} else {
		result = CommonConstant.getWRAP_TYPE_MAP().get(wrapCode);
	}
	return result;
}
 
Example #27
Source File: TransfSqlProvide.java    From maintain with MIT License 5 votes vote down vote up
public String getTransfByCodeSql(final String transfCode) {
	return new SQL() {{
		this.SELECT("traf_code");
		this.SELECT("traf_spec");
		this.FROM("transf");
		
		if (!StringUtils.isEmpty(transfCode)) {
			this.WHERE("traf_code = '" + transfCode + "'");
		} else {
			this.WHERE("1 = 2");
		}
	}}.toString();
}
 
Example #28
Source File: StringUtil.java    From jshERP with GNU General Public License v3.0 5 votes vote down vote up
/**
 * String字符串转成List<String>数据格式
 * String str = "1,2,3,4,5,6" -> List<Long> listLong [1,2,3,4,5,6];
 *
 * @param strArr
 * @return
 */
public static List<String> strToStringList(String strArr) {
    if(StringUtils.isEmpty(strArr)){
        return null;
    }
    List<String> idList=new ArrayList<String>();
    String[] d=strArr.split(",");
    for (int i = 0, size = d.length; i < size; i++) {
        if(d[i]!=null) {
            idList.add(d[i].toString());
        }
    }
    return idList;
}
 
Example #29
Source File: HttpClientTool.java    From maintain with MIT License 5 votes vote down vote up
public static List<NetInterfaceInfo> getNetInterfaceInfoListJson(String url) {
	Gson gson = new Gson();
	String result = get(url + "netInterfaceInfo");
	if (!StringUtils.isEmpty(result)) {
		return Arrays.asList(gson.fromJson(result, NetInterfaceInfo[].class));
	} else {
		return null;
	}
}
 
Example #30
Source File: CurrSqlProvide.java    From maintain with MIT License 5 votes vote down vote up
public String getCurrByCodeSql(final String code) {
	return new SQL() {{
		this.SELECT("curr_code");
		this.SELECT("curr_name");
		this.FROM("curr");
		
		if (!StringUtils.isEmpty(code)) {
			this.WHERE("curr_code = '" + code + "'");
		} else {
			this.WHERE("1 = 2");
		}
	}}.toString();
}