CRM(Customer Relationship Management

概述:客户关系管理简称CRM(Customer Relationship Management)

客户关系管理的定义是:企业为提高核心竞争力,利用相应的信息技术以及互联网技术来协调企业与顾客间在销售、营销和服务上的交互,从而提升其管理方式,向客户提供创新式的个性化的客户交互和服务的过程。其最终目标是吸引新客户、保留老客户以及将已有客户转为忠实客户,增加市场份额。

开发流程

1.需求分析》》2.画思维导图》》3.业务场景分析(用户使用场景)》》4.原型图(UI等等)》》5.选择开发工具(框架、IDE等等) 

(1)需求分析

  略

  (2)画思维导图

 先不涉及权限,暂定数据库十一张表,关联关系如下

 

  1 class UserProfile(models.Model):
  2     """用户信息表"""
  3     user = models.OneToOneField(User)
  4     name = models.CharField(verbose_name=\'姓名\',max_length=64)
  5     role = models.ManyToManyField(\'Role\',blank=True,verbose_name=\'角色\')
  6 
  7     def __str__(self):
  8         return \'%s-%s\'%(self.name,self.role.name)
  9 
 10 class Role(models.Model):
 11     """角色表"""
 12     name = models.CharField(verbose_name=\'角色名\',max_length=64,unique=True)
 13     menus = models.ManyToManyField(\'Menus\',verbose_name=\'菜单\')
 14     def __str__(self):
 15         return self.name
 16 
 17 class CustomerInfo(models.Model):
 18     \'\'\'客户信息表\'\'\'
 19     name = models.CharField(verbose_name=\'客户姓名\',max_length=64,default=None)
 20     contact_type_choices = ((0,\'qq\'),(1,\'微信\'),(2,\'手机\'),)
 21     contact_type = models.SmallIntegerField(choices=contact_type_choices,default=0)
 22     contact = models.CharField(verbose_name=\'联系方式详情\',max_length=64)
 23     source_choices = (
 24         (0,\'QQ群\'),
 25         (1,\'51CTO\'),
 26         (2,\'百度推广\'),
 27         (3,\'知乎\'),
 28         (4,\'转介绍\'),
 29         (5,\'其他\'),
 30     )
 31     source = models.SmallIntegerField(verbose_name=\'客户来源\',choices=source_choices)
 32     referral_from = models.ForeignKey(\'self\',null=True,blank=True,verbose_name=\'转介绍\')
 33     consult_courses = models.ManyToManyField("Course",verbose_name=\'咨询课程\')
 34     consult_content = models.TextField(verbose_name=\'咨询内容\')
 35     status_choices = (
 36         (0,\'未报名\'),
 37         (1,\'已报名\'),
 38         (2,\'已退学\')
 39     )
 40     status = models.SmallIntegerField(choices=source_choices,verbose_name=\'客户报名状态\')
 41     consultant = models.ForeignKey(\'UserProfile\',verbose_name=\'课程顾问\')
 42     data = models.DateField(auto_now_add=True)
 43 
 44     def __str__(self):
 45         return self.name
 46 
 47 class Student(models.Model):
 48     """学员表"""
 49     customer = models.ForeignKey(\'CustomerInfo\',verbose_name=\'学员客户\')
 50     class_grades = models.ManyToManyField(\'ClassList\',verbose_name=\'班级\')
 51 
 52     def __str__(self):
 53         return self.customer
 54 
 55 class CustomerFollowUp(models.Model):
 56     """客户跟踪记录表"""
 57     customer = models.ForeignKey(\'CustomerInfo\',verbose_name=\'客户\')
 58     content = models.TextField(verbose_name=\'跟踪内容\')
 59     user = models.ForeignKey(\'UserProfile\',verbose_name=\'跟进人\')
 60     status_choices = (
 61         (0,\'近期无报名计划\'),
 62         (1,\'一个月内报名\'),
 63         (2,\'2周内报名\'),
 64         (3,\'已报名\')
 65     )
 66     status = models.SmallIntegerField(choices=status_choices,verbose_name=\'报名意向\')
 67     data = models.DateField(auto_now_add=True)
 68 
 69     def __str__(self):
 70         return self.content
 71 
 72 
 73 
 74 class Course(models.Model):
 75     """课程表"""
 76     name = models.CharField(max_length=64,verbose_name=\'课程名\')
 77     price = models.PositiveSmallIntegerField(verbose_name=\'课程价格\')
 78     period = models.PositiveSmallIntegerField(verbose_name=\'周期(月)\',default=5)
 79     outline = models.TextField(verbose_name=\'大纲\')
 80 
 81     def __str__(self):
 82         return self.name
 83 
 84 class ClassList(models.Model):
 85     """班级列表"""
 86     branch = models.ForeignKey(\'Branch\',verbose_name=\'校区\')
 87     course = models.ForeignKey(\'Course\',verbose_name=\'课程\')
 88     class_type_choices = (
 89         (0,\'脱产\'),
 90         (1,\'周末\'),
 91         (2,\'网络班\'),
 92     )
 93     class_type = models.SmallIntegerField(choices=class_type_choices,default=0,verbose_name=\'班级类型\')
 94     semester = models.SmallIntegerField(verbose_name=\'学期\')
 95     teachers = models.ManyToManyField(\'UserProfile\',verbose_name=\'任教老师\')
 96     start_date = models.DateField(verbose_name=\'开班日期\')
 97     graduate_date = models.DateField(verbose_name=\'毕业日期\',blank=True,null=True)
 98 
 99     def __str__(self):
100         return "%s(%s)期" %(self.course.name,self.semester)
101 
102     class Meta:
103         unique_together = (\'branch\',\'class_type\',\'course\',\'semester\')
104 
105 
106 
107 
108 
109 class CourseRecord(models.Model):
110     """上课记录"""
111     class_grade = models.ForeignKey(\'ClassList\',verbose_name=\'上课班级\')
112     day_num = models.PositiveSmallIntegerField(verbose_name=\'课程节次\')
113     teacher = models.ForeignKey(\'UserProfile\',verbose_name=\'任课老师\')
114     title = models.CharField(max_length=64,verbose_name=\'本节主题\')
115     content = models.TextField(\'本节内容\')
116     has_homework = models.BooleanField(verbose_name=\'是否有作业\',default=True)
117     homework = models.TextField(verbose_name=\'作业需求\',blank=True,null=True)
118     date = models.DateField(auto_now_add=True)
119 
120     def __str__(self):
121         return "%s第(%s)节" % (self.class_grade, self.day_num)
122     class Meta:
123         unique_together = (\'class_grade\', \'day_num\')
124 
125 
126 class StudyRecord(models.Model):
127     """学习记录表"""
128     course_record = models.ForeignKey("CourseRecord")
129     student = models.ForeignKey("Student")
130 
131     score_choices = ((100,"A+"),
132                      (90,"A"),
133                      (85,"B+"),
134                      (80,"B"),
135                      (75,"B-"),
136                      (70,"C+"),
137                      (60,"C"),
138                      (40,"C-"),
139                      (-50,"D"),
140                      (0,"N/A"), #not avaliable
141                      (-100,"COPY"), #not avaliable
142                      )
143     score = models.SmallIntegerField(choices=score_choices,default=0)
144     show_choices = ((0,\'缺勤\'),
145                     (1,\'已签到\'),
146                     (2,\'迟到\'),
147                     (3,\'早退\'),
148                     )
149     show_status = models.SmallIntegerField(choices=show_choices,default=1)
150     note = models.TextField("成绩备注",blank=True,null=True)
151 
152     date = models.DateTimeField(auto_now_add=True)
153 
154     def __str__(self):
155 
156         return "%s %s %s" %(self.course_record,self.student,self.score)
157 
158 class Branch(models.Model):
159     """校区"""
160     name = models.CharField(max_length=64,unique=True)
161     addr = models.CharField(max_length=128,blank=True,null=True)
162     def __str__(self):
163         return self.name
164 
165 class Menus(models.Model):
166     """菜单表"""
167     name = models.CharField(max_length=64)
168     url_type_choices = ((0,\'absolute\'),(1,\'dynamic\'))
169     url_type = models.SmallIntegerField(verbose_name=\'URL类型\',choices=url_type_choices,default=0)
170     url_name = models.CharField(verbose_name=\'URL\',max_length=128)
171 
172     def __str__(self):
173         return self.name
174 
175     class Meta:
176         unique_together = (\'name\',\'url_name\')

数据库表结构

 

 

(3)用户使用场景分析

暂定角色:销售、学员、客户、教师、管理员
销售:招生、沟通客户、客户信息录入
学员:上课情况及成绩查询
客户:咨询课程及报名与否
教师:授课及课程记录填写
管理员:角色权限分配、全部信息查看

  (4)原型图

  由于CRM项目注重对数据的处理,所以暂定各个用户共用一套模板,数据动态生成

(5)开发工具的选择

  开发环境:python3.5.3

  框架:django1.10.6

创建项目    

初始化项目结构:

 

版权声明:本文为chenice原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/chenice/articles/6749593.html