|
|
@@ -76,6 +76,55 @@ public class AitableController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 客户已建联
|
|
|
+ * @param data
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/establishedContact")
|
|
|
+ McR establishedContactCustomer(@RequestBody JSONObject data) {
|
|
|
+ log.info("客户已建联, {}", data);
|
|
|
+ McException.assertParamException_Null(data, "aitableId");
|
|
|
+ String aitableId = UtilMap.getString(data, "aitableId");
|
|
|
+ Map<String,Object> fields = new HashMap<>();
|
|
|
+ try {
|
|
|
+ fields.put("jIS3Gbd","已建联"); //客户情况
|
|
|
+ aitableService.updateSys1CustomerData(aitableId,fields);
|
|
|
+ return McR.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ return McR.error("400",e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 业务员变更
|
|
|
+ * @param data
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/chanegBusinessUser")
|
|
|
+ McR changeCustomerBusinessUser(@RequestBody JSONObject data) {
|
|
|
+ log.info("业务员变更, {}", data);
|
|
|
+ McException.assertParamException_Null(data, "aitableId");
|
|
|
+ String aitableId = UtilMap.getString(data, "aitableId");
|
|
|
+ String yidaBusinessUserId = UtilMap.getString(data, "yidaBusinessUserId"); //业务userId
|
|
|
+ Map<String,Object> fields = new HashMap<>();
|
|
|
+ try {
|
|
|
+ JSONArray user = new JSONArray();
|
|
|
+ if(yidaBusinessUserId == null || yidaBusinessUserId.isEmpty()){
|
|
|
+ log.info("业务userId为空,将业务置空");
|
|
|
+ }else{
|
|
|
+ JSONObject unionId = new JSONObject();
|
|
|
+ unionId.put("unionId",ddCoreClient.getUnionIdByUserId(yidaBusinessUserId));
|
|
|
+ user.add(unionId);
|
|
|
+ }
|
|
|
+ fields.put("ynNC3Kq",JSONObject.toJSONString(user)); //业务【人事】
|
|
|
+ aitableService.updateSys1CustomerData(aitableId,fields);
|
|
|
+ return McR.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ return McR.error("400",e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 新建商机
|
|
|
* @param data
|