|
@@ -314,7 +314,9 @@ public class RjkServerImpl implements RjkServer {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
JSONObject contactCustom = duildContactCustom.ContactCustom(bizObjectNode);
|
|
JSONObject contactCustom = duildContactCustom.ContactCustom(bizObjectNode);
|
|
|
- body.put("contact_custom", contactCustom);
|
|
|
|
|
|
|
+ if (contactCustom != null){
|
|
|
|
|
+ body.put("contact_custom", contactCustom);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
String resp = doWeilingPost(url, body.toJSONString());
|
|
String resp = doWeilingPost(url, body.toJSONString());
|
|
|
log.info("卫瓴联系人创建响应(多个手机号), phones={}, resp={}", phones, resp);
|
|
log.info("卫瓴联系人创建响应(多个手机号), phones={}, resp={}", phones, resp);
|
|
@@ -331,50 +333,36 @@ public class RjkServerImpl implements RjkServer {
|
|
|
JSONObject body = new JSONObject();
|
|
JSONObject body = new JSONObject();
|
|
|
JSONObject ctbody = new JSONObject();
|
|
JSONObject ctbody = new JSONObject();
|
|
|
String userName = bizObjectNode.path("F0000001").asText();//客户昵称
|
|
String userName = bizObjectNode.path("F0000001").asText();//客户昵称
|
|
|
- if (userName != null && !userName.isEmpty()){
|
|
|
|
|
- body.put("user_name", userName);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ body.put("user_name", userName);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
String position = bizObjectNode.path("F0000123").asText();//这里是职位,F0000123对应的是职业
|
|
String position = bizObjectNode.path("F0000123").asText();//这里是职位,F0000123对应的是职业
|
|
|
- if (position != null && !position.isEmpty()){
|
|
|
|
|
- body.put("position", position);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ body.put("position", position);
|
|
|
|
|
|
|
|
String genderStr = bizObjectNode.path("F0000107").asText();
|
|
String genderStr = bizObjectNode.path("F0000107").asText();
|
|
|
int gender = Integer.parseInt(getGenderValueByLabel(genderStr)) ;
|
|
int gender = Integer.parseInt(getGenderValueByLabel(genderStr)) ;
|
|
|
- if (genderStr != null && !genderStr.isEmpty()){
|
|
|
|
|
- body.put("gender", gender);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ body.put("gender", gender);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 年龄字段 - 只有存在时才添加
|
|
// 年龄字段 - 只有存在时才添加
|
|
|
JsonNode ageNode = bizObjectNode.path("F0000214");
|
|
JsonNode ageNode = bizObjectNode.path("F0000214");
|
|
|
- if (!ageNode.isMissingNode()) {
|
|
|
|
|
- int age = ageNode.asInt();
|
|
|
|
|
- body.put("age", age);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ int age = ageNode.asInt();
|
|
|
|
|
+ body.put("age", age);
|
|
|
|
|
|
|
|
String wxId = bizObjectNode.path("F0000192").asText();//这里是微信ID,F0000192对应的是微信
|
|
String wxId = bizObjectNode.path("F0000192").asText();//这里是微信ID,F0000192对应的是微信
|
|
|
- if (wxId != null && !wxId.isEmpty()){
|
|
|
|
|
- body.put("wx_id", wxId);
|
|
|
|
|
- }
|
|
|
|
|
-// String qq = bizObjectNode.path("F0000192").asText("");//qq
|
|
|
|
|
|
|
+ body.put("wx_id", wxId);
|
|
|
|
|
+
|
|
|
|
|
+// String qq = bizObjectNode.path("F0000192").asText("");//qq
|
|
|
String email = bizObjectNode.path("F0000195").asText();
|
|
String email = bizObjectNode.path("F0000195").asText();
|
|
|
- if (email != null && !email.isEmpty()){
|
|
|
|
|
- body.put("email", email);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ body.put("email", email);
|
|
|
|
|
|
|
|
-// String remark = bizObjectNode.path("F0000164").asText();
|
|
|
|
|
-// if (remark != null && !remark.isEmpty()){
|
|
|
|
|
-// body.put("remark", remark);
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+// String remark = bizObjectNode.path("F0000164").asText();// if (remark != null && !remark.isEmpty()){
|
|
|
|
|
+// body.put("remark", remark);
|
|
|
|
|
|
|
|
body.put("contact_id", contactId);//必需
|
|
body.put("contact_id", contactId);//必需
|
|
|
- if (genderStr != null && !genderStr.isEmpty()){
|
|
|
|
|
- body.put("gender", gender);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
JSONObject contactCustom = duildContactCustom.ContactCustom(bizObjectNode);
|
|
JSONObject contactCustom = duildContactCustom.ContactCustom(bizObjectNode);
|
|
|
-// System.out.println("contactCustom的值是: "+ contactCustom);
|
|
|
|
|
|
|
+// System.out.println("contactCustom的值是: "+ contactCustom);
|
|
|
body.put("contact_custom", contactCustom);
|
|
body.put("contact_custom", contactCustom);
|
|
|
|
|
|
|
|
String owner = bizObjectNode.path("OwnerId").asText();//氚云客户经理同步卫瓴归属人逻辑
|
|
String owner = bizObjectNode.path("OwnerId").asText();//氚云客户经理同步卫瓴归属人逻辑
|
|
@@ -586,14 +574,28 @@ public class RjkServerImpl implements RjkServer {
|
|
|
|
|
|
|
|
JSONObject body = new JSONObject();
|
|
JSONObject body = new JSONObject();
|
|
|
|
|
|
|
|
- //todo 企业id
|
|
|
|
|
- String stageStr = bizObjectNode.path("F0000093").asText();
|
|
|
|
|
- int stageValue = Integer.parseInt(getStageValueByLabel(stageStr));
|
|
|
|
|
String Creator = bizObjectNode.path("CreatedBy").asText();
|
|
String Creator = bizObjectNode.path("CreatedBy").asText();
|
|
|
String createUserId = getUserIdByName(Creator);
|
|
String createUserId = getUserIdByName(Creator);
|
|
|
|
|
+ body.put("create_user_id", createUserId);//写死了 应该传createUserId -D8Gy9-20l6rJAfJIHJbQ6DuBA0bZOU5-XhteFfCCzUw
|
|
|
|
|
+
|
|
|
String createTimeStr = bizObjectNode.path("CreatedTime").asText();
|
|
String createTimeStr = bizObjectNode.path("CreatedTime").asText();
|
|
|
long createTime = convertToTimestamp(createTimeStr);
|
|
long createTime = convertToTimestamp(createTimeStr);
|
|
|
- String customerDataIds = bizObjectNode.path("F0000101").asText();
|
|
|
|
|
|
|
+ body.put("create_time", createTime);
|
|
|
|
|
+
|
|
|
|
|
+ String customerDataIds = bizObjectNode.path("F0000101").asText();//卫瓴客户数据ID
|
|
|
|
|
+ JSONArray relatedCustomers = new JSONArray();
|
|
|
|
|
+ JSONArray customerDataIdsArray = new JSONArray();
|
|
|
|
|
+ customerDataIdsArray.add(customerDataIds);//写死了 应该传customerDataIds
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject way = new JSONObject();
|
|
|
|
|
+ way.put("type", 0); // 0-联系人(根据卫瓴文档)
|
|
|
|
|
+ way.put("ids", customerDataIdsArray);
|
|
|
|
|
+ relatedCustomers.add(way);
|
|
|
|
|
+
|
|
|
|
|
+ body.put("related_customers", relatedCustomers);//必需-商机关联的外部相关人
|
|
|
|
|
+
|
|
|
|
|
+ String stageStr = bizObjectNode.path("F0000093").asText();
|
|
|
|
|
+ int stageValue = Integer.parseInt(getStageValueByLabel(stageStr));
|
|
|
// String fromChannelStr = bizObjectNode.path("F0000097").asText("");
|
|
// String fromChannelStr = bizObjectNode.path("F0000097").asText("");
|
|
|
// int fromChannelId = Integer.parseInt(getSourceValueByLabel(fromChannelStr));
|
|
// int fromChannelId = Integer.parseInt(getSourceValueByLabel(fromChannelStr));
|
|
|
String customerName = bizObjectNode.path("F0000002").asText();//客户名称
|
|
String customerName = bizObjectNode.path("F0000002").asText();//客户名称
|
|
@@ -619,21 +621,11 @@ public class RjkServerImpl implements RjkServer {
|
|
|
body.put("stage", 1);
|
|
body.put("stage", 1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- JSONArray relatedCustomers = new JSONArray();
|
|
|
|
|
- JSONArray customerDataIdsArray = new JSONArray();
|
|
|
|
|
- customerDataIdsArray.add(customerDataIds);//写死了 应该传customerDataIds
|
|
|
|
|
-
|
|
|
|
|
- JSONObject way = new JSONObject();
|
|
|
|
|
- way.put("type", 0); // 0-联系人(根据卫瓴文档)
|
|
|
|
|
- way.put("ids", customerDataIdsArray);
|
|
|
|
|
- relatedCustomers.add(way);
|
|
|
|
|
-
|
|
|
|
|
- body.put("related_customers", relatedCustomers);//必需-商机关联的外部相关人
|
|
|
|
|
-// body.put("company_id", "VtOjbpW4Qo6ZdR6y1Ogu_pI4aFP36GdwC4X-eVw-2xA");
|
|
|
|
|
- body.put("create_user_id", createUserId);//写死了 应该传createUserId -D8Gy9-20l6rJAfJIHJbQ6DuBA0bZOU5-XhteFfCCzUw
|
|
|
|
|
- body.put("create_time", createTime);
|
|
|
|
|
JSONObject businessCustom = duildBusinessCustom.BusinessCustom(bizObjectNode);
|
|
JSONObject businessCustom = duildBusinessCustom.BusinessCustom(bizObjectNode);
|
|
|
- body.put("business_custom", businessCustom);
|
|
|
|
|
|
|
+ if (businessCustom != null){
|
|
|
|
|
+ body.put("business_custom", businessCustom);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String resp = doWeilingPost(url, body.toJSONString());
|
|
String resp = doWeilingPost(url, body.toJSONString());
|
|
|
log.info("卫瓴商机新增响应: {}", resp);
|
|
log.info("卫瓴商机新增响应: {}", resp);
|
|
|
return JSON.parseObject(resp);
|
|
return JSON.parseObject(resp);
|