public class Utility extends Object
| Constructor and Description |
|---|
Utility() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addDate(String date1,
String addpart,
int num)
给指定日期加上一个数值
|
static String |
addTime(String time1,
String addpart,
int num)
给指定时间加上一个数值
|
static String |
capitalize(String name) |
static boolean |
consume(String userId,
double point,
String remark)
对指定的用户进行扣除雷点
|
static com.xunlei.thundercore.client.response.ConsumeResponse |
consume(String userId,
String remark,
double point)
充值并获得返回处理对象,如果异常的话返回null。成功的话返回对象的返回码为00才算是成功
|
static boolean |
consume(String applyId,
String userShow,
double point,
String remark)
对指定的用户进行扣除雷点
|
static com.xunlei.thundercore.client.response.ConsumeResponse |
consume(String applyId,
String userShow,
String remark,
double point)
充值并获得返回处理对象,如果异常的话返回null。成功的话返回对象的返回码为00才算是成功
|
static com.xunlei.thundercore.client.response.ConsumeResponse |
consumeWithIp(String applyId,
String userShow,
String remark,
double point,
String realClientIp,
String isAutoPay)
消费并获得返回处理对象,如果异常的话返回null。成功的话返回对象的返回码为00才算是成功
add by chiukong@20130502,新增ip和是否自动续费消费
|
static String |
ConvertCN2(String is)
中文编码转换
|
static void |
copyProperties(Object dest,
Object src)
拷贝属性 主要是为了封装 org.apache.commons.beanutils.BeanUtils.copyProperties 的异常
|
static String |
createExt99billOrderId() |
static String |
createOrderId() |
static int |
createRandomNum(int max)
产生随机数 参数为最大范围
|
static String |
createSameChar(String src,
int len)
返回一样字符的串
|
static String |
createSerial(String src,
int len)
生成固定长度的序列号,不足位数在前补0
|
static String |
FomatDate(String src)
格式化空中网电信退订文档的日期、时间 2009-10-9 2:20:26 ,补零 为 2009-10-09 02:20:26
|
static String |
FomatTime(String src) |
static String |
formatAmt(double amt) |
static String |
generateApplyId() |
static double |
get99BillFareamt(double orderAmt) |
static double |
getAlipayFareamt(double payedamt) |
static com.xunlei.thundercore.client.proxy.ClientProxy |
getClientProxy() |
static String |
getFilterSrc(String str) |
static String |
getFixedLengthString(String src,
String c,
int len)
取固定长度字符串, 不足补
|
static String |
getFormatedOrderTime(String slimtime) |
static String |
getLeftFixedLengthString(String src,
String c,
int len)
取固定长度字符串, 不足左补
|
static DecimalFormat |
getNumberFormat() |
static String |
getTimeByTradeSn(long sn) |
static String |
getTradeSn()
得到系统的时间戳
|
static String |
getUUID() |
static String |
getXunleiIdHash(String xunleiid,
int flag)
对迅雷ID进行计算,范围00-99 flag = 0 : 根据1-2位计算库 flag = 1 : 根据3-4位计算表
|
static double |
getYeepayFareamt(double orderAmt) |
static com.xunlei.thundercore.client.response.ConsumeResponse |
insureconsume(String orderid,
String userShow,
String remark,
double point)
对指定的用户进行扣除雷点,查询保证此applyid之前没有进行过消费
|
static com.xunlei.thundercore.client.response.ConsumeResponse |
insureconsume(String orderid,
String userShow,
String remark,
double point,
String host,
int port,
String bizNo,
String key) |
static Areaidinfo |
isAreaidVerify(String libclassm,
String areaid)
判断区域编号是否在参数数组中
|
static boolean |
isContainsString(String str,
String[] array)
判断某个字符串是否包含在某个数组中。如果数组为null则返回false
|
static boolean |
isEmpty(String str) |
static boolean |
isNumberVerify(String libconfig,
String premobile)
判断手机段是否范围内
|
static boolean |
isTestUsername(String libconfig,
String username) |
static void |
main(String[] args) |
static String |
moveChar(String pwd,
int s,
int e)
将字符串中第s个字符和第e个字符对换
|
static String |
otherdateofnow()
返回当前日期
|
static com.xunlei.thundercore.client.response.QryuserinfResponse |
qryuserinf(String userShow)
查询用户雷点信息
|
static String |
queryCopartnerBizKey(String bizNo) |
static boolean |
recharge(String applyId,
String userShow,
double point,
String remark)
对指定的用户进行扣除雷点
|
static boolean |
sendHtmlMail(Map<String,String> params) |
static String |
timeofnow() |
static String |
toStringCommon(Object obj) |
static void |
writefilefromhttpreturn(String urlName,
String filepath) |
public static String FomatDate(String src)
public static String getLeftFixedLengthString(String src, String c, int len)
public static void copyProperties(Object dest, Object src)
public static int createRandomNum(int max)
public static String otherdateofnow()
public static String timeofnow()
public static String addTime(String time1, String addpart, int num)
time1 - 要加上一数值的时间,为null即为当前时间,格式为yyyy-MM-dd HH:mm:ssaddpart - 要加的部分:年月日时分秒分别为:YMDHFSnum - 要加的数值public static String addDate(String date1, String addpart, int num)
date1 - 要加上一数值的日期,为null即为当前日期,格式为yyyy-MM-ddaddpart - 要加的部分:年月日分别为:YMDnum - 要加的数值public static String getTradeSn()
public static String getTimeByTradeSn(long sn)
public static String getUUID()
public static String getFixedLengthString(String src, String c, int len)
public static String getXunleiIdHash(String xunleiid, int flag) throws Exception
Exceptionpublic static boolean isEmpty(String str)
public static DecimalFormat getNumberFormat()
public static String generateApplyId()
public static com.xunlei.thundercore.client.response.QryuserinfResponse qryuserinf(String userShow)
userShow - public static boolean consume(String userId, double point, String remark)
userId - point - remark - public static boolean consume(String applyId, String userShow, double point, String remark)
applyId - userShow - point - remark - public static com.xunlei.thundercore.client.response.ConsumeResponse insureconsume(String orderid, String userShow, String remark, double point)
orderId - userid - point - remark - public static com.xunlei.thundercore.client.response.ConsumeResponse insureconsume(String orderid, String userShow, String remark, double point, String host, int port, String bizNo, String key)
public static com.xunlei.thundercore.client.response.ConsumeResponse consume(String userId, String remark, double point)
userId - remark - point - public static com.xunlei.thundercore.client.response.ConsumeResponse consume(String applyId, String userShow, String remark, double point)
applyId - userShow - remark - point - public static com.xunlei.thundercore.client.response.ConsumeResponse consumeWithIp(String applyId, String userShow, String remark, double point, String realClientIp, String isAutoPay)
applyId - userShow - remark - point - realClientIp - 客户端IPpublic static boolean recharge(String applyId, String userShow, double point, String remark)
applyId - userShow - point - remark - public static com.xunlei.thundercore.client.proxy.ClientProxy getClientProxy()
public static String formatAmt(double amt)
public static boolean isContainsString(String str, String[] array)
str - array - public static Areaidinfo isAreaidVerify(String libclassm, String areaid)
public static String createExt99billOrderId() throws Exception
Exceptionpublic static double getAlipayFareamt(double payedamt)
public static double get99BillFareamt(double orderAmt)
public static double getYeepayFareamt(double orderAmt)
public static void main(String[] args)
Copyright © 2016. All rights reserved.