Skip to content

Commit

Permalink
20190820更新日志
Browse files Browse the repository at this point in the history
  • Loading branch information
GspiriTer committed Aug 20, 2019
1 parent f6370c5 commit 0268661
Show file tree
Hide file tree
Showing 161 changed files with 12,869 additions and 1,968 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ target
src/test/
README.md
logs
docs
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ UI框架:Element-UI 2.6.3

## 安装说明

配置java运行环境,redis环境,mysql环境,
然后将目录doc下的72crm.sql导入到数据库,修改`resources/config/crm9-config.txt`下的数据库以及redis的配置文件,
undertow启动端口号在`resources/config/undertow.txt`下修改,
默认账号 admin 默认密码 123456
1、配置java运行环境,redis环境,mysql环境。
2、将目录doc下的crm9.sql导入到数据库( `初始化安装只需要导入crm9.sql就好了,更新代码导入对应日期的sql文件`)。
3、修改`resources/config/crm9-config.txt`下的数据库配置文件。
4、修改`resources/config/redis.json`下的redis连接文件
5、undertow启动端口号在`resources/config/undertow.txt`下修改。
默认账号 admin 默认密码 123456



Expand All @@ -177,41 +179,42 @@ undertow启动端口号在`resources/config/undertow.txt`下修改,

本项目JDK要求JDK8及以上

### 一、Tomcat部署

### 一、Undertow(默认)


```
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
<groupId>com.jfinal</groupId>
<artifactId>jfinal-undertow</artifactId>
<version>1.6</version>
</dependency>
```

取消以上代码的注释,将undertow的引用注释掉,打包方式改为war,运行maven package命令,将war包放在`tomcat/webapps`目录下
取消以上代码的注释,将tomcat的pom依赖javax.servlet.javax.servlet-api注释掉,打包方式改为jar 运行maven package,打包完成后
将上述打包命令生成的 crm9-release.zip 文件上传到服务器并解压,运行对应的72crm.sh/72crm.bat即可

### 二、Undertow(默认)
### 二、Tomcat部署


```
<dependency>
<groupId>com.jfinal</groupId>
<artifactId>jfinal-undertow</artifactId>
<version>1.6</version>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
```

取消以上代码的注释,将undertow的pom依赖com.jfinal.jfinal-undertow注释掉,并将com.kakarote.crm9.Application的main方法注释掉,打包方式改为war,
运行maven package命令,将war包放在`tomcat/webapps`目录下

项目默认是ROOT.war,若需要携带项目名,需要修改 ux/config/prod.env.js的BASE_API为'"/项目名/"',改动完成后需要重新打包替换到webapp下

取消以上代码的注释,将tomcat的引用注释掉,打包方式改为jar 运行maven package。将上述打包命令生成的 zip 文件上传到服务器并解压,将目录下的
`
72crm.sh/72crm.bat
`
放到解压后的目录下,运行即可

项目webapp下自带打包后的前端代码,如果不需要对前端代码更改,直接访问即可
如果更改了前端代码,将打包后的dist下static文件夹和index.html替换到webapp下
ps:可以使用`nginx`代理静态文件,后台只做接口响应,项目本身设计是前后端完全分离的
项目webapp下自带打包后的前端代码,如果不需要对前端代码更改,直接访问即可
如果更改了前端代码,需要将打包后的dist下static文件夹和index.html替换到webapp下
ps:可以使用`nginx`代理静态文件,后台只做接口响应,项目本身设计是前后端完全分离的



Expand Down
320 changes: 160 additions & 160 deletions docs/crm9.sql

Large diffs are not rendered by default.

3,574 changes: 3,574 additions & 0 deletions docs/update20190619.sql

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions docs/update20190702.sql

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions docs/update20190715.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for 72crm_work_user
-- ----------------------------
DROP TABLE IF EXISTS `72crm_work_user`;
CREATE TABLE `72crm_work_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`work_id` int(11) NOT NULL COMMENT '项目ID',
`user_id` int(11) NOT NULL COMMENT '成员ID',
`role_id` int(11) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='项目成员表';

ALTER TABLE 72crm_work_task_lable RENAME TO 72crm_work_task_label;

ALTER TABLE `72crm_work_task_label`
CHANGE COLUMN `lable_id` `label_id` int(11) NOT NULL AUTO_INCREMENT FIRST ;

ALTER TABLE `72crm_admin_role`
ADD COLUMN `is_hidden` int(1) NULL DEFAULT 1 COMMENT '0 隐藏 1 不隐藏' AFTER `data_type`;

DROP TABLE IF EXISTS `72crm_work_relation`;

ALTER TABLE `72crm_task`
CHANGE COLUMN `lable_id` `label_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签 ,号拼接' AFTER `class_id`;

ALTER TABLE `72crm_task`
ADD COLUMN `is_archive` int(1) NULL DEFAULT 0 COMMENT '是否归档 0 否 1 是' AFTER `batch_id`;

ALTER TABLE `72crm_admin_role`
ADD COLUMN `label` int(2) NULL COMMENT '1 系统项目管理员角色 2 项目管理角色 3 项目编辑角色 4 项目只读角色' AFTER `is_hidden`;

DELETE FROM `72crm_admin_role` WHERE (`role_type`='5')

INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('项目管理员', '1', '1','1');
INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('管理', '5', '0','2');
INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('编辑', '5', '1','3');
set @rid = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( '0', '项目管理', 'work', '0', '0', '1', NULL);
set @workId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @workId, '任务', 'task', '1', '0', '1', NULL);
set @taskId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @taskId, '创建', 'save', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @workId, '任务列表', 'taskClass', '1', '0', '1', NULL);
set @classId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @classId, '新建任务列表', 'save', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @classId, '编辑任务列表', 'update', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @classId, '删除任务列表', 'delete', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @workId, '项目', 'work', '1', '0', '1', NULL);
set @wId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @wId, '项目设置', 'update', '3', '0', '1', NULL);
INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('只读', '5', '1','4');

ALTER TABLE `72crm_task`
MODIFY COLUMN `order_num` int(4) NULL DEFAULT 999 COMMENT '排序ID' AFTER `is_open`,
MODIFY COLUMN `top_order_num` int(4) NULL DEFAULT 999 COMMENT '我的任务排序ID' AFTER `order_num`;
62 changes: 62 additions & 0 deletions docs/update20190719.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for 72crm_work_user
-- ----------------------------
DROP TABLE IF EXISTS `72crm_work_user`;
CREATE TABLE `72crm_work_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`work_id` int(11) NOT NULL COMMENT '项目ID',
`user_id` int(11) NOT NULL COMMENT '成员ID',
`role_id` int(11) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='项目成员表';

ALTER TABLE 72crm_work_task_lable RENAME TO 72crm_work_task_label;

ALTER TABLE `72crm_work_task_label`
CHANGE COLUMN `lable_id` `label_id` int(11) NOT NULL AUTO_INCREMENT FIRST ;

ALTER TABLE `72crm_admin_role`
ADD COLUMN `is_hidden` int(1) NULL DEFAULT 1 COMMENT '0 隐藏 1 不隐藏' AFTER `data_type`;

DROP TABLE IF EXISTS `72crm_work_relation`;

ALTER TABLE `72crm_task`
CHANGE COLUMN `lable_id` `label_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签 ,号拼接' AFTER `class_id`;

ALTER TABLE `72crm_task`
ADD COLUMN `is_archive` int(1) NULL DEFAULT 0 COMMENT '是否归档 0 否 1 是' AFTER `batch_id`;

ALTER TABLE `72crm_admin_role`
ADD COLUMN `label` int(2) NULL COMMENT '1 系统项目管理员角色 2 项目管理角色 3 项目编辑角色 4 项目只读角色' AFTER `is_hidden`;

DELETE FROM `72crm_admin_role` WHERE (`role_type`='5')

INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('项目管理员', '1', '1','1');
INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('管理', '5', '0','2');
INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('编辑', '5', '1','3');
set @rid = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( '0', '项目管理', 'work', '0', '0', '1', NULL);
set @workId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @workId, '任务', 'task', '1', '0', '1', NULL);
set @taskId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @taskId, '创建', 'save', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @workId, '任务列表', 'taskClass', '1', '0', '1', NULL);
set @classId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @classId, '新建任务列表', 'save', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @classId, '编辑任务列表', 'update', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @classId, '删除任务列表', 'delete', '3', '0', '1', NULL);
INSERT INTO`72crm_admin_role_menu` (`role_id`, `menu_id`) VALUES (@rid, last_insert_id());
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @workId, '项目', 'work', '1', '0', '1', NULL);
set @wId = last_insert_id();
INSERT INTO `72crm_admin_menu` ( `parent_id`, `menu_name`, `realm`, `menu_type`, `sort`, `status`, `remarks`) VALUES ( @wId, '项目设置', 'update', '3', '0', '1', NULL);
INSERT INTO `72crm_admin_role` (`role_name`, `role_type`, `is_hidden`, `label`) VALUES ('只读', '5', '1','4');

ALTER TABLE `72crm_task`
MODIFY COLUMN `order_num` int(4) NULL DEFAULT 999 COMMENT '排序ID' AFTER `is_open`,
MODIFY COLUMN `top_order_num` int(4) NULL DEFAULT 999 COMMENT '我的任务排序ID' AFTER `order_num`;
11 changes: 11 additions & 0 deletions docs/update20190820.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALTER TABLE `72crm_admin_field`
ADD COLUMN `relevant` int(11) NULL COMMENT '只有线索需要,装换客户的自定义字段ID' AFTER `field_type`;

ALTER TABLE `72crm_crm_contract`
ADD COLUMN `total_price` decimal(10,2) NULL COMMENT '产品总金额' AFTER `discount_rate`;

ALTER TABLE `72crm_crm_business`
ADD COLUMN `total_price` decimal(10,2) NULL COMMENT '产品总金额' AFTER `discount_rate`;

INSERT INTO `72crm_admin_menu` VALUES ('146', '2', '办公分析', 'oa', '1', '10', '1', null);
INSERT INTO `72crm_admin_menu` VALUES ('147', '146', '查看', 'read', '3', '1', '1', null);
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.kakarote</groupId>
<artifactId>crm9</artifactId>
<packaging>jar</packaging>
<version>1.3.0</version>
<version>1.3.2</version>
<name>crm9-master</name>

<properties>
Expand Down Expand Up @@ -54,7 +54,7 @@
<dependency>
<groupId>com.jfinal</groupId>
<artifactId>cos</artifactId>
<version>2017.5</version>
<version>2019.8</version>
</dependency>
<dependency>
<groupId>it.sauronsoftware.cron4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.kakarote.crm9.common.annotation;

import java.lang.annotation.*;

/**
* 有此注解的方法会尝试从cookie获取登录状态
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Inherited
@Documented
public @interface LoginFormCookie {
}
13 changes: 13 additions & 0 deletions src/main/java/com/kakarote/crm9/common/annotation/RequestBody.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.kakarote.crm9.common.annotation;

import java.lang.annotation.*;

/**
* json数据注入
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@Inherited
@Documented
public @interface RequestBody {
}
26 changes: 7 additions & 19 deletions src/main/java/com/kakarote/crm9/common/config/JfinalConfig.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.kakarote.crm9.common.config;

import cn.hutool.core.util.ClassLoaderUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.druid.wall.WallFilter;
import com.jfinal.aop.Aop;
import com.kakarote.crm9.common.config.cache.CaffeineCache;
import com.kakarote.crm9.common.config.druid.DruidConfig;
import com.kakarote.crm9.common.config.json.ErpJsonFactory;
import com.kakarote.crm9.common.config.paragetter.BasePageRequest;
import com.kakarote.crm9.common.config.paragetter.MapParaGetter;
import com.kakarote.crm9.common.config.paragetter.PageParaGetter;
import com.kakarote.crm9.common.config.redis.RedisPlugin;
import com.kakarote.crm9.common.config.render.ErpRenderFactory;
import com.kakarote.crm9.common.constant.BaseConstant;
import com.kakarote.crm9.common.interceptor.AuthInterceptor;
Expand All @@ -31,19 +32,19 @@
import com.jfinal.plugin.cron4j.Cron4jPlugin;
import com.jfinal.plugin.druid.DruidPlugin;
import com.jfinal.plugin.druid.DruidStatViewHandler;
import com.jfinal.plugin.redis.RedisPlugin;
import com.jfinal.render.RenderManager;
import com.jfinal.template.Engine;
import com.kakarote.crm9.erp.work.service.WorkService;

import java.io.File;
import java.util.Map;

/**
* API 引导式配置
*/
public class JfinalConfig extends JFinalConfig {

public static Prop prop = PropKit.use("config/crm9-config.txt");
public final static Prop prop = PropKit.use("config/crm9-config.txt");

/**
* 配置常量
Expand Down Expand Up @@ -85,9 +86,9 @@ public void configEngine(Engine me) {
@Override
public void configPlugin(Plugins me) {
ParaProcessorBuilder.me.regist(BasePageRequest.class, PageParaGetter.class, null);
ParaProcessorBuilder.me.regist(Map.class, MapParaGetter.class, null);
// 配置 druid 数据库连接池插件
DruidPlugin druidPlugin = createDruidPlugin();
druidPlugin.addFilter(new WallFilter());
druidPlugin.setInitialSize(0);
druidPlugin.setMinIdle(0);
druidPlugin.setMaxActive(2000);
Expand All @@ -106,7 +107,8 @@ public void configPlugin(Plugins me) {
//扫描sql模板
getSqlTemplate(PathKit.getRootClassPath() + "/template", arp);
//Redis以及缓存插件
createRedisPlugin(me);
RedisPlugin redisPlugin=new RedisPlugin();
me.add(redisPlugin);
//cron定时器
me.add(new Cron4jPlugin(PropKit.use("config/cron4j.txt")));

Expand All @@ -118,20 +120,6 @@ public static DruidPlugin createDruidPlugin() {
return new DruidPlugin(prop.get("mysql.jdbcUrl"), prop.get("mysql.user"), prop.get("mysql.password").trim()).setInitialSize(1).setMinIdle(1).setMaxActive(2000).setTimeBetweenEvictionRunsMillis(5000).setValidationQuery("select 1").setTimeBetweenEvictionRunsMillis(60000).setMinEvictableIdleTimeMillis(30000).setFilters("stat,wall");
}

private void createRedisPlugin(Plugins me) {
for (String configName : prop.get("jfinal.redis", "").split(",")) {
RedisPlugin redisPlugin;
if (prop.getBoolean(configName + ".open", false)) {
if (prop.containsKey(configName + ".password") && StrUtil.isNotEmpty(prop.get(configName + ".password"))) {
redisPlugin = new RedisPlugin(prop.get(configName + ".cacheName").trim(), prop.get(configName + ".host").trim(), prop.getInt(configName + ".port", 6379), prop.getInt(configName + ".timeout", 20000), prop.get(configName + ".password", null),prop.getInt(configName+".database",0));
} else {
redisPlugin = new RedisPlugin(prop.get(configName + ".cacheName").trim(), prop.get(configName + ".host").trim(), prop.getInt(configName + ".port", 6379), prop.getInt(configName + ".timeout", 20000));
}
me.add(redisPlugin);
}
}
}

/**
* 配置全局拦截器
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.kakarote.crm9.common.config.druid;

import com.kakarote.crm9.common.config.redis.RedisManager;
import com.kakarote.crm9.utils.BaseUtil;
import com.jfinal.plugin.druid.IDruidStatViewAuth;
import com.jfinal.plugin.redis.Redis;

import javax.servlet.http.HttpServletRequest;

Expand All @@ -14,6 +14,6 @@ public class DruidConfig implements IDruidStatViewAuth {
@Override
public boolean isPermitted(HttpServletRequest request) {
String token = BaseUtil.getToken(request);
return Redis.use().exists(token);
return RedisManager.getRedis().exists(token);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.kakarote.crm9.common.config.paragetter;

import com.jfinal.core.Action;
import com.jfinal.core.Controller;
import com.jfinal.core.paragetter.ParaGetter;

import java.util.HashMap;
import java.util.Map;

public class MapParaGetter extends ParaGetter<Map> {

public MapParaGetter(String parameterName, String defaultValue) {
super(parameterName, defaultValue);
}

@Override
protected Map<String,Object> to(String s) {
return null;
}

@Override
public Map<String,Object> get(Action action, Controller controller) {
return new HashMap<>();
}
}
Loading

0 comments on commit 0268661

Please sign in to comment.