Commit 449f62b8 by 伍思炜

智能平台对接更新

parent dd3d7c46
......@@ -623,14 +623,11 @@ public class IntelligenceSendOrders {
String sign = MD5Util.MD5Encode(order_dataJSON, "Utf-8");
// 获得小写md5串
sign = sign.toLowerCase();
System.out.println(sign);
// RSA加密
byte[] encodedData = RSAUtils.encryptByPublicKey(sign, publicKey);
sign = (new BASE64Encoder()).encodeBuffer(encodedData);
System.out.println("签名:" + sign);
//去除换行
sign = sign.replaceAll("\\r|\\n", "");
System.out.println("签名2 :" + sign);
log.info("宽带下单接口中的携带的签名:" + sign);
......
......@@ -290,17 +290,17 @@ public class OrderController extends BaseController {
map1.put("ysmUser", ysmUser.getUserName());
map1.put("sign", ysmUser.getSign());
map1.put("idCardUrl1", order.getIdCardz());
map1.put("idCardUrl2", order.getIdCardf());
map1.put("idCardUrl3", order.getIdCardzs());
map1.put("idCardUrl1", order.getIdCardz().replace("manager","app"));
map1.put("idCardUrl2", order.getIdCardf().replace("manager","app"));
map1.put("idCardUrl3", order.getIdCardzs().replace("manager","app"));
map1.put("cardType", order.getKapin());
if (order.getPackageId().equals("49")) {
map1.put("userName", order.getParentName());
map1.put("idCardUrl4", order.getIdCardzs());
map1.put("idCardUrl4", order.getIdCardzs().replace("manager","app"));
} else {
map1.put("userName", order.getCustomerName());
map1.put("idCardUrl4", order.getStudenCard());
map1.put("idCardUrl4", order.getStudenCard().replace("manager","app"));
}
map1.put("linkPhone", order.getContactNumber());
map1.put("idCard", order.getIdCard());
......@@ -1755,17 +1755,20 @@ public class OrderController extends BaseController {
map1.put("ysmUser", ysmById.get("user_name"));
map1.put("sign", ysmById.get("sign"));
map1.put("idCardUrl1", orderData.getIdCardz());
/*map1.put("idCardUrl1", orderData.getIdCardz());
map1.put("idCardUrl2", orderData.getIdCardf());
map1.put("idCardUrl3", orderData.getIdCardzs());
map1.put("idCardUrl3", orderData.getIdCardzs());*/
map1.put("idCardUrl1", orderData.getIdCardz().replace("manager","app"));
map1.put("idCardUrl2", orderData.getIdCardf().replace("manager","app"));
map1.put("idCardUrl3", orderData.getIdCardzs().replace("manager","app"));
map1.put("cardType", orderData.getKapin());
if ("49".equals(orderData.getPackageId())) {
map1.put("userName", orderData.getParentName());
map1.put("idCardUrl4", orderData.getIdCardzs());
map1.put("idCardUrl4", orderData.getIdCardzs().replace("manager","app"));
} else {
map1.put("userName", orderData.getCustomerName());
map1.put("idCardUrl4", orderData.getStudenCard());
map1.put("idCardUrl4", orderData.getStudenCard().replace("manager","app"));
}
map1.put("linkPhone", orderData.getContactNumber());
map1.put("idCard", orderData.getIdCard());
......@@ -2241,7 +2244,7 @@ public class OrderController extends BaseController {
return_data.put("微信appId", "");
map.put("return_data", return_data);
String cardAddress = orderCardAddressMapper.selectByOrderId(map.get("orderId"));
String cardAddress = orderCardAddressMapper.selectByOrderId(map.get("order_id"));
Map<String, Object> order_data = new HashMap<>();
......@@ -2272,7 +2275,8 @@ public class OrderController extends BaseController {
order_data.put("付费类型", "预付费"); //预付费、后付费、其他 选填
Map<String, Object> packageInformation = new HashMap<>(); //揽装信息
packageInformation.put("揽装工号", "44094951");
packageInformation.put("揽装姓名", map.get("lzUser"));
packageInformation.put("揽装工号", map.get("lzgh"));
order_data.put("揽装信息", packageInformation);
HashMap<String, Object> invoiceInformation = new HashMap<>(); //发票信息
......@@ -2284,14 +2288,12 @@ public class OrderController extends BaseController {
order_data.put("接口下单账号", "xiaoyuan"); //接口下单账号
HashMap<String, Object> orderingProducts = new HashMap<>(); //订购产品
orderingProducts.put("产品SKU", "");
//orderingProducts.put("产品SKU", "");
orderingProducts.put("产品名称", map.get("cardType"));
orderingProducts.put("受理内容", "");
//orderingProducts.put("受理内容", "");
orderingProducts.put("付费类型", "预付费");
// 属性列表
AttributeList roadbandRate = new AttributeList();
AttributeList userCategory = new AttributeList();
userCategory.setName("用户类别");
userCategory.setValue("学生");
......@@ -2304,11 +2306,17 @@ public class OrderController extends BaseController {
userType.setName("用户类型");
userType.setValue((String) map.get("cardType"));
AttributeList[] attributeList = new AttributeList[]{roadbandRate, userCategory, studentID, userType}; //属性列表
AttributeList[] attributeList = new AttributeList[]{userCategory, studentID, userType}; //属性列表
orderingProducts.put("属性列表", attributeList);
order_data.put("订购产品", orderingProducts);
Map<Object, Object> logisticsInformation = new HashMap<>(); //物流信息
logisticsInformation.put("受理类型","不受理");
logisticsInformation.put("发货类型","代理商自行发货");
order_data.put("业务类型", "预付费礼包业务"); //业务类型
order_data.put("业务类型", "移动业务"); //业务类型
//order_data.put("业务类型", "单宽业务"); //业务类型
//order_data.put("业务类型", "预付费礼包业务"); //业务类型
order_data.put("办理类型", "新装主卡"); //业务类型
List<Map<String, Object>> mobileAccessList = new ArrayList<>(); //移动接入
......@@ -2316,7 +2324,7 @@ public class OrderController extends BaseController {
mobileAccess.put("订购类型", "新装");
mobileAccess.put("UIM实物串号", map.get("iccId"));
mobileAccess.put("号码类型", "主卡");
mobileAccess.put("移动接入号", "");
mobileAccess.put("移动接入号", map.get("orderPhone"));
mobileAccessList.add(mobileAccess);
order_data.put("移动接入", mobileAccessList);
......@@ -2327,8 +2335,15 @@ public class OrderController extends BaseController {
realNameInformation.put("证件地址", cardAddress);
order_data.put("实名信息", realNameInformation);
Map<String, Object> logistics = new HashMap<>(); //物流信息
logistics.put("发货类型","代理商自行发货");
order_data.put("物流信息", logistics);
Map<String, Object> map1 = new HashMap<>();
map1.put("order_data", order_data);
String order_dataJSON = com.alibaba.fastjson.JSONObject.toJSONString(map1);
String order_dataJSON = com.alibaba.fastjson.JSONObject.toJSONString(order_data);
// 获得md5串
String sign = MD5Util.MD5Encode(order_dataJSON, "Utf-8");
......@@ -2348,8 +2363,9 @@ public class OrderController extends BaseController {
responese = Unirest.post("https://applet.mini189.cn/prod/generate")
.header("Content-Type", "application/json;charset=UTF-8")
.header("X-Sign", sign)
.body(order_dataJSON)
.asString();
log.info("移动下单接口,返回信息:" + responese);
log.info("移动下单接口,返回信息:" + responese.getBody());
} catch (ResourceAccessException e) {
count++;
if (count < 20) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment