master
wangning 7 years ago
parent 5055bcdd23
commit 954ea54a74

@ -130,74 +130,74 @@ public class PartnerManageControllerTest {
} }
@Test // @Test
public void toMel_Zoe_All() { // public void toMel_Zoe_All() {
//
List<JSONObject> clients = clientMapper.testList("194"); // List<JSONObject> clients = clientMapper.testList("194");
//
String manager_id = "a1ffa1f6-3dc5-4dbe-bc00-ffc185c5ebc6"; // String manager_id = "a1ffa1f6-3dc5-4dbe-bc00-ffc185c5ebc6";
//
clients.forEach(p -> { // clients.forEach(p -> {
JSONObject manager = new JSONObject(); // JSONObject manager = new JSONObject();
manager.put("org_id", 1); // manager.put("org_id", 1);
manager.put("manager_id", manager_id); // manager.put("manager_id", manager_id);
String clientMoniker = p.getString("client_moniker"); // String clientMoniker = p.getString("client_moniker");
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "add"); // jsonObject.put("type", "add");
jsonObject.put("start_date", new Date()); // jsonObject.put("start_date", new Date());
//
JSONObject user = new JSONObject(); // JSONObject user = new JSONObject();
user.put("manager_id", manager_id); // user.put("manager_id", manager_id);
user.put("display_name", "Melbourne-Zoe"); // user.put("display_name", "Melbourne-Zoe");
user.put("proportion", "0.5"); // user.put("proportion", "0.5");
List<JSONObject> users = new ArrayList<>(); // List<JSONObject> users = new ArrayList<>();
users.add(user); // users.add(user);
jsonObject.put("users", users); // jsonObject.put("users", users);
try { // try {
clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject); // clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
//
}); // });
//
} // }
//
@Test // @Test
public void toSyd_Zoe_All() { // public void toSyd_Zoe_All() {
String manager_id = "215"; // String manager_id = "215";
List<JSONObject> clients = clientMapper.testList("110"); // List<JSONObject> clients = clientMapper.testList("110");
List<JSONObject> clients106 = clientMapper.testList("106"); // List<JSONObject> clients106 = clientMapper.testList("106");
List<JSONObject> clients240 = clientMapper.testList("240"); // List<JSONObject> clients240 = clientMapper.testList("240");
List<JSONObject> clients200 = clientMapper.testList("200"); // List<JSONObject> clients200 = clientMapper.testList("200");
clients.addAll(clients106); // clients.addAll(clients106);
clients.addAll(clients200); // clients.addAll(clients200);
clients.addAll(clients240); // clients.addAll(clients240);
//
clients.forEach(p -> { // clients.forEach(p -> {
JSONObject manager = new JSONObject(); // JSONObject manager = new JSONObject();
manager.put("org_id", 1); // manager.put("org_id", 1);
manager.put("manager_id", manager_id); // manager.put("manager_id", manager_id);
String clientMoniker = p.getString("client_moniker"); // String clientMoniker = p.getString("client_moniker");
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "add"); // jsonObject.put("type", "add");
jsonObject.put("start_date", new Date()); // jsonObject.put("start_date", new Date());
//
JSONObject user = new JSONObject(); // JSONObject user = new JSONObject();
user.put("manager_id", manager_id); // user.put("manager_id", manager_id);
user.put("display_name", "Sydney-Zoe"); // user.put("display_name", "Sydney-Zoe");
user.put("proportion", "0.5"); // user.put("proportion", "0.5");
List<JSONObject> users = new ArrayList<>(); // List<JSONObject> users = new ArrayList<>();
users.add(user); // users.add(user);
jsonObject.put("users", users); // jsonObject.put("users", users);
try { // try {
clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject); // clientManager.updateClientBDUsers(manager, clientMoniker, jsonObject);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
//
}); // });
//
} // }
} }
Loading…
Cancel
Save