8a2a7af6fc30cbfa901716b6f863e96b5d8db9df.svn-base 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package com.chinacreator.videoalliance.order.util;
  2. import com.chinacreator.common.support.util.SpringContextUtil;
  3. import com.chinacreator.common.util.URLUtil;
  4. import com.chinacreator.videoalliance.common.dao.DictionaryDao;
  5. public class CapUtil {
  6. /*
  7. String usermob = orderInfo.getUsermob(); //手机号码
  8. String vacid = orderInfo.getVacid(); //产品ID
  9. String spcode = orderInfo.getSpcode(); //P代码
  10. String ordertype = orderInfo.getOrdertype(); //操作类型,0订购,1退订
  11. String servicetype = orderInfo.getServicetype(); //服务编码
  12. String sequence = orderInfo.getSequence(); //统一认证序列
  13. String fee = orderInfo.getFee(); //资费
  14. String token = orderInfo.getToken();
  15. String accesstype = orderInfo.getAccesstype(); sp/cp的二次认证方式: 1:H5认证 2:SDK认证 3:短信认证 4:页面认证
  16. */
  17. /**
  18. * 调cap接口
  19. * @param cpid
  20. * @param spid
  21. * @param userId
  22. * @param spCode
  23. * @param productId
  24. * @param type
  25. * @param sequence
  26. * @param accesstype
  27. * @param fee
  28. * @param token
  29. * @return
  30. * @throws Exception
  31. */
  32. public static String cap(String cpid, String spid, String userId,String spCode, String productId,String type, String sequence, String accesstype, String fee, String token) throws Exception{
  33. DictionaryDao dictionaryDao = SpringContextUtil.getBean(DictionaryDao.class);
  34. String capUrl = dictionaryDao.getValue("capUrl");
  35. if(capUrl.indexOf("?") == -1) {
  36. capUrl += "?";
  37. } else {
  38. capUrl += "&";
  39. }
  40. capUrl += "usermob=" + userId;
  41. capUrl += "&vacid=" + productId;
  42. capUrl += "&spcode=" + spCode;
  43. capUrl += "&ordertype=" + type;
  44. capUrl += "&servicetype=80";;
  45. capUrl += "&sequence=" + sequence;
  46. capUrl += "&fee=" + fee;
  47. capUrl += "&token=" + token;
  48. capUrl += "&accesstype=" + accesstype;
  49. capUrl += "&cpid=" + cpid;
  50. capUrl += "&spid=" + spid;
  51. String resultStr = URLUtil.get(capUrl);
  52. return resultStr;
  53. }
  54. /**
  55. * 调cap接口
  56. * @param cpid
  57. * @param spid
  58. * @param userId
  59. * @param spCode
  60. * @param productId
  61. * @param type
  62. * @param sequence
  63. * @param accesstype
  64. * @param fee
  65. * @param token
  66. * @return
  67. * @throws Exception
  68. */
  69. public static String capSync(String cpid, String spid, String userId,String spCode, String productId,String type, String sequence, String accesstype, String fee, String token) throws Exception{
  70. DictionaryDao dictionaryDao = SpringContextUtil.getBean(DictionaryDao.class);
  71. String capUrl = dictionaryDao.getValue("capSyncUrl");
  72. if(capUrl.indexOf("?") == -1) {
  73. capUrl += "?";
  74. } else {
  75. capUrl += "&";
  76. }
  77. capUrl += "usermob=" + userId;
  78. capUrl += "&vacid=" + productId;
  79. capUrl += "&spcode=" + spCode;
  80. capUrl += "&ordertype=" + type;
  81. capUrl += "&servicetype=80";
  82. capUrl += "&sequence=" + sequence;
  83. capUrl += "&fee=" + fee;
  84. capUrl += "&token=" + token;
  85. capUrl += "&accesstype=" + accesstype;
  86. capUrl += "&cpid=" + cpid;
  87. capUrl += "&spid=" + spid;
  88. String resultStr = URLUtil.get(capUrl);
  89. return resultStr;
  90. }
  91. public static String capQuery(String userId) throws Exception {
  92. DictionaryDao dictionaryDao = SpringContextUtil.getBean(DictionaryDao.class);
  93. String capUrl = dictionaryDao.getValue("capQueryUrl");
  94. capUrl += "?usermob=" + userId;
  95. String resultStr = URLUtil.get(capUrl);
  96. return resultStr;
  97. }
  98. public static String kbxkQuery(String userId) throws Exception {
  99. DictionaryDao dictionaryDao = SpringContextUtil.getBean(DictionaryDao.class);
  100. String capUrl = dictionaryDao.getValue("kbxkQueryUrl");
  101. capUrl += "?usermob=" + userId;
  102. String resultStr = URLUtil.get(capUrl);
  103. return resultStr;
  104. }
  105. /**
  106. * @param args
  107. */
  108. public static void main(String[] args) {
  109. }
  110. }