CRM —— 1、搭建开发环境
发布日期:2022-04-07 05:21:38 浏览次数:33 分类:技术文章

本文共 18300 字,大约阅读时间需要 61 分钟。

目录


1、创建数据表

1.1、创建数据库

1.2、创建数据表

这里使用执行 SQL 脚本来导入数据表,各个脚本的 sql 语句如下

tbl_user.sql

/*Navicat MySQL Data TransferSource Server         : 192.168.151.2Source Server Version : 50536Source Host           : 192.168.151.2:3306Source Database       : crmTarget Server Type    : MYSQLTarget Server Version : 50536File Encoding         : 65001Date: 2018-11-27 17:02:13*/SET FOREIGN_KEY_CHECKS=0;-- ------------------------------ Table structure for `tbl_user`-- ----------------------------DROP TABLE IF EXISTS `tbl_user`;CREATE TABLE `tbl_user` (  `id` char(32) NOT NULL COMMENT 'uuid\r\n            ',  `login_act` varchar(255) DEFAULT NULL,  `name` varchar(255) DEFAULT NULL,  `login_pwd` varchar(255) DEFAULT NULL COMMENT '密码不能采用明文存储,采用密文,MD5加密之后的数据',  `email` varchar(255) DEFAULT NULL,  `expire_time` char(19) DEFAULT NULL COMMENT '失效时间为空的时候表示永不失效,失效时间为2018-10-10 10:10:10,则表示在该时间之前该账户可用。',  `lock_state` char(1) DEFAULT NULL COMMENT '锁定状态为空时表示启用,为0时表示锁定,为1时表示启用。',  `deptno` char(4) DEFAULT NULL,  `allow_ips` varchar(255) DEFAULT NULL COMMENT '允许访问的IP为空时表示IP地址永不受限,允许访问的IP可以是一个,也可以是多个,当多个IP地址的时候,采用半角逗号分隔。允许IP是192.168.100.2,表示该用户只能在IP地址为192.168.100.2的机器上使用。',  `createTime` char(19) DEFAULT NULL,  `create_by` varchar(255) DEFAULT NULL,  `edit_time` char(19) DEFAULT NULL,  `edit_by` varchar(255) DEFAULT NULL,  PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;-- ------------------------------ Records of tbl_user-- ----------------------------INSERT INTO `tbl_user` VALUES ('06f5fc056eac41558a964f96daa7f27c', 'ls', '李四', 'yf123', 'ls@163.com', '2018-11-27 21:50:05', '1', 'A001', '192.168.1.1,0:0:0:0:0:0:0:1', '2018-11-22 12:11:40', '李四', null, null);INSERT INTO `tbl_user` VALUES ('40f6cdea0bd34aceb77492a1656d9fb3', 'zs', '张三', 'yf123', 'zs@qq.com', '2018-11-30 23:50:55', '1', 'A001', '192.168.1.1,192.168.1.2,127.0.0.1,0:0:0:0:0:0:0:1', '2018-11-22 11:37:34', '张三', null, null);

dictionary.sql

/*==============================================================*//* DBMS name:      MySQL 5.0                                    *//* Created on:     2020/3/5 9:12:54                             *//*==============================================================*/drop table if exists tbl_dic_type;drop table if exists tbl_dic_value;/*==============================================================*//* Table: tbl_dic_type                                          *//*==============================================================*/create table tbl_dic_type(   code                 varchar(255) not null comment '编码是主键,不能为空,不能含有中文。',   name                 varchar(255),   description          varchar(255),   primary key (code));/*==============================================================*//* Table: tbl_dic_value                                         *//*==============================================================*/create table tbl_dic_value(   id                   char(32) not null comment '主键,采用UUID',   value                varchar(255) comment '不能为空,并且要求同一个字典类型下字典值不能重复,具有唯一性。',   text                 varchar(255) comment '可以为空',   order_no             varchar(255) comment '可以为空,但不为空的时候,要求必须是正整数',   type_code            varchar(255) comment '外键',   primary key (id));

crm-3_市场活动.sql

drop table if exists tbl_activity;drop table if exists tbl_activity_remark;/*==============================================================*//* Table: tbl_activity                                          *//*==============================================================*/create table tbl_activity(   id                   char(32) not null,   owner                char(32),   name                 varchar(255),   start_date            char(10),   end_date              char(10),   cost                 varchar(255),   description          varchar(255),   create_time           char(19),   create_by             varchar(255),   edit_time             char(19),   edit_by               varchar(255),   primary key (id));/*==============================================================*//* Table: tbl_activity_remark                                   *//*==============================================================*/create table tbl_activity_remark(   id                   char(32) not null,   note_content          varchar(255),   create_time           char(19),   create_by             varchar(255),   edit_time             char(19),   edit_by               varchar(255),   edit_flag             char(1) comment '0表示未修改,1表示已修改',   activity_id           char(32),   primary key (id));

crm-4_线索_客户_联系人_交易.sql

drop table if exists tbl_clue;drop table if exists tbl_clue_activity_relation;drop table if exists tbl_clue_remark;drop table if exists tbl_contacts;drop table if exists tbl_contacts_activity_relation;drop table if exists tbl_contacts_remark;drop table if exists tbl_customer;drop table if exists tbl_customer_remark;drop table if exists tbl_tran;drop table if exists tbl_tran_history;drop table if exists tbl_tran_remark;/*==============================================================*//* Table: tbl_clue                                              *//*==============================================================*/create table tbl_clue(   id                   char(32) not null,   fullname             varchar(255),   appellation          varchar(255),   owner                char(32),   company              varchar(255),   job                  varchar(255),   email                varchar(255),   phone                varchar(255),   website              varchar(255),   mphone               varchar(255),   state                varchar(255),   source               varchar(255),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   description          varchar(255),   contact_summary       varchar(255),   next_contact_time      char(10),   address              varchar(255),   primary key (id));/*==============================================================*//* Table: tbl_clue_activity_relation                            *//*==============================================================*/create table tbl_clue_activity_relation(   id                   char(32) not null,   clue_id               char(32),   activity_id           char(32),   primary key (id));/*==============================================================*//* Table: tbl_clue_remark                                       *//*==============================================================*/create table tbl_clue_remark(   id                   char(32) not null,   note_content          varchar(255),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   edit_flag             char(1),   clue_id               char(32),   primary key (id));/*==============================================================*//* Table: tbl_contacts                                          *//*==============================================================*/create table tbl_contacts(   id                   char(32) not null,   owner                char(32),   source               varchar(255),   customer_id           char(32),   fullname             varchar(255),   appellation          varchar(255),   email                varchar(255),   mphone               varchar(255),   job                  varchar(255),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   description          varchar(255),   contact_summary       varchar(255),   next_contact_time      char(10),   address              varchar(255),   primary key (id));/*==============================================================*//* Table: tbl_contacts_activity_relation                        *//*==============================================================*/create table tbl_contacts_activity_relation(   id                   char(32) not null,   contacts_id           char(32),   activity_id           char(32),   primary key (id));/*==============================================================*//* Table: tbl_contacts_remark                                   *//*==============================================================*/create table tbl_contacts_remark(   id                   char(32) not null,   note_content          varchar(255),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   edit_flag             char(1),   contacts_id           char(32),   primary key (id));/*==============================================================*//* Table: tbl_customer                                          *//*==============================================================*/create table tbl_customer(   id                   char(32) not null,   owner                char(32),   name                 varchar(255),   website              varchar(255),   phone                varchar(255),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   contact_summary       varchar(255),   next_contact_time      char(10),   description          varchar(255),   address              varchar(255),   primary key (id));/*==============================================================*//* Table: tbl_customer_remark                                   *//*==============================================================*/create table tbl_customer_remark(   id                   char(32) not null,   note_content          varchar(255),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   edit_flag             char(1),   customer_id           char(32),   primary key (id));/*==============================================================*//* Table: tbl_tran                                              *//*==============================================================*/create table tbl_tran(   id                   char(32) not null,   owner                char(32),   money                varchar(255),   name                 varchar(255),   expected_date         char(10),   customer_id           char(32),   stage                varchar(255),   type                 varchar(255),   source               varchar(255),   activity_id           char(32),   contacts_id           char(32),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   description          varchar(255),   contact_summary       varchar(255),   next_contact_time      char(10),   primary key (id));/*==============================================================*//* Table: tbl_tran_history                                      *//*==============================================================*/create table tbl_tran_history(   id                   char(32) not null,   stage                varchar(255),   money                varchar(255),   expected_date         char(10),   create_time           char(19),   create_by             varchar(255),   tran_id               char(32),   primary key (id));/*==============================================================*//* Table: tbl_tran_remark                                       *//*==============================================================*/create table tbl_tran_remark(   id                   char(32) not null,   note_content          varchar(255),   create_by             varchar(255),   create_time           char(19),   edit_by               varchar(255),   edit_time             char(19),   edit_flag             char(1),   tran_id               char(32),   primary key (id));

2、搭建开发环境

2.1、创建一个空项目,设置 JDK 为 1.8

创建 Empty Project,作为项目的工作空间,设置 JDK 为 1.8

2.2、创建 Maven 模块

创建 Maven 模块,从原型创建即可

 创建完后补全目录结构

 2.3、添加依赖

2.3.1、mysql驱动

mysql
mysql-connector-java
5.1.43

2.3.2、JDBC数据库连接池:Druid

com.alibaba
druid
1.1.1

2.3.3、MyBatis框架依赖

org.mybatis
mybatis
3.4.1

2.3.4、Spring相关依赖

org.springframework
spring-context
4.3.9.RELEASE
org.springframework
spring-aop
4.3.9.RELEASE
org.springframework
spring-core
4.3.9.RELEASE
org.springframework
spring-beans
4.3.9.RELEASE
org.springframework
spring-jdbc
4.3.9.RELEASE
org.springframework
spring-tx
4.3.9.RELEASE
org.springframework
spring-web
4.3.9.RELEASE
org.springframework
spring-webmvc
4.3.9.RELEASE
org.springframework
spring-oxm
4.3.9.RELEASE

2.3.5、SpringAOP依赖

org.aspectj
aspectjweaver
1.8.9

2.3.6、MyBatis 与 Spring 整合依赖

org.mybatis
mybatis-spring
1.3.0

2.3.7、添加项目对 JSP 的支持

javax.servlet
javax.servlet-api
3.1.0
javax.servlet.jsp.jstl
jstl-api
1.2
org.apache.taglibs
taglibs-standard-spec
1.2.1
org.apache.taglibs
taglibs-standard-impl
1.2.1

2.3.8、JackSon 插件依赖

com.fasterxml.jackson.core
jackson-core
2.7.3
com.fasterxml.jackson.core
jackson-databind
2.7.3
com.fasterxml.jackson.core
jackson-annotations
2.7.3

2.3.9、poi 依赖

org.apache.poi
poi
3.15

2.3.10、fileupload 依赖

commons-fileupload
commons-fileupload
1.3.1

2.3.11、log4j 依赖

org.apache.logging.log4j
log4j-api
2.3
org.apache.logging.log4j
log4j-core
2.3
org.apache.logging.log4j
log4j-jcl
2.3

3、添加各种配置

3.1、MyBatis 配置

mybatis-config.xml

3.2、配置数据连接和事务

applicationContext-datasource.xml 

3.3、springmvc 配置

applicationContext-mvc.xml

3.4、spring 总配置文件

applicationContext.xml

3.5、web.xml配置

dataservice application
contextConfigLocation
classpath:applicationContext.xml
org.springframework.web.context.ContextLoaderListener
encodingFilter
org.springframework.web.filter.CharacterEncodingFilter
encoding
UTF-8
encodingFilter
/*
dispatcher
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:applicationContext-mvc.xml
1
dispatcher
/
dispatcher
*.do
/

3.6、设置maven对配置文件的编译选项

maven 默认只对 java 目录下的文件编译,不会编译配置文件

pom.xml,放在 build 标签中

src/main/java
**/*.xml
src/main/resources
**/*.*

4、添加页面及静态资源

如下图添加页面及静态资源

 5、在 IDEA 添加 运行/调试配置

 

转载地址:https://blog.csdn.net/Mr_zhangyj/article/details/123699179 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:CRM —— 2、首页
下一篇:Creo4.0 二次开发---环境配置 ----搬砖

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年04月14日 04时43分27秒