a751590c04d25090b92f10a06d75cf089357de18.svn-base 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package com.chinacreator.process.util;
  2. import com.chinacreator.common.support.util.SpringContextUtil;
  3. import com.chinacreator.common.util.URLUtil;
  4. import com.chinacreator.process.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. public static String capQuery(String userId) throws Exception {
  55. DictionaryDao dictionaryDao = SpringContextUtil.getBean(DictionaryDao.class);
  56. String capUrl = dictionaryDao.getValue("capQueryUrl");
  57. capUrl += "?usermob=" + userId;
  58. String resultStr = URLUtil.get(capUrl);
  59. return resultStr;
  60. }
  61. public static String kbxkQuery(String userId) throws Exception {
  62. DictionaryDao dictionaryDao = SpringContextUtil.getBean(DictionaryDao.class);
  63. String capUrl = dictionaryDao.getValue("kbxkQueryUrl");
  64. capUrl += "?usermob=" + userId;
  65. String resultStr = URLUtil.get(capUrl);
  66. return resultStr;
  67. }
  68. /**
  69. * @param args
  70. */
  71. public static void main(String[] args) {
  72. }
  73. }