CRM(客户关系管理系统)是一种帮助企业管理和跟踪客户联系信息、销售、市场营销活动、客户服务等内容的软件系统。下面是用 Java 实现一个简单的 CRM 系统的示例代码:
``` import java.util.ArrayList; import java.util.Scanner;
public class CRM { public static void main(String[] args) { ArrayList customers = new ArrayList<>();
while (true) {
System.out.println("1. 添加客户");
System.out.println("2. 查看客户列表");
System.out.println("3. 编辑客户信息");
System.out.println("4. 删除客户");
System.out.println("5. 退出系统");
System.out.print("请输入您的选择:");
Scanner sc = new Scanner(System.in);
int choice = sc.nextInt();
sc.nextLine(); // 消耗掉回车
if (choice == 1) {
// 添加客户
System.out.print("请输入客户姓名:");
String name = sc.nextLine();
System.out.print("请输入客户电话:");
String phone = sc.nextLine();
System.out.print("请输入客户邮箱:");
String email = sc.nextLine();
Customer customer = new Customer(name, phone, email);
customers.add(customer);
System.out.println("客户添加成功!");
} else if (choice == 2) {
// 查看客户列表
System.out.println("序号\t姓名\t电话\t邮箱");
for (int i = 0; i < customers.size(); i++) {
Customer customer = customers.get(i);
System.out.println((i + 1) + "\t" + customer.getName() + "\t" + customer.getPhone() + "\t" + customer.getEmail());
}
} else if (choice == 3) {
// 编辑客户信息
System.out