diff --git a/.gitattributes b/.gitattributes
index cc41a2fd0..d479839ef 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,4 @@
-*.js linguist-language=Java
-*.css linguist-language=Java
-*.html linguist-language=Java
+*.js linguist-language=Java
+*.css linguist-language=Java
+*.html linguist-language=Java
+*.vue linguist-language=Java
diff --git a/.gitignore b/.gitignore
index 0fc2067d5..0d78ee0ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,19 +1,10 @@
-*.class
-
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
-
-*.iml
-# Package Files #
-*.jar
-*.war
-*.ear
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-
-.idea
-/target
-
-**/*.iml
-
+## ide
+**/.idea
+*.iml
+
+## backend
+**/target
+**/logs
+
+## front
+**/*.lock
diff --git a/README.md b/README.md
index 5f3640b1b..565f3f9bd 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# 项目总述
* 很多人说华夏ERP(英文名:jshERP)是目前人气领先的国产ERP系统
-* 虽然目前只有进销存+财务+生产的功能,但后面会推出ERP的全部功能,有兴趣请帮点一下 **Star** 哦
+* 虽然目前只有进销存+财务+生产的功能,但后面将会推出ERP的全部功能,有兴趣请帮点一下 **Star** 哦
* **官网URL:http://www.huaxiaerp.com 商务合作或技术交流,请联系QQ:752718920**
* 欢迎加入华夏ERP交流QQ群,群1:120725710(满)、群2:732152262
* 演示地址:http://47.116.69.14 演示账号:jsh,密码:123456
@@ -24,10 +24,9 @@
* UI框架: EasyUI 1.9.4
* 模板框架: AdminLTE 2.4.0
* 项目管理框架: Maven 3.2.3
-* API接口框架: swagger2.7.0(ip:port/doc.html)
# 开发环境
-建议开发者使用以下环境,可以避免版本不一致带来的问题
+建议开发者使用以下环境,可以避免版本带来的问题
* IDE: IntelliJ IDEA 2017+
* DB: Mysql5.7+
* JDK: JDK1.8
@@ -38,7 +37,7 @@
* JAVA平台: JRE1.8
* 操作系统:Windows、Linux等
* 为方便大家搭建运行环境,分享了下载地址 https://pan.baidu.com/s/1jlild9uyGdQ7H2yaMx76zw 提取码:814g
-* 不会maven打包的小伙伴,请下载此打包后的文件 https://pan.baidu.com/s/1Opqz-WjonJEfwWL_7iiyPw 提取码:yrq2
+* 不会maven打包的小伙伴,请下载此打包后的文件:https://pan.baidu.com/s/1soId837KuvhpzTAgF62XRA 提取码:tm3k
# 开源说明
* 本系统100%开源,遵守GPL-3.0协议
@@ -66,7 +65,7 @@

# 捐赠
-开源不易,坚持更难!如果您觉得华夏ERP不错,可以通过捐赠请作者喝杯咖啡~,在此表示感谢^_^。
+开源不易,坚持更难!如果您觉得华夏ERP不错,可以捐赠请作者喝杯咖啡~,在此表示感谢^_^。
点击以下链接,将页面拉到最下方点击“捐赠”即可。
diff --git a/jshERP-boot/.gitattributes b/jshERP-boot/.gitattributes
new file mode 100644
index 000000000..cc41a2fd0
--- /dev/null
+++ b/jshERP-boot/.gitattributes
@@ -0,0 +1,3 @@
+*.js linguist-language=Java
+*.css linguist-language=Java
+*.html linguist-language=Java
diff --git a/jshERP-boot/.gitignore b/jshERP-boot/.gitignore
new file mode 100644
index 000000000..0fc2067d5
--- /dev/null
+++ b/jshERP-boot/.gitignore
@@ -0,0 +1,19 @@
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+*.iml
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+.idea
+/target
+
+**/*.iml
+
diff --git a/jshERP-boot/docs/jsh_erp.sql b/jshERP-boot/docs/jsh_erp.sql
new file mode 100644
index 000000000..d98bd5f93
--- /dev/null
+++ b/jshERP-boot/docs/jsh_erp.sql
@@ -0,0 +1,995 @@
+/*
+Navicat MySQL Data Transfer
+
+Source Server : localhost
+Source Server Version : 50704
+Source Host : localhost:3306
+Source Database : jsh_erp_boot
+
+Target Server Type : MYSQL
+Target Server Version : 50704
+File Encoding : 65001
+
+Date: 2021-01-21 00:19:22
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for jsh_account
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_account`;
+CREATE TABLE `jsh_account` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(50) DEFAULT NULL COMMENT '名称',
+ `serial_no` varchar(50) DEFAULT NULL COMMENT '编号',
+ `initial_amount` decimal(24,6) DEFAULT NULL COMMENT '期初金额',
+ `current_amount` decimal(24,6) DEFAULT NULL COMMENT '当前余额',
+ `remark` varchar(100) DEFAULT NULL COMMENT '备注',
+ `is_default` bit(1) DEFAULT NULL COMMENT '是否默认',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='账户信息';
+
+-- ----------------------------
+-- Records of jsh_account
+-- ----------------------------
+INSERT INTO `jsh_account` VALUES ('17', '账户1', 'zzz111', '100.000000', '-2096.000000', 'aabb', '', '63', '0');
+INSERT INTO `jsh_account` VALUES ('18', '账户2', '1234131324', '200.000000', '-1750.000000', 'bb', '\0', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_account_head
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_account_head`;
+CREATE TABLE `jsh_account_head` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `type` varchar(50) DEFAULT NULL COMMENT '类型(支出/收入/收款/付款/转账)',
+ `organ_id` bigint(20) DEFAULT NULL COMMENT '单位Id(收款/付款单位)',
+ `hands_person_id` bigint(20) DEFAULT NULL COMMENT '经手人id',
+ `creator` bigint(20) DEFAULT NULL COMMENT '操作员',
+ `change_amount` decimal(24,6) DEFAULT NULL COMMENT '变动金额(优惠/收款/付款/实付)',
+ `total_price` decimal(24,6) DEFAULT NULL COMMENT '合计金额',
+ `account_id` bigint(20) DEFAULT NULL COMMENT '账户(收款/付款)',
+ `bill_no` varchar(50) DEFAULT NULL COMMENT '单据编号',
+ `bill_time` datetime DEFAULT NULL COMMENT '单据日期',
+ `remark` varchar(100) DEFAULT NULL COMMENT '备注',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`),
+ KEY `FK9F4C0D8DB610FC06` (`organ_id`),
+ KEY `FK9F4C0D8DAAE50527` (`account_id`),
+ KEY `FK9F4C0D8DC4170B37` (`hands_person_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8 COMMENT='财务主表';
+
+-- ----------------------------
+-- Records of jsh_account_head
+-- ----------------------------
+INSERT INTO `jsh_account_head` VALUES ('97', '收入', '58', '16', '63', '10.000000', '10.000000', '17', 'SR20191228121609', '2019-12-28 00:00:00', '备注1', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('98', '支出', '57', '16', '63', '-20.000000', '-20.000000', '17', 'ZC20191228121854', '2019-12-28 12:18:54', '', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('99', '收款', '58', '16', '63', null, '20.000000', null, 'SK20191228121908', '2019-12-28 12:19:08', '', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('100', '付款', '68', '16', '63', null, '-20.000000', null, 'FK20191228121920', '2019-12-28 12:19:20', '', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('101', '转账', null, '16', '63', '-20.000000', '-20.000000', '18', 'ZZ20191228121932', '2019-12-28 12:19:32', '', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('102', '收预付款', '60', '16', '63', null, '1000.000000', null, 'SYF20191228121945', '2019-12-28 12:19:45', '', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('103', '收入', '58', '16', '63', '20.000000', '20.000000', '18', 'SR20200721163125', '2020-07-21 16:31:25', '', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('104', '收入', '71', '16', '63', '60.000000', '50.000000', '18', 'SR20200721225712', '2020-07-21 00:00:00', 'bb', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('105', '转账', null, '16', '63', '-11.000000', '-11.000000', '18', 'ZZ20200722005429', '2020-07-22 00:54:29', '', '63', '0');
+INSERT INTO `jsh_account_head` VALUES ('106', '收入', '58', '16', '131', '1000.000000', '1000.000000', '17', 'SR20200913184412', '2020-09-13 18:44:12', '', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_account_item
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_account_item`;
+CREATE TABLE `jsh_account_item` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `header_id` bigint(20) NOT NULL COMMENT '表头Id',
+ `account_id` bigint(20) DEFAULT NULL COMMENT '账户Id',
+ `in_out_item_id` bigint(20) DEFAULT NULL COMMENT '收支项目Id',
+ `each_amount` decimal(24,6) DEFAULT NULL COMMENT '单项金额',
+ `remark` varchar(100) DEFAULT NULL COMMENT '单据备注',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`),
+ KEY `FK9F4CBAC0AAE50527` (`account_id`),
+ KEY `FK9F4CBAC0C5FE6007` (`header_id`),
+ KEY `FK9F4CBAC0D203EDC5` (`in_out_item_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8 COMMENT='财务子表';
+
+-- ----------------------------
+-- Records of jsh_account_item
+-- ----------------------------
+INSERT INTO `jsh_account_item` VALUES ('98', '97', null, '22', '10.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('99', '98', null, '21', '20.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('100', '99', '17', null, '20.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('101', '100', '17', null, '-20.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('102', '101', '17', null, '20.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('103', '102', '17', null, '1000.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('104', '103', null, '22', '20.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('105', '104', null, '22', '50.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('106', '105', '17', null, '11.000000', '', '63', '0');
+INSERT INTO `jsh_account_item` VALUES ('107', '106', null, '22', '1000.000000', '', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_depot
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_depot`;
+CREATE TABLE `jsh_depot` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(20) DEFAULT NULL COMMENT '仓库名称',
+ `address` varchar(50) DEFAULT NULL COMMENT '仓库地址',
+ `warehousing` decimal(24,6) DEFAULT NULL COMMENT '仓储费',
+ `truckage` decimal(24,6) DEFAULT NULL COMMENT '搬运费',
+ `type` int(10) DEFAULT NULL COMMENT '类型',
+ `sort` varchar(10) DEFAULT NULL COMMENT '排序',
+ `remark` varchar(100) DEFAULT NULL COMMENT '描述',
+ `principal` bigint(20) DEFAULT NULL COMMENT '负责人',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ `is_default` bit(1) DEFAULT NULL COMMENT '是否默认',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='仓库表';
+
+-- ----------------------------
+-- Records of jsh_depot
+-- ----------------------------
+INSERT INTO `jsh_depot` VALUES ('14', '仓库1', 'dizhi', '12.000000', '12.000000', '0', '2', '描述', '131', '63', '0', '');
+INSERT INTO `jsh_depot` VALUES ('15', '仓库2', '地址100', null, null, '0', '', '', '131', '63', '0', '\0');
+INSERT INTO `jsh_depot` VALUES ('17', '仓库3', '123123', '123.000000', '123.000000', '0', '123', '123', '131', '63', '0', '\0');
+
+-- ----------------------------
+-- Table structure for jsh_depot_head
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_depot_head`;
+CREATE TABLE `jsh_depot_head` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `type` varchar(50) DEFAULT NULL COMMENT '类型(出库/入库)',
+ `sub_type` varchar(50) DEFAULT NULL COMMENT '出入库分类',
+ `default_number` varchar(50) DEFAULT NULL COMMENT '初始票据号',
+ `number` varchar(50) DEFAULT NULL COMMENT '票据号',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `oper_time` datetime DEFAULT NULL COMMENT '出入库时间',
+ `organ_id` bigint(20) DEFAULT NULL COMMENT '供应商id',
+ `hands_person_id` bigint(20) DEFAULT NULL COMMENT '采购/领料-经手人id',
+ `creator` bigint(20) DEFAULT NULL COMMENT '操作员',
+ `account_id` bigint(20) DEFAULT NULL COMMENT '账户id',
+ `change_amount` decimal(24,6) DEFAULT NULL COMMENT '变动金额(收款/付款)',
+ `total_price` decimal(24,6) DEFAULT NULL COMMENT '合计金额',
+ `pay_type` varchar(50) DEFAULT NULL COMMENT '付款类型(现金、记账等)',
+ `bill_type` varchar(50) DEFAULT NULL COMMENT '单据类型',
+ `remark` varchar(1000) DEFAULT NULL COMMENT '备注',
+ `sales_man` varchar(50) DEFAULT NULL COMMENT '业务员(可以多个)',
+ `account_id_list` varchar(50) DEFAULT NULL COMMENT '多账户ID列表',
+ `account_money_list` varchar(200) DEFAULT NULL COMMENT '多账户金额列表',
+ `discount` decimal(24,6) DEFAULT NULL COMMENT '优惠率',
+ `discount_money` decimal(24,6) DEFAULT NULL COMMENT '优惠金额',
+ `discount_last_money` decimal(24,6) DEFAULT NULL COMMENT '优惠后金额',
+ `other_money` decimal(24,6) DEFAULT NULL COMMENT '销售或采购费用合计',
+ `other_money_list` varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目Id数组(包括快递、招待等)',
+ `other_money_item` varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目(包括快递、招待等)',
+ `account_day` int(10) DEFAULT NULL COMMENT '结算天数',
+ `status` varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2已转采购|销售',
+ `link_number` varchar(50) DEFAULT NULL COMMENT '关联订单号',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`),
+ KEY `FK2A80F214C4170B37` (`hands_person_id`),
+ KEY `FK2A80F214B610FC06` (`organ_id`),
+ KEY `FK2A80F214AAE50527` (`account_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=230 DEFAULT CHARSET=utf8 COMMENT='单据主表';
+
+-- ----------------------------
+-- Records of jsh_depot_head
+-- ----------------------------
+INSERT INTO `jsh_depot_head` VALUES ('189', '入库', '采购', 'CGRK00000000261', 'CGRK00000000261', '2019-04-10 22:25:49', '2020-02-20 23:51:03', '57', null, null, '17', '-120.000000', '-120.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '120.000000', '0.000000', '[\"undefined\"]', '[\"undefined\"]', null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('191', '入库', '采购', 'CGRK00000000264', 'CGRK00000000264', '2019-04-13 19:57:58', '2020-02-20 23:50:55', '57', null, null, '17', '-10.000000', '-10.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '10.000000', '0.000000', '[\"undefined\"]', '[\"undefined\"]', null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('192', '入库', '采购', 'CGRK00000000265', 'CGRK00000000265', '2019-04-20 00:36:24', '2020-02-20 23:50:47', '57', null, null, '17', '-220.000000', '-220.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '220.000000', '0.000000', '[\"undefined\"]', '[\"undefined\"]', null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('193', '出库', '销售', 'XSCK00000000268', 'XSCK00000000268', '2019-04-29 23:41:02', '2020-02-20 23:52:17', '58', null, null, '17', '300.000000', '300.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '300.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('196', '入库', '采购', 'CGRK00000000274', 'CGRK00000000274', '2019-04-30 22:35:53', '2020-02-20 23:49:07', '57', null, null, '18', '-1930.000000', '-1930.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '1930.000000', '0.000000', '[\"undefined\"]', '[\"undefined\"]', null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('197', '出库', '销售', 'XSCK00000000290', 'XSCK00000000290', '2019-04-30 23:15:27', '2020-02-20 23:52:01', '58', null, null, '17', '270.000000', '270.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '270.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('199', '其它', '采购订单', 'CGDD00000000305', 'CGDD00000000305', '2019-12-28 12:16:36', '2020-02-20 23:47:56', '57', '63', '63', null, '0.000000', '-22.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('200', '出库', '采购退货', 'CGTH00000000306', 'CGTH00000000306', '2019-12-28 12:16:55', '2020-02-20 23:51:28', '57', '63', '63', '17', '11.000000', '11.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '11.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('201', '其它', '销售订单', 'XSDD00000000307', 'XSDD00000000307', '2019-12-28 12:17:09', '2020-02-20 23:51:37', '58', '63', '63', null, '0.000000', '15.000000', '现付', null, '', '<14>', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('202', '入库', '销售退货', 'XSTH00000000308', 'XSTH00000000308', '2019-12-28 12:17:22', '2020-02-20 23:52:33', '58', '63', '63', '17', '-15.000000', '-15.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '15.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('203', '入库', '其它', 'QTRK00000000309', 'QTRK00000000309', '2019-12-28 12:17:40', '2020-02-20 23:52:51', '57', '63', '63', null, '0.000000', '42.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('204', '出库', '其它', 'QTCK00000000310', 'QTCK00000000310', '2019-12-28 12:17:48', '2020-02-20 23:53:04', '58', '63', '63', null, '0.000000', '15.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('205', '出库', '调拨', 'DBCK00000000311', 'DBCK00000000311', '2019-12-28 12:17:58', '2020-02-20 23:53:21', null, '63', '63', null, '0.000000', '15.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('206', '其它', '组装单', 'ZZD00000000312', 'ZZD00000000312', '2019-12-28 12:18:09', '2020-02-20 23:54:02', null, '63', '63', null, '0.000000', '10.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('207', '其它', '拆卸单', 'CXD00000000313', 'CXD00000000313', '2019-12-28 12:18:47', '2020-02-20 23:54:21', null, '63', '63', null, '0.000000', '0.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('208', '出库', '零售', 'LSCK00000000314', 'LSCK00000000314', '2019-12-28 12:20:26', '2019-12-28 12:20:14', '60', '63', '63', '17', '30.000000', '30.000000', '预付款', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('209', '入库', '零售退货', 'LSTH00000000315', 'LSTH00000000315', '2019-12-28 12:20:39', '2019-12-28 12:20:29', '60', '63', '63', '17', '-15.000000', '-15.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('210', '入库', '采购', 'CGRK00000000318', 'CGRK00000000318', '2020-02-20 23:22:38', '2020-02-20 23:22:27', '57', '63', '63', '17', '-110.000000', '-110.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '110.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('211', '入库', '采购', 'CGRK00000000319', 'CGRK00000000319', '2020-02-20 23:54:48', '2020-02-20 23:54:33', '57', '63', '63', '17', '-2400.000000', '-2400.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '2400.000000', null, '[\"undefined\"]', '[\"undefined\"]', null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('212', '入库', '采购', 'CGRK00000000320', 'CGRK00000000320', '2020-07-14 00:28:15', '2020-07-14 00:27:59', '57', '63', '63', '17', '-535.000000', '-535.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '535.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('214', '出库', '销售', 'XSCK00000000321', 'XSCK00000000321', '2020-07-15 00:38:07', '2020-07-15 00:37:36', '58', '63', '63', '17', '2400.000000', '2500.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '2500.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('215', '入库', '采购', 'CGRK00000000329', 'CGRK00000000329', '2020-07-21 00:35:16', '2020-07-21 00:35:05', '57', '63', '63', '17', '-800.000000', '-800.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '800.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('216', '出库', '销售', 'XSCK00000000330', 'XSCK00000000330', '2020-07-21 00:35:37', '2020-07-21 00:35:26', '58', '63', '63', '17', '308.000000', '308.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '308.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('217', '其它', '采购订单', 'CGDD00000000333', 'CGDD00000000333', '2020-07-21 01:15:15', '2020-07-21 01:15:07', '57', '63', '63', null, '0.000000', '-96.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '2', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('218', '入库', '采购', 'CGRK00000000334', 'CGRK00000000334', '2020-07-21 01:15:32', '2020-07-21 01:15:28', '57', '63', '63', '17', '-270.000000', '-270.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '270.000000', null, null, null, null, '0', 'CGDD00000000333', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('219', '出库', '销售', 'XSCK00000000336', 'XSCK00000000336', '2020-07-21 15:06:02', '2020-07-21 15:05:49', '59', '63', '63', '17', '70.000000', '70.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '70.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('222', '出库', '销售', 'XSCK00000000338', 'XSCK00000000338', '2020-07-21 23:05:55', '2020-07-21 23:04:05', '58', '63', '63', '17', '110.000000', '110.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '110.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('223', '入库', '采购', 'CGRK00000000339', 'CGRK00000000339', '2020-07-21 23:06:55', '2020-07-21 23:06:43', '68', '63', '63', '17', '-110.000000', '-110.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '110.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('224', '出库', '销售', 'XSCK00000000340', 'XSCK00000000340', '2020-07-21 23:07:06', '2020-07-21 23:06:59', '71', '63', '63', '17', '44.000000', '44.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '44.000000', null, null, null, null, '0', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('225', '其它', '盘点录入', 'PDLR00000000342', 'PDLR00000000342', '2020-07-22 00:07:13', '2020-07-22 00:06:53', null, '63', '63', null, '0.000000', '16.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '2', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('226', '其它', '盘点复盘', 'PDFP00000000344', 'PDFP00000000344', '2020-07-22 00:07:41', '2020-07-22 00:08:06', null, '63', '63', null, '0.000000', '16.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '1', 'PDFP00000000343', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('227', '其它', '采购订单', 'CGDD00000000345', 'CGDD00000000345', '2020-07-22 00:41:37', '2020-07-22 00:41:27', '74', '63', '63', null, '0.000000', '-110.000000', '现付', null, '', '', null, '', null, null, null, null, null, null, null, '2', '', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('228', '入库', '采购', 'CGRK00000000351', 'CGRK00000000351', '2020-07-22 00:48:09', '2020-07-22 00:47:48', '74', '63', '63', '17', '-110.000000', '-110.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '110.000000', null, null, null, null, '0', 'CGDD00000000345', '63', '0');
+INSERT INTO `jsh_depot_head` VALUES ('229', '入库', '采购', 'CGRK00000000352', 'CGRK00000000352', '2020-09-13 18:43:56', '2020-09-13 18:43:45', '57', null, '131', '17', '-90.000000', '-90.000000', '现付', null, '', '', null, '', '0.000000', '0.000000', '90.000000', null, null, null, null, '0', '', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_depot_item
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_depot_item`;
+CREATE TABLE `jsh_depot_item` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `header_id` bigint(20) NOT NULL COMMENT '表头Id',
+ `material_id` bigint(20) NOT NULL COMMENT '商品Id',
+ `material_extend_id` bigint(20) DEFAULT NULL COMMENT '商品扩展id',
+ `material_unit` varchar(20) DEFAULT NULL COMMENT '商品计量单位',
+ `oper_number` decimal(24,6) DEFAULT NULL COMMENT '数量',
+ `basic_number` decimal(24,6) DEFAULT NULL COMMENT '基础数量,如kg、瓶',
+ `unit_price` decimal(24,6) DEFAULT NULL COMMENT '单价',
+ `tax_unit_price` decimal(24,6) DEFAULT NULL COMMENT '含税单价',
+ `all_price` decimal(24,6) DEFAULT NULL COMMENT '金额',
+ `remark` varchar(200) DEFAULT NULL COMMENT '备注',
+ `img` varchar(50) DEFAULT NULL COMMENT '图片',
+ `incidentals` decimal(24,6) DEFAULT NULL COMMENT '运杂费',
+ `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库ID',
+ `another_depot_id` bigint(20) DEFAULT NULL COMMENT '调拨时,对方仓库Id',
+ `tax_rate` decimal(24,6) DEFAULT NULL COMMENT '税率',
+ `tax_money` decimal(24,6) DEFAULT NULL COMMENT '税额',
+ `tax_last_money` decimal(24,6) DEFAULT NULL COMMENT '价税合计',
+ `other_field1` varchar(50) DEFAULT NULL COMMENT '自定义字段1-名称',
+ `other_field2` varchar(50) DEFAULT NULL COMMENT '自定义字段2-型号',
+ `other_field3` varchar(50) DEFAULT NULL COMMENT '自定义字段3-制造商',
+ `other_field4` varchar(50) DEFAULT NULL COMMENT '自定义字段4-名称',
+ `other_field5` varchar(50) DEFAULT NULL COMMENT '自定义字段5-名称',
+ `material_type` varchar(20) DEFAULT NULL COMMENT '商品类型',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`),
+ KEY `FK2A819F475D61CCF7` (`material_id`),
+ KEY `FK2A819F474BB6190E` (`header_id`),
+ KEY `FK2A819F479485B3F5` (`depot_id`),
+ KEY `FK2A819F47729F5392` (`another_depot_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=utf8 COMMENT='单据子表';
+
+-- ----------------------------
+-- Records of jsh_depot_item
+-- ----------------------------
+INSERT INTO `jsh_depot_item` VALUES ('198', '189', '569', '3', '只', '12.000000', '12.000000', '10.000000', '10.000000', '120.000000', '', null, null, '14', null, '0.000000', '0.000000', '120.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('200', '191', '569', '3', '只', '1.000000', '1.000000', '10.000000', '10.000000', '10.000000', '', null, null, '14', null, '0.000000', '0.000000', '10.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('201', '192', '569', '3', '只', '22.000000', '22.000000', '10.000000', '10.000000', '220.000000', '', null, null, '14', null, '0.000000', '0.000000', '220.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('202', '193', '569', '3', '只', '20.000000', '0.000000', '15.000000', '15.000000', '300.000000', '', null, null, '14', null, '0.000000', '0.000000', '300.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('205', '196', '569', '3', '只', '2.000000', '122.000000', '10.000000', '10.000000', '20.000000', '', null, null, '15', null, '0.000000', '0.000000', '20.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('206', '197', '569', '3', '只', '18.000000', '0.000000', '15.000000', '15.000000', '270.000000', '', null, null, '14', null, '0.000000', '0.000000', '270.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('207', '196', '568', '2', '个', '10.000000', '2.000000', '11.000000', '11.000000', '110.000000', '', null, null, '15', null, '0.000000', '0.000000', '110.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('208', '196', '568', '2', '个', '10.000000', '2.000000', '11.000000', '11.000000', '110.000000', '', null, null, '15', null, '0.000000', '0.000000', '110.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('209', '196', '568', '2', '个', '10.000000', '2.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('210', '196', '568', '2', '个', '10.000000', '2.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('211', '196', '568', '2', '个', '10.000000', '3.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('212', '196', '568', '2', '个', '10.000000', '4.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('213', '196', '568', '2', '个', '100.000000', '5.000000', '11.000000', '11.000000', '1100.000000', '', null, null, '14', null, '0.000000', '0.000000', '1100.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('214', '196', '569', '3', '只', '15.000000', '6.000000', '10.000000', '10.000000', '150.000000', '', null, null, '14', null, '0.000000', '0.000000', '150.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('216', '199', '568', '2', '个', '2.000000', '2.000000', '11.000000', '11.000000', '22.000000', '', null, null, '14', null, '0.000000', '0.000000', '22.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('217', '200', '568', '2', '个', '1.000000', '0.000000', '11.000000', '11.000000', '11.000000', '', null, null, '14', null, '0.000000', '0.000000', '11.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('218', '201', '568', '2', '个', '1.000000', '1.000000', '15.000000', '15.000000', '15.000000', '', null, null, '14', null, '0.000000', '0.000000', '15.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('219', '202', '568', '2', '个', '1.000000', '1.000000', '15.000000', '15.000000', '15.000000', '', null, null, '14', null, '0.000000', '0.000000', '15.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('220', '203', '568', '2', '个', '2.000000', '2.000000', '11.000000', '11.000000', '22.000000', '', null, null, '14', null, '0.000000', '0.000000', '22.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('221', '203', '569', '3', '只', '2.000000', '2.000000', '10.000000', '10.000000', '20.000000', '', null, null, '14', null, '0.000000', '0.000000', '20.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('222', '204', '569', '3', '只', '1.000000', '0.000000', '15.000000', '15.000000', '15.000000', '', null, null, '14', null, '0.000000', '0.000000', '15.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('223', '205', '568', '2', '个', '1.000000', '1.000000', '15.000000', '15.000000', '15.000000', '', null, null, '14', '15', '0.000000', '0.000000', '15.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('224', '206', '568', '2', '个', '1.000000', '1.000000', '5.000000', '5.000000', '5.000000', '', null, null, '14', null, '0.000000', '0.000000', '5.000000', '', '', '', '', '', '组合件', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('225', '206', '569', '3', '只', '1.000000', '1.000000', '5.000000', '5.000000', '5.000000', '', null, null, '14', null, '0.000000', '0.000000', '5.000000', '', '', '', '', '', '普通子件', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('226', '207', '569', '3', '只', '1.000000', '1.000000', '0.000000', '0.000000', '0.000000', '', null, null, '14', null, '0.000000', '0.000000', '0.000000', '', '', '', '', '', '组合件', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('227', '207', '568', '2', '个', '1.000000', '1.000000', '0.000000', '0.000000', '0.000000', '', null, null, '14', null, '0.000000', '0.000000', '0.000000', '', '', '', '', '', '普通子件', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('228', '208', '568', '2', '个', '2.000000', '2.000000', '15.000000', '15.000000', '30.000000', '', null, null, '14', null, '0.000000', '0.000000', '30.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('229', '209', '568', '2', '个', '1.000000', '1.000000', '15.000000', '15.000000', '15.000000', '', null, null, '14', null, '0.000000', '0.000000', '15.000000', '', '', '', '', '', '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('230', '210', '587', '1', '个', '10.000000', '10.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('231', '211', '579', '8', '箱', '10.000000', '120.000000', '240.000000', '240.000000', '2400.000000', '', null, null, '14', null, '0.000000', '0.000000', '2400.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('232', '212', '587', '1', '个', '5.000000', '5.000000', '11.000000', '11.000000', '55.000000', '', null, null, '14', null, '0.000000', '0.000000', '55.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('233', '212', '570', '4', '个', '60.000000', '60.000000', '8.000000', '8.000000', '480.000000', '', null, null, '14', null, '0.000000', '0.000000', '480.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('234', '214', '570', '4', '个', '100.000000', '100.000000', '14.000000', '14.000000', '1400.000000', '', null, null, '14', null, '0.000000', '0.000000', '1400.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('235', '214', '587', '1', '个', '50.000000', '50.000000', '22.000000', '22.000000', '1100.000000', '', null, null, '14', null, '0.000000', '0.000000', '1100.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('236', '215', '570', '4', '个', '100.000000', '100.000000', '8.000000', '8.000000', '800.000000', '', null, null, '14', null, '0.000000', '0.000000', '800.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('237', '216', '570', '4', '个', '22.000000', '22.000000', '14.000000', '14.000000', '308.000000', '', null, null, '14', null, '0.000000', '0.000000', '308.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('238', '217', '570', '4', '个', '12.000000', '12.000000', '8.000000', '8.000000', '96.000000', '', null, null, '14', null, '0.000000', '0.000000', '96.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('239', '218', '570', '4', '个', '15.000000', '15.000000', '18.000000', '18.000000', '270.000000', '', null, null, '14', null, '0.000000', '0.000000', '270.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('240', '219', '570', '4', '个', '5.000000', '5.000000', '14.000000', '14.000000', '70.000000', '', null, null, '14', null, '0.000000', '0.000000', '70.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('241', '222', '588', '10', '个', '5.000000', '5.000000', '22.000000', '22.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('242', '223', '588', '10', '个', '10.000000', '10.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('243', '224', '588', '10', '个', '2.000000', '2.000000', '22.000000', '22.000000', '44.000000', '', null, null, '14', null, '0.000000', '0.000000', '44.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('244', '225', '570', '4', '个', '2.000000', '2.000000', '8.000000', '8.000000', '16.000000', '', null, null, '14', null, '0.000000', '0.000000', '16.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('245', '226', '570', '4', '个', '2.000000', '2.000000', '8.000000', '8.000000', '16.000000', '', null, null, '14', null, '0.000000', '0.000000', '16.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('246', '227', '588', '10', '个', '10.000000', '10.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('247', '228', '588', '10', '个', '10.000000', '10.000000', '11.000000', '11.000000', '110.000000', '', null, null, '14', null, '0.000000', '0.000000', '110.000000', null, null, null, null, null, '', '63', '0');
+INSERT INTO `jsh_depot_item` VALUES ('248', '229', '569', '3', '只', '9.000000', '9.000000', '10.000000', '10.000000', '90.000000', '', null, null, '14', null, '0.000000', '0.000000', '90.000000', null, null, null, null, null, '', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_function
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_function`;
+CREATE TABLE `jsh_function` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `number` varchar(50) DEFAULT NULL COMMENT '编号',
+ `name` varchar(50) DEFAULT NULL COMMENT '名称',
+ `parent_number` varchar(50) DEFAULT NULL COMMENT '上级编号',
+ `url` varchar(100) DEFAULT NULL COMMENT '链接',
+ `component` varchar(100) DEFAULT NULL COMMENT '组件',
+ `state` bit(1) DEFAULT NULL COMMENT '收缩',
+ `sort` varchar(50) DEFAULT NULL COMMENT '排序',
+ `enabled` bit(1) DEFAULT NULL COMMENT '启用',
+ `type` varchar(50) DEFAULT NULL COMMENT '类型',
+ `push_btn` varchar(50) DEFAULT NULL COMMENT '功能按钮',
+ `icon` varchar(50) DEFAULT NULL COMMENT '图标',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=257 DEFAULT CHARSET=utf8 COMMENT='功能模块表';
+
+-- ----------------------------
+-- Records of jsh_function
+-- ----------------------------
+INSERT INTO `jsh_function` VALUES ('1', '0001', '系统管理', '0', '/system', '/layouts/TabLayout', '', '0910', '', '电脑版', '', 'setting', '0');
+INSERT INTO `jsh_function` VALUES ('13', '000102', '角色管理', '0001', '/system/role', '/system/RoleList', '\0', '0130', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('14', '000103', '用户管理', '0001', '/system/user', '/system/UserList', '\0', '0140', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('15', '000104', '日志管理', '0001', '/system/log', '/system/LogList', '\0', '0160', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('16', '000105', '功能管理', '0001', '/system/function', '/system/FunctionList', '\0', '0166', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('21', '0101', '商品管理', '0', '/material', '/layouts/TabLayout', '\0', '0620', '', '电脑版', null, 'shopping', '0');
+INSERT INTO `jsh_function` VALUES ('22', '010101', '商品类别', '0101', '/material/material_category', '/material/MaterialCategoryList', '\0', '0230', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('23', '010102', '商品信息', '0101', '/material/material', '/material/MaterialList', '\0', '0240', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('24', '0102', '基本资料', '0', '/system', '/layouts/TabLayout', '\0', '0750', '', '电脑版', null, 'appstore', '0');
+INSERT INTO `jsh_function` VALUES ('25', '01020101', '供应商信息', '0102', '/system/vendor', '/system/VendorList', '\0', '0260', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('26', '010202', '仓库信息', '0102', '/system/depot', '/system/DepotList', '\0', '0270', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('31', '010206', '经手人管理', '0102', '/system/person', '/system/PersonList', '\0', '0284', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('32', '0502', '采购管理', '0', '/bill', '/layouts/TabLayout', '\0', '0330', '', '电脑版', '', 'retweet', '0');
+INSERT INTO `jsh_function` VALUES ('33', '050201', '采购入库', '0502', '/bill/purchase_in', '/bill/PurchaseInList', '\0', '0340', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('38', '0603', '销售管理', '0', '/bill', '/layouts/TabLayout', '\0', '0390', '', '电脑版', '', 'shopping-cart', '0');
+INSERT INTO `jsh_function` VALUES ('40', '080107', '调拨出库', '0801', '/bill/allocation_out', '/bill/AllocationOutList', '\0', '0807', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('41', '060303', '销售出库', '0603', '/bill/sale_out', '/bill/SaleOutList', '\0', '0394', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('44', '0704', '财务管理', '0', '/financial', '/layouts/TabLayout', '\0', '0450', '', '电脑版', '', 'money-collect', '0');
+INSERT INTO `jsh_function` VALUES ('59', '030101', '库存状况', '0301', '/report/in_out_stock_report', '/report/InOutStockReport', '\0', '0600', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('194', '010204', '收支项目', '0102', '/system/in_out_item', '/system/InOutItemList', '\0', '0282', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('195', '010205', '结算账户', '0102', '/system/account', '/system/AccountList', '\0', '0283', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('197', '070402', '收入单', '0704', '/financial/item_in', '/financial/ItemInList', '\0', '0465', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('198', '0301', '报表查询', '0', '/report', '/layouts/TabLayout', '\0', '0570', '', '电脑版', null, 'pie-chart', '0');
+INSERT INTO `jsh_function` VALUES ('199', '050204', '采购退货', '0502', '/bill/purchase_back', '/bill/PurchaseBackList', '\0', '0345', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('200', '060305', '销售退货', '0603', '/bill/sale_back', '/bill/SaleBackList', '\0', '0396', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('201', '080103', '其它入库', '0801', '/bill/other_in', '/bill/OtherInList', '\0', '0803', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('202', '080105', '其它出库', '0801', '/bill/other_out', '/bill/OtherOutList', '\0', '0805', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('203', '070403', '支出单', '0704', '/financial/item_out', '/financial/ItemOutList', '\0', '0470', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('204', '070404', '收款单', '0704', '/financial/money_in', '/financial/MoneyInList', '\0', '0475', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('205', '070405', '付款单', '0704', '/financial/money_out', '/financial/MoneyOutList', '\0', '0480', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('206', '070406', '转账单', '0704', '/financial/giro', '/financial/GiroList', '\0', '0490', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('207', '030102', '账户统计', '0301', '/report/account_report', '/report/AccountReport', '\0', '0610', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('208', '030103', '进货统计', '0301', '/report/buy_in_report', '/report/BuyInReport', '\0', '0620', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('209', '030104', '销售统计', '0301', '/report/sale_out_report', '/report/SaleOutReport', '\0', '0630', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('210', '040102', '零售出库', '0401', '/bill/retail_out', '/bill/RetailOutList', '\0', '0405', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/bill/retail_back', '/bill/RetailBackList', '\0', '0407', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('212', '070407', '收预付款', '0704', '/financial/advance_in', '/financial/AdvanceInList', '\0', '0495', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('217', '01020102', '客户信息', '0102', '/system/customer', '/system/CustomerList', '\0', '0262', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('218', '01020103', '会员信息', '0102', '/system/member', '/system/MemberList', '\0', '0263', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('220', '010103', '计量单位', '0101', '/system/unit', '/system/UnitList', '\0', '0245', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('225', '0401', '零售管理', '0', '/bill', '/layouts/TabLayout', '\0', '0101', '', '电脑版', '', 'gift', '0');
+INSERT INTO `jsh_function` VALUES ('226', '030106', '入库明细', '0301', '/report/in_detail', '/report/InDetail', '\0', '0640', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('227', '030107', '出库明细', '0301', '/report/out_detail', '/report/OutDetail', '\0', '0645', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('228', '030108', '入库汇总', '0301', '/report/in_material_count', '/report/InMaterialCount', '\0', '0650', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('229', '030109', '出库汇总', '0301', '/report/out_material_count', '/report/OutMaterialCount', '\0', '0655', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('232', '080109', '组装单', '0801', '/bill/assemble', '/bill/AssembleList', '\0', '0809', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('233', '080111', '拆卸单', '0801', '/bill/disassemble', '/bill/DisassembleList', '\0', '0811', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('234', '000105', '系统配置', '0001', '/system/system_config', '/system/SystemConfigList', '\0', '0165', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('235', '030110', '客户对账', '0301', '/report/customer_account', '/report/CustomerAccount', '\0', '0660', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('236', '000106', '商品属性', '0001', '/material/material_property', '/system/MaterialPropertyList', '\0', '0168', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('237', '030111', '供应商对账', '0301', '/report/vendor_account', '/report/VendorAccount', '\0', '0665', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('239', '0801', '仓库管理', '0', '/bill', '/layouts/TabLayout', '\0', '0420', '', '电脑版', '', 'hdd', '0');
+INSERT INTO `jsh_function` VALUES ('240', '010104', '序列号', '0101', '/system/serial_number', '/system/SerialNumberList', '\0', '0246', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('241', '050202', '采购订单', '0502', '/bill/purchase_order', '/bill/PurchaseOrderList', '\0', '0335', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('242', '060301', '销售订单', '0603', '/bill/sale_orders', '/bill/SaleOrdersList', '\0', '0392', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('243', '000108', '机构管理', '0001', '/system/organization', '/system/OrganizationList', '', '0150', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('244', '030112', '库存预警', '0301', '/report/stock_warning_report', '/report/StockWarningReport', '\0', '0670', '', '电脑版', '', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('245', '000107', '插件管理', '0001', '/system/plugin', '/system/PluginList', '\0', '0170', '', '电脑版', '1', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('254', '1001', '生产管理', '0', '/plugin', '/layouts/TabLayout', '\0', '0550', '', '电脑版', '', 'tool', '0');
+INSERT INTO `jsh_function` VALUES ('255', '100101', '生产任务[插件]', '1001', '/plugin/produce/task', '/plugin/Produce/TaskList', '\0', '0552', '', '电脑版', '1,2', 'profile', '0');
+INSERT INTO `jsh_function` VALUES ('256', '100102', 'BOM管理[插件]', '1001', '/plugin/produce/bom', '/plugin/Produce/BomList', '\0', '0554', '', '电脑版', '1', 'profile', '0');
+
+-- ----------------------------
+-- Table structure for jsh_in_out_item
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_in_out_item`;
+CREATE TABLE `jsh_in_out_item` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(50) DEFAULT NULL COMMENT '名称',
+ `type` varchar(20) DEFAULT NULL COMMENT '类型',
+ `remark` varchar(100) DEFAULT NULL COMMENT '备注',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='收支项目';
+
+-- ----------------------------
+-- Records of jsh_in_out_item
+-- ----------------------------
+INSERT INTO `jsh_in_out_item` VALUES ('21', '快递费', '支出', '', '63', '0');
+INSERT INTO `jsh_in_out_item` VALUES ('22', '房租收入', '收入', '', '63', '0');
+INSERT INTO `jsh_in_out_item` VALUES ('23', '利息收入', '收入', '收入', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_log
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_log`;
+CREATE TABLE `jsh_log` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
+ `operation` varchar(500) DEFAULT NULL COMMENT '操作模块名称',
+ `client_ip` varchar(50) DEFAULT NULL COMMENT '客户端IP',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `status` tinyint(4) DEFAULT NULL COMMENT '操作状态 0==成功,1==失败',
+ `content` varchar(1000) DEFAULT NULL COMMENT '详情',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ PRIMARY KEY (`id`),
+ KEY `FKF2696AA13E226853` (`user_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=6800 DEFAULT CHARSET=utf8 COMMENT='操作日志';
+
+-- ----------------------------
+-- Records of jsh_log
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for jsh_material
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_material`;
+CREATE TABLE `jsh_material` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `category_id` bigint(20) DEFAULT NULL COMMENT '产品类型id',
+ `name` varchar(50) DEFAULT NULL COMMENT '名称',
+ `mfrs` varchar(50) DEFAULT NULL COMMENT '制造商',
+ `safety_stock` decimal(24,6) DEFAULT NULL COMMENT '安全存量(KG)',
+ `model` varchar(50) DEFAULT NULL COMMENT '型号',
+ `standard` varchar(50) DEFAULT NULL COMMENT '规格',
+ `color` varchar(50) DEFAULT NULL COMMENT '颜色',
+ `unit` varchar(50) DEFAULT NULL COMMENT '单位-单个',
+ `remark` varchar(100) DEFAULT NULL COMMENT '备注',
+ `unit_id` bigint(20) DEFAULT NULL COMMENT '计量单位Id',
+ `enabled` bit(1) DEFAULT NULL COMMENT '启用 0-禁用 1-启用',
+ `other_field1` varchar(50) DEFAULT NULL COMMENT '自定义1',
+ `other_field2` varchar(50) DEFAULT NULL COMMENT '自定义2',
+ `other_field3` varchar(50) DEFAULT NULL COMMENT '自定义3',
+ `enable_serial_number` varchar(1) DEFAULT '0' COMMENT '是否开启序列号,0否,1是',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`),
+ KEY `FK675951272AB6672C` (`category_id`),
+ KEY `UnitId` (`unit_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=589 DEFAULT CHARSET=utf8 COMMENT='产品表';
+
+-- ----------------------------
+-- Records of jsh_material
+-- ----------------------------
+INSERT INTO `jsh_material` VALUES ('568', '17', '商品1', '制1', '100.000000', 'sp1', '', '', '个', '', null, '', '', '', '', '0', '63', '0');
+INSERT INTO `jsh_material` VALUES ('569', '17', '商品2', '', '200.000000', 'sp2', '', '', '只', '', null, '', '', '', '', '0', '63', '0');
+INSERT INTO `jsh_material` VALUES ('570', '17', '商品3', '', '300.000000', 'sp3', '', '', '个', '', null, '', '', '', '', '0', '63', '0');
+INSERT INTO `jsh_material` VALUES ('577', null, '商品8', '', null, 'sp8', '', '', '', '', '15', '', '', '', '', '0', '63', '0');
+INSERT INTO `jsh_material` VALUES ('579', '21', '商品17', '', null, 'sp17', '', '', '', '', '15', '', '', '', '', '0', '63', '0');
+INSERT INTO `jsh_material` VALUES ('586', '17', '序列号商品测试', '', null, 'xlh123', '', '', '个', '', null, '', '', '', '', '1', '63', '0');
+INSERT INTO `jsh_material` VALUES ('587', '17', '商品test1', '南通中远', null, '', 'test1', '', '个', '', null, '', '', '', '', '0', '63', '0');
+INSERT INTO `jsh_material` VALUES ('588', '21', '商品200', '', '112.000000', '', '300ml', '', '个', '', null, '', '', '', '', '0', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_material_category
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_material_category`;
+CREATE TABLE `jsh_material_category` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(50) DEFAULT NULL COMMENT '名称',
+ `category_level` smallint(6) DEFAULT NULL COMMENT '等级',
+ `parent_id` bigint(20) DEFAULT NULL COMMENT '上级id',
+ `sort` varchar(10) DEFAULT NULL COMMENT '显示顺序',
+ `status` varchar(1) DEFAULT '0' COMMENT '状态,0系统默认,1启用,2删除',
+ `serial_no` varchar(100) DEFAULT NULL COMMENT '编号',
+ `remark` varchar(1024) DEFAULT NULL COMMENT '备注',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `creator` bigint(20) DEFAULT NULL COMMENT '创建人',
+ `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+ `updater` bigint(20) DEFAULT NULL COMMENT '更新人',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ PRIMARY KEY (`id`),
+ KEY `FK3EE7F725237A77D8` (`parent_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COMMENT='产品类型表';
+
+-- ----------------------------
+-- Records of jsh_material_category
+-- ----------------------------
+INSERT INTO `jsh_material_category` VALUES ('17', '目录1', null, '-1', '', '1', '', '', '2019-04-10 22:18:12', '63', '2019-04-10 22:18:12', '63', '63');
+INSERT INTO `jsh_material_category` VALUES ('21', '目录2', null, '17', '', '1', '', '', '2020-07-20 23:08:44', '63', '2020-07-20 23:08:44', '63', '63');
+
+-- ----------------------------
+-- Table structure for jsh_material_current_stock
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_material_current_stock`;
+CREATE TABLE `jsh_material_current_stock` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `material_id` bigint(20) DEFAULT NULL COMMENT '产品id',
+ `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库id',
+ `current_number` decimal(24,6) DEFAULT NULL COMMENT '当前库存数量',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品当前库存';
+
+-- ----------------------------
+-- Records of jsh_material_current_stock
+-- ----------------------------
+INSERT INTO `jsh_material_current_stock` VALUES ('1', '587', '14', '-30.000000', '63', '0');
+INSERT INTO `jsh_material_current_stock` VALUES ('2', '570', '14', '48.000000', '63', '0');
+INSERT INTO `jsh_material_current_stock` VALUES ('3', '568', '14', '19.000000', '63', '0');
+INSERT INTO `jsh_material_current_stock` VALUES ('4', '569', '14', '50.000000', '63', '0');
+INSERT INTO `jsh_material_current_stock` VALUES ('5', '588', '14', '13.000000', '63', '0');
+INSERT INTO `jsh_material_current_stock` VALUES ('6', '569', '15', '122.000000', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_material_extend
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_material_extend`;
+CREATE TABLE `jsh_material_extend` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `material_id` bigint(20) DEFAULT NULL COMMENT '商品id',
+ `bar_code` varchar(50) DEFAULT NULL COMMENT '商品条码',
+ `commodity_unit` varchar(50) DEFAULT NULL COMMENT '商品单位',
+ `purchase_decimal` decimal(24,6) DEFAULT NULL COMMENT '采购价格',
+ `commodity_decimal` decimal(24,6) DEFAULT NULL COMMENT '零售价格',
+ `wholesale_decimal` decimal(24,6) DEFAULT NULL COMMENT '销售价格',
+ `low_decimal` decimal(24,6) DEFAULT NULL COMMENT '最低售价',
+ `default_flag` varchar(1) DEFAULT '1' COMMENT '是否为默认单位,1是,0否',
+ `create_time` datetime DEFAULT NULL COMMENT '创建日期',
+ `create_serial` varchar(50) DEFAULT NULL COMMENT '创建人编码',
+ `update_serial` varchar(50) DEFAULT NULL COMMENT '更新人编码',
+ `update_time` bigint(20) DEFAULT NULL COMMENT '更新时间戳',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品价格扩展';
+
+-- ----------------------------
+-- Records of jsh_material_extend
+-- ----------------------------
+INSERT INTO `jsh_material_extend` VALUES ('1', '587', '1000', '个', '11.000000', '22.000000', '22.000000', '22.000000', '1', '2020-02-20 23:22:03', 'jsh', 'jsh', '1595263657135', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('2', '568', '1001', '个', '11.000000', '15.000000', '15.000000', '15.000000', '1', '2020-02-20 23:44:57', 'jsh', 'jsh', '1595265439418', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('3', '569', '1002', '只', '10.000000', '15.000000', '15.000000', '13.000000', '1', '2020-02-20 23:45:15', 'jsh', 'jsh', '1582213514731', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('4', '570', '1003', '个', '8.000000', '15.000000', '14.000000', '13.000000', '1', '2020-02-20 23:45:37', 'jsh', 'jsh', '1587657604430', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('5', '577', '1004', '个', '10.000000', '20.000000', '20.000000', '20.000000', '1', '2020-02-20 23:46:36', 'jsh', 'jsh', '1582213596494', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('6', '577', '1005', '箱', '120.000000', '240.000000', '240.000000', '240.000000', '0', '2020-02-20 23:46:36', 'jsh', 'jsh', '1582213596497', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('7', '579', '1006', '个', '20.000000', '30.000000', '30.000000', '30.000000', '1', '2020-02-20 23:47:04', 'jsh', 'jsh', '1595264270458', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('8', '579', '1007', '箱', '240.000000', '360.000000', '360.000000', '360.000000', '0', '2020-02-20 23:47:04', 'jsh', 'jsh', '1595264270466', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('9', '586', '1008', '个', '12.000000', '15.000000', '15.000000', '15.000000', '1', '2020-02-20 23:47:23', 'jsh', 'jsh', '1595254981896', '63', '0');
+INSERT INTO `jsh_material_extend` VALUES ('10', '588', '1009', '个', '11.000000', '22.000000', '22.000000', '22.000000', '1', '2020-07-21 00:58:15', 'jsh', 'jsh', '1595264315873', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_material_initial_stock
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_material_initial_stock`;
+CREATE TABLE `jsh_material_initial_stock` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `material_id` bigint(20) DEFAULT NULL COMMENT '产品id',
+ `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库id',
+ `number` decimal(24,6) DEFAULT NULL COMMENT '初始库存数量',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品初始库存';
+
+-- ----------------------------
+-- Records of jsh_material_initial_stock
+-- ----------------------------
+INSERT INTO `jsh_material_initial_stock` VALUES ('123', '587', '14', '5.000000', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_material_property
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_material_property`;
+CREATE TABLE `jsh_material_property` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `native_name` varchar(50) DEFAULT NULL COMMENT '原始名称',
+ `enabled` bit(1) DEFAULT NULL COMMENT '是否启用',
+ `sort` varchar(10) DEFAULT NULL COMMENT '排序',
+ `another_name` varchar(50) DEFAULT NULL COMMENT '别名',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='产品扩展字段表';
+
+-- ----------------------------
+-- Records of jsh_material_property
+-- ----------------------------
+INSERT INTO `jsh_material_property` VALUES ('1', '制造商', '', '01', '制造商', '0');
+INSERT INTO `jsh_material_property` VALUES ('2', '自定义1', '', '02', '自定义1', '0');
+INSERT INTO `jsh_material_property` VALUES ('3', '自定义2', '', '03', '自定义2', '0');
+INSERT INTO `jsh_material_property` VALUES ('4', '自定义3', '', '04', '自定义3', '0');
+
+-- ----------------------------
+-- Table structure for jsh_msg
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_msg`;
+CREATE TABLE `jsh_msg` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `msg_title` varchar(100) DEFAULT NULL COMMENT '消息标题',
+ `msg_content` varchar(500) DEFAULT NULL COMMENT '消息内容',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `type` varchar(20) DEFAULT NULL COMMENT '消息类型',
+ `status` varchar(1) DEFAULT NULL COMMENT '状态,1未读 2已读',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='消息表';
+
+-- ----------------------------
+-- Records of jsh_msg
+-- ----------------------------
+INSERT INTO `jsh_msg` VALUES ('2', '标题1', '内容1', '2019-09-10 00:11:39', '类型1', '1', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_organization
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_organization`;
+CREATE TABLE `jsh_organization` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `org_no` varchar(20) DEFAULT NULL COMMENT '机构编号',
+ `org_full_name` varchar(500) DEFAULT NULL COMMENT '机构全称',
+ `org_abr` varchar(20) DEFAULT NULL COMMENT '机构简称',
+ `org_tpcd` varchar(9) DEFAULT NULL COMMENT '机构类型',
+ `org_stcd` char(1) DEFAULT NULL COMMENT '机构状态,1未营业、2正常营业、3暂停营业、4终止营业、5已除名',
+ `org_parent_no` varchar(20) DEFAULT NULL COMMENT '机构父节点编号',
+ `sort` varchar(20) DEFAULT NULL COMMENT '机构显示顺序',
+ `remark` varchar(500) DEFAULT NULL COMMENT '备注',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `creator` bigint(20) DEFAULT NULL COMMENT '创建人',
+ `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+ `updater` bigint(20) DEFAULT NULL COMMENT '更新人',
+ `org_create_time` datetime DEFAULT NULL COMMENT '机构创建时间',
+ `org_stop_time` datetime DEFAULT NULL COMMENT '机构停运时间',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='机构表';
+
+-- ----------------------------
+-- Records of jsh_organization
+-- ----------------------------
+INSERT INTO `jsh_organization` VALUES ('12', '001', '测试机构', '测试机构', null, '2', '-1', '001', '', '2019-12-28 12:13:01', '63', '2019-12-28 12:13:01', '63', null, null, '63');
+INSERT INTO `jsh_organization` VALUES ('13', 'jg1', '机构1', '机构1', null, '2', '001', '22', '', '2020-07-21 00:09:57', '63', '2020-07-21 00:10:22', '63', null, null, '63');
+INSERT INTO `jsh_organization` VALUES ('14', '12', '机构2', '机构2', null, '', 'jg1', '12', '', '2020-07-21 22:45:42', '63', '2020-07-21 22:45:51', '63', null, null, '63');
+
+-- ----------------------------
+-- Table structure for jsh_orga_user_rel
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_orga_user_rel`;
+CREATE TABLE `jsh_orga_user_rel` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `orga_id` bigint(20) NOT NULL COMMENT '机构id',
+ `user_id` bigint(20) NOT NULL COMMENT '用户id',
+ `user_blng_orga_dspl_seq` varchar(20) DEFAULT NULL COMMENT '用户在所属机构中显示顺序',
+ `delete_flag` char(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `creator` bigint(20) DEFAULT NULL COMMENT '创建人',
+ `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+ `updater` bigint(20) DEFAULT NULL COMMENT '更新人',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='机构用户关系表';
+
+-- ----------------------------
+-- Records of jsh_orga_user_rel
+-- ----------------------------
+INSERT INTO `jsh_orga_user_rel` VALUES ('10', '13', '131', '2', '0', '2019-12-28 12:13:15', '63', '2020-09-13 18:42:52', '63', '63');
+INSERT INTO `jsh_orga_user_rel` VALUES ('11', '12', '63', '', '0', '2020-09-13 18:42:45', '63', '2020-09-13 18:42:45', '63', '63');
+
+-- ----------------------------
+-- Table structure for jsh_person
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_person`;
+CREATE TABLE `jsh_person` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `type` varchar(20) DEFAULT NULL COMMENT '类型',
+ `name` varchar(50) DEFAULT NULL COMMENT '姓名',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='经手人表';
+
+-- ----------------------------
+-- Records of jsh_person
+-- ----------------------------
+INSERT INTO `jsh_person` VALUES ('14', '业务员', '小李', '63', '0');
+INSERT INTO `jsh_person` VALUES ('15', '仓管员', '小军', '63', '0');
+INSERT INTO `jsh_person` VALUES ('16', '财务员', '小夏', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_platform_config
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_platform_config`;
+CREATE TABLE `jsh_platform_config` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `platform_key` varchar(100) DEFAULT NULL COMMENT '关键词',
+ `platform_key_info` varchar(100) DEFAULT NULL COMMENT '关键词名称',
+ `platform_value` varchar(200) DEFAULT NULL COMMENT '值',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='平台参数';
+
+-- ----------------------------
+-- Records of jsh_platform_config
+-- ----------------------------
+INSERT INTO `jsh_platform_config` VALUES ('1', 'platform_name', '平台名称', '华夏ERP');
+INSERT INTO `jsh_platform_config` VALUES ('2', 'activation_code', '激活码', null);
+
+-- ----------------------------
+-- Table structure for jsh_role
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_role`;
+CREATE TABLE `jsh_role` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(50) DEFAULT NULL COMMENT '名称',
+ `type` varchar(50) DEFAULT NULL COMMENT '类型',
+ `value` varchar(200) DEFAULT NULL COMMENT '值',
+ `description` varchar(100) DEFAULT NULL COMMENT '描述',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='角色表';
+
+-- ----------------------------
+-- Records of jsh_role
+-- ----------------------------
+INSERT INTO `jsh_role` VALUES ('4', '管理员', '全部数据', null, null, null, '0');
+INSERT INTO `jsh_role` VALUES ('10', '租户', '全部数据', null, '', null, '0');
+INSERT INTO `jsh_role` VALUES ('16', '销售经理', '全部数据', null, 'ddd', '63', '0');
+INSERT INTO `jsh_role` VALUES ('17', '销售代表', '个人数据', null, 'rrr', '63', '0');
+INSERT INTO `jsh_role` VALUES ('18', '角色abc', '本机构数据', null, '33333', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_sequence
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_sequence`;
+CREATE TABLE `jsh_sequence` (
+ `seq_name` varchar(50) NOT NULL COMMENT '序列名称',
+ `min_value` bigint(20) NOT NULL COMMENT '最小值',
+ `max_value` bigint(20) NOT NULL COMMENT '最大值',
+ `current_val` bigint(20) NOT NULL COMMENT '当前值',
+ `increment_val` int(11) NOT NULL DEFAULT '1' COMMENT '增长步数',
+ `remark` varchar(500) DEFAULT NULL COMMENT '备注',
+ PRIMARY KEY (`seq_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='单据编号表';
+
+-- ----------------------------
+-- Records of jsh_sequence
+-- ----------------------------
+INSERT INTO `jsh_sequence` VALUES ('depot_number_seq', '1', '999999999999999999', '353', '1', '单据编号sequence');
+
+-- ----------------------------
+-- Table structure for jsh_serial_number
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_serial_number`;
+CREATE TABLE `jsh_serial_number` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `material_id` bigint(20) DEFAULT NULL COMMENT '产品表id',
+ `serial_number` varchar(64) DEFAULT NULL COMMENT '序列号',
+ `is_sell` varchar(1) DEFAULT '0' COMMENT '是否卖出,0未卖出,1卖出',
+ `remark` varchar(1024) DEFAULT NULL COMMENT '备注',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `creator` bigint(20) DEFAULT NULL COMMENT '创建人',
+ `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+ `updater` bigint(20) DEFAULT NULL COMMENT '更新人',
+ `depot_head_id` bigint(20) DEFAULT NULL COMMENT '单据主表id,用于跟踪序列号流向',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COMMENT='序列号表';
+
+-- ----------------------------
+-- Records of jsh_serial_number
+-- ----------------------------
+INSERT INTO `jsh_serial_number` VALUES ('105', '586', '12312323423223', '0', 'abab', '0', '2019-12-28 12:14:39', '63', '2020-07-21 00:30:32', '63', null, '63');
+INSERT INTO `jsh_serial_number` VALUES ('106', '586', '143132415952626404571', '0', '', '1', '2020-07-21 00:30:40', '63', '2020-07-21 00:30:49', '63', null, '63');
+INSERT INTO `jsh_serial_number` VALUES ('107', '586', '143132415952626404572', '0', '', '1', '2020-07-21 00:30:40', '63', '2020-07-21 00:30:47', '63', null, '63');
+INSERT INTO `jsh_serial_number` VALUES ('108', '586', '3215952626621201', '0', '', '0', '2020-07-21 00:31:02', '63', '2020-07-21 00:31:02', '63', null, '63');
+INSERT INTO `jsh_serial_number` VALUES ('109', '586', '3215952626621202', '0', '', '0', '2020-07-21 00:31:02', '63', '2020-07-21 00:31:02', '63', null, '63');
+
+-- ----------------------------
+-- Table structure for jsh_supplier
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_supplier`;
+CREATE TABLE `jsh_supplier` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `supplier` varchar(255) NOT NULL COMMENT '供应商名称',
+ `contacts` varchar(100) DEFAULT NULL COMMENT '联系人',
+ `phone_num` varchar(30) DEFAULT NULL COMMENT '联系电话',
+ `email` varchar(50) DEFAULT NULL COMMENT '电子邮箱',
+ `description` varchar(500) DEFAULT NULL COMMENT '备注',
+ `isystem` tinyint(4) DEFAULT NULL COMMENT '是否系统自带 0==系统 1==非系统',
+ `type` varchar(20) DEFAULT NULL COMMENT '类型',
+ `enabled` bit(1) DEFAULT NULL COMMENT '启用',
+ `advance_in` decimal(24,6) DEFAULT '0.000000' COMMENT '预收款',
+ `begin_need_get` decimal(24,6) DEFAULT NULL COMMENT '期初应收',
+ `begin_need_pay` decimal(24,6) DEFAULT NULL COMMENT '期初应付',
+ `all_need_get` decimal(24,6) DEFAULT NULL COMMENT '累计应收',
+ `all_need_pay` decimal(24,6) DEFAULT NULL COMMENT '累计应付',
+ `fax` varchar(30) DEFAULT NULL COMMENT '传真',
+ `telephone` varchar(30) DEFAULT NULL COMMENT '手机',
+ `address` varchar(50) DEFAULT NULL COMMENT '地址',
+ `tax_num` varchar(50) DEFAULT NULL COMMENT '纳税人识别号',
+ `bank_name` varchar(50) DEFAULT NULL COMMENT '开户行',
+ `account_number` varchar(50) DEFAULT NULL COMMENT '账号',
+ `tax_rate` decimal(24,6) DEFAULT NULL COMMENT '税率',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8 COMMENT='供应商/客户信息表';
+
+-- ----------------------------
+-- Records of jsh_supplier
+-- ----------------------------
+INSERT INTO `jsh_supplier` VALUES ('57', '供应商1', '小军', '12345678', '', '', null, '供应商', '', '0.000000', '0.000000', '0.000000', null, '0.000000', '', '', '地址1', '', '', '', '12.000000', '63', '0');
+INSERT INTO `jsh_supplier` VALUES ('58', '客户1', '小李', '12345678', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '-100.000000', null, '', '', '', '', '', '', '12.000000', '63', '0');
+INSERT INTO `jsh_supplier` VALUES ('59', '客户2', '小陈', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, '63', '0');
+INSERT INTO `jsh_supplier` VALUES ('60', '12312666', '小曹', '', '', '', null, '会员', '', '970.000000', '0.000000', '0.000000', null, null, '', '13000000000', '', '', '', '', null, '63', '0');
+INSERT INTO `jsh_supplier` VALUES ('68', '供应商3', '晓丽', '', '', '', null, '供应商', '', '0.000000', '15.000000', '0.000000', null, '-15.000000', '', '13000000000', '', '1341324', '', '', '22.000000', '63', '0');
+INSERT INTO `jsh_supplier` VALUES ('71', '客户3', '小周', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, '63', '0');
+INSERT INTO `jsh_supplier` VALUES ('74', '供应商5', '小季', '', '', '', null, '供应商', '', '0.000000', '0.000000', '0.000000', null, null, '', '', '', '', '', '', null, '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_system_config
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_system_config`;
+CREATE TABLE `jsh_system_config` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `company_name` varchar(50) DEFAULT NULL COMMENT '公司名称',
+ `company_contacts` varchar(20) DEFAULT NULL COMMENT '公司联系人',
+ `company_address` varchar(50) DEFAULT NULL COMMENT '公司地址',
+ `company_tel` varchar(20) DEFAULT NULL COMMENT '公司电话',
+ `company_fax` varchar(20) DEFAULT NULL COMMENT '公司传真',
+ `company_post_code` varchar(20) DEFAULT NULL COMMENT '公司邮编',
+ `depot_flag` varchar(1) DEFAULT '0' COMMENT '仓库启用标记,0未启用,1启用',
+ `customer_flag` varchar(1) DEFAULT '0' COMMENT '客户启用标记,0未启用,1启用',
+ `minus_stock_flag` varchar(1) DEFAULT '0' COMMENT '负库存启用标记,0未启用,1启用',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统参数';
+
+-- ----------------------------
+-- Records of jsh_system_config
+-- ----------------------------
+INSERT INTO `jsh_system_config` VALUES ('9', '公司1', '小军', '地址1', '12313', '1233', '4231', '0', '0', '1', '63', '0');
+
+-- ----------------------------
+-- Table structure for jsh_tenant
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_tenant`;
+CREATE TABLE `jsh_tenant` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '用户id',
+ `login_name` varchar(255) DEFAULT NULL COMMENT '登录名',
+ `user_num_limit` int(11) DEFAULT NULL COMMENT '用户数量限制',
+ `bills_num_limit` int(11) DEFAULT NULL COMMENT '单据数量限制',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COMMENT='租户';
+
+-- ----------------------------
+-- Records of jsh_tenant
+-- ----------------------------
+INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '20', '2000', null);
+
+-- ----------------------------
+-- Table structure for jsh_unit
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_unit`;
+CREATE TABLE `jsh_unit` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(50) DEFAULT NULL COMMENT '名称,支持多单位',
+ `basic_unit` varchar(50) DEFAULT NULL COMMENT '基础单位',
+ `other_unit` varchar(50) DEFAULT NULL COMMENT '副单位',
+ `ratio` int(11) DEFAULT NULL COMMENT '比例',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='多单位表';
+
+-- ----------------------------
+-- Records of jsh_unit
+-- ----------------------------
+INSERT INTO `jsh_unit` VALUES ('15', '个,箱(1:12)', '个', '箱', '12', '63', '0');
+INSERT INTO `jsh_unit` VALUES ('16', '个,台(1:10)', '个', '台', '10', '63', '1');
+INSERT INTO `jsh_unit` VALUES ('17', '个,只(1:12)', '个', '只', '12', '63', '1');
+
+-- ----------------------------
+-- Table structure for jsh_user
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_user`;
+CREATE TABLE `jsh_user` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `username` varchar(255) NOT NULL COMMENT '用户姓名--例如张三',
+ `login_name` varchar(255) NOT NULL COMMENT '登录用户名',
+ `password` varchar(50) DEFAULT NULL COMMENT '登陆密码',
+ `position` varchar(200) DEFAULT NULL COMMENT '职位',
+ `department` varchar(255) DEFAULT NULL COMMENT '所属部门',
+ `email` varchar(100) DEFAULT NULL COMMENT '电子邮箱',
+ `phonenum` varchar(100) DEFAULT NULL COMMENT '手机号码',
+ `ismanager` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否为管理者 0==管理者 1==员工',
+ `isystem` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否系统自带数据 ',
+ `Status` tinyint(4) DEFAULT '0' COMMENT '状态,0:正常,1:删除,2封禁',
+ `description` varchar(500) DEFAULT NULL COMMENT '用户描述信息',
+ `remark` varchar(500) DEFAULT NULL COMMENT '备注',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=utf8 COMMENT='用户表';
+
+-- ----------------------------
+-- Records of jsh_user
+-- ----------------------------
+INSERT INTO `jsh_user` VALUES ('63', '季圣华', 'jsh', 'e10adc3949ba59abbe56e057f20f883e', '', null, '', '', '1', '1', '0', '', null, '63');
+INSERT INTO `jsh_user` VALUES ('120', '管理员', 'admin', 'e10adc3949ba59abbe56e057f20f883e', null, null, null, null, '1', '0', '0', null, null, null);
+INSERT INTO `jsh_user` VALUES ('131', '测试用户', 'test123', 'e10adc3949ba59abbe56e057f20f883e', '', null, '', '', '1', '0', '0', '', null, '63');
+
+-- ----------------------------
+-- Table structure for jsh_user_business
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_user_business`;
+CREATE TABLE `jsh_user_business` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `type` varchar(50) DEFAULT NULL COMMENT '类别',
+ `key_id` varchar(50) DEFAULT NULL COMMENT '主id',
+ `value` varchar(10000) DEFAULT NULL COMMENT '值',
+ `btn_str` varchar(2000) DEFAULT NULL COMMENT '按钮权限',
+ `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COMMENT='用户/角色/模块关系表';
+
+-- ----------------------------
+-- Records of jsh_user_business
+-- ----------------------------
+INSERT INTO `jsh_user_business` VALUES ('5', 'RoleFunctions', '4', '[210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212][59][207][208][209][226][227][228][229][235][237][244][246][22][23][220][240][25][217][218][26][194][195][31][13][16][243][14][15][234][236][245]', '[{\"funId\":\"13\",\"btnStr\":\"1\"},{\"funId\":\"16\",\"btnStr\":\"1\"},{\"funId\":\"243\",\"btnStr\":\"1\"},{\"funId\":\"14\",\"btnStr\":\"1\"},{\"funId\":\"234\",\"btnStr\":\"1\"},{\"funId\":\"236\",\"btnStr\":\"1\"},{\"funId\":\"245\",\"btnStr\":\"1\"},{\"funId\":\"22\",\"btnStr\":\"1\"},{\"funId\":\"23\",\"btnStr\":\"1\"},{\"funId\":\"220\",\"btnStr\":\"1\"},{\"funId\":\"240\",\"btnStr\":\"1\"},{\"funId\":\"25\",\"btnStr\":\"1\"},{\"funId\":\"217\",\"btnStr\":\"1\"},{\"funId\":\"218\",\"btnStr\":\"1\"},{\"funId\":\"26\",\"btnStr\":\"1\"},{\"funId\":\"194\",\"btnStr\":\"1\"},{\"funId\":\"195\",\"btnStr\":\"1\"},{\"funId\":\"31\",\"btnStr\":\"1\"},{\"funId\":\"241\",\"btnStr\":\"1,2\"},{\"funId\":\"33\",\"btnStr\":\"1,2\"},{\"funId\":\"199\",\"btnStr\":\"1,2\"},{\"funId\":\"242\",\"btnStr\":\"1,2\"},{\"funId\":\"41\",\"btnStr\":\"1,2\"},{\"funId\":\"200\",\"btnStr\":\"1,2\"},{\"funId\":\"210\",\"btnStr\":\"1,2\"},{\"funId\":\"211\",\"btnStr\":\"1,2\"},{\"funId\":\"197\",\"btnStr\":\"1\"},{\"funId\":\"203\",\"btnStr\":\"1\"},{\"funId\":\"204\",\"btnStr\":\"1\"},{\"funId\":\"205\",\"btnStr\":\"1\"},{\"funId\":\"206\",\"btnStr\":\"1\"},{\"funId\":\"212\",\"btnStr\":\"1\"},{\"funId\":\"201\",\"btnStr\":\"1,2\"},{\"funId\":\"202\",\"btnStr\":\"1,2\"},{\"funId\":\"40\",\"btnStr\":\"1,2\"},{\"funId\":\"232\",\"btnStr\":\"1,2\"},{\"funId\":\"233\",\"btnStr\":\"1,2\"}]', '0');
+INSERT INTO `jsh_user_business` VALUES ('6', 'RoleFunctions', '5', '[22][23][25][26][194][195][31][33][200][201][41][199][202]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('7', 'RoleFunctions', '6', '[22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]', '[{\"funId\":\"33\",\"btnStr\":\"4\"}]', '0');
+INSERT INTO `jsh_user_business` VALUES ('9', 'RoleFunctions', '7', '[168][13][12][16][14][15][189][18][19][132]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('10', 'RoleFunctions', '8', '[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('11', 'RoleFunctions', '9', '[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187][188]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('12', 'UserRole', '1', '[5]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('13', 'UserRole', '2', '[6][7]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('14', 'UserDepot', '2', '[1][2][6][7]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('15', 'UserDepot', '1', '[1][2][5][6][7][10][12][14][15][17]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('16', 'UserRole', '63', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('18', 'UserDepot', '63', '[14][15]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('19', 'UserDepot', '5', '[6][45][46][50]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('20', 'UserRole', '5', '[5]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('21', 'UserRole', '64', '[13]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('22', 'UserDepot', '64', '[1]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('23', 'UserRole', '65', '[5]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('24', 'UserDepot', '65', '[1]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('25', 'UserCustomer', '64', '[5][2]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('26', 'UserCustomer', '65', '[6]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('27', 'UserCustomer', '63', '[58]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('28', 'UserDepot', '96', '[7]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('29', 'UserRole', '96', '[6]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('30', 'UserRole', '113', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('32', 'RoleFunctions', '10', '[210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212][59][207][208][209][226][227][228][229][235][237][244][246][22][23][220][240][25][217][218][26][194][195][31][13][243][14][15][234]', '[{\"funId\":\"13\",\"btnStr\":\"1\"},{\"funId\":\"243\",\"btnStr\":\"1\"},{\"funId\":\"14\",\"btnStr\":\"1\"},{\"funId\":\"234\",\"btnStr\":\"1\"},{\"funId\":\"22\",\"btnStr\":\"1\"},{\"funId\":\"23\",\"btnStr\":\"1\"},{\"funId\":\"220\",\"btnStr\":\"1\"},{\"funId\":\"240\",\"btnStr\":\"1\"},{\"funId\":\"25\",\"btnStr\":\"1\"},{\"funId\":\"217\",\"btnStr\":\"1\"},{\"funId\":\"218\",\"btnStr\":\"1\"},{\"funId\":\"26\",\"btnStr\":\"1\"},{\"funId\":\"194\",\"btnStr\":\"1\"},{\"funId\":\"195\",\"btnStr\":\"1\"},{\"funId\":\"31\",\"btnStr\":\"1\"},{\"funId\":\"241\",\"btnStr\":\"1,2\"},{\"funId\":\"33\",\"btnStr\":\"1,2\"},{\"funId\":\"199\",\"btnStr\":\"1,2\"},{\"funId\":\"242\",\"btnStr\":\"1,2\"},{\"funId\":\"41\",\"btnStr\":\"1,2\"},{\"funId\":\"200\",\"btnStr\":\"1,2\"},{\"funId\":\"210\",\"btnStr\":\"1,2\"},{\"funId\":\"211\",\"btnStr\":\"1,2\"},{\"funId\":\"197\",\"btnStr\":\"1\"},{\"funId\":\"203\",\"btnStr\":\"1\"},{\"funId\":\"204\",\"btnStr\":\"1\"},{\"funId\":\"205\",\"btnStr\":\"1\"},{\"funId\":\"206\",\"btnStr\":\"1\"},{\"funId\":\"212\",\"btnStr\":\"1\"},{\"funId\":\"201\",\"btnStr\":\"1,2\"},{\"funId\":\"202\",\"btnStr\":\"1,2\"},{\"funId\":\"40\",\"btnStr\":\"1,2\"},{\"funId\":\"232\",\"btnStr\":\"1,2\"},{\"funId\":\"233\",\"btnStr\":\"1,2\"}]', '0');
+INSERT INTO `jsh_user_business` VALUES ('34', 'UserRole', '115', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('35', 'UserRole', '117', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('36', 'UserDepot', '117', '[8][9]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('37', 'UserCustomer', '117', '[52]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('38', 'UserRole', '120', '[4]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('39', 'UserDepot', '120', '[7][8][9][10][11][12][2][1][3]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('40', 'UserCustomer', '120', '[52][48][6][5][2]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('41', 'RoleFunctions', '12', '', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('48', 'RoleFunctions', '13', '[59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('51', 'UserRole', '74', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('52', 'UserDepot', '121', '[13]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('54', 'UserDepot', '115', '[13]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('56', 'UserCustomer', '115', '[56]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('57', 'UserCustomer', '121', '[56]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('58', 'UserRole', '121', '[15]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('59', 'UserRole', '123', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('60', 'UserRole', '124', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('61', 'UserRole', '125', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('62', 'UserRole', '126', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('63', 'UserRole', '127', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('64', 'UserRole', '128', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('65', 'UserRole', '129', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('66', 'UserRole', '130', '[10]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('67', 'UserRole', '131', '[17]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('68', 'RoleFunctions', '16', '[210]', null, '0');
+INSERT INTO `jsh_user_business` VALUES ('69', 'RoleFunctions', '17', '[210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]', '[{\"funId\":\"241\",\"btnStr\":\"1,2\"},{\"funId\":\"33\",\"btnStr\":\"1,2\"},{\"funId\":\"199\",\"btnStr\":\"1,2\"},{\"funId\":\"242\",\"btnStr\":\"1,2\"},{\"funId\":\"41\",\"btnStr\":\"1,2\"},{\"funId\":\"200\",\"btnStr\":\"1,2\"},{\"funId\":\"210\",\"btnStr\":\"1,2\"},{\"funId\":\"211\",\"btnStr\":\"1,2\"},{\"funId\":\"197\",\"btnStr\":\"1\"},{\"funId\":\"203\",\"btnStr\":\"1\"},{\"funId\":\"204\",\"btnStr\":\"1\"},{\"funId\":\"205\",\"btnStr\":\"1\"},{\"funId\":\"206\",\"btnStr\":\"1\"},{\"funId\":\"212\",\"btnStr\":\"1\"},{\"funId\":\"201\",\"btnStr\":\"1,2\"},{\"funId\":\"202\",\"btnStr\":\"1,2\"},{\"funId\":\"40\",\"btnStr\":\"1,2\"},{\"funId\":\"232\",\"btnStr\":\"1,2\"},{\"funId\":\"233\",\"btnStr\":\"1,2\"}]', '0');
diff --git a/jshERP-boot/docs/华夏ERP数据库设计汇总.xlsx b/jshERP-boot/docs/华夏ERP数据库设计汇总.xlsx
new file mode 100644
index 000000000..68bafb845
Binary files /dev/null and b/jshERP-boot/docs/华夏ERP数据库设计汇总.xlsx differ
diff --git a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt
new file mode 100644
index 000000000..a6cc80593
--- /dev/null
+++ b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt
@@ -0,0 +1,1072 @@
+---------------------------------------------------------------------------------------------------
+****注意第一次初始化数据库不需要执行下面的内容,该文档会随着代码更新持续更新,方便大家手动升级数据库****
+****注意第一次初始化数据库不需要执行下面的内容,该文档会随着代码更新持续更新,方便大家手动升级数据库****
+****注意第一次初始化数据库不需要执行下面的内容,该文档会随着代码更新持续更新,方便大家手动升级数据库****
+---------------------------------------------------------------------------------------------------
+
+
+-- ----------------------------
+-- 时间:2019年1月21日
+-- version:1.0.0
+-- 此次更新添加序列号功能
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+
+-- ----------------------------
+-- 添加序列号表
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_serial_number`;
+CREATE TABLE `jsh_serial_number` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `material_Id` bigint(20) DEFAULT NULL COMMENT '产品表id',
+ `serial_Number` varchar(64) DEFAULT NULL COMMENT '序列号',
+ `is_Sell` bit(1) DEFAULT 0 COMMENT '是否卖出,0未卖出,1卖出',
+ `remark` varchar(1024) DEFAULT NULL COMMENT '备注',
+ `delete_Flag` bit(1) DEFAULT 0 COMMENT '删除标记,0未删除,1删除',
+ `create_Time` datetime DEFAULT NULL COMMENT '创建时间',
+ `creator` bigint(20) DEFAULT NULL COMMENT '创建人',
+ `update_Time` datetime DEFAULT NULL COMMENT '更新时间',
+ `updater` bigint(20) DEFAULT NULL COMMENT '更新人',
+ PRIMARY KEY (`Id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='序列号表';
+
+-- ----------------------------
+-- 产品表新增字段是否启用序列号
+-- ----------------------------
+alter table jsh_material add enableSerialNumber bit(1) DEFAULT 0 COMMENT '是否开启序列号,0否,1是';
+-- ----------------------------
+-- 时间:2019年1月24日
+-- version:1.0.1
+-- 此次更新添加序列号菜单
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+-- ----------------------------
+-- 添加序列号菜单
+-- ----------------------------
+delete from `jsh_functions` where Name='序列号';
+INSERT INTO `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`) VALUES ('010104', '序列号', '0101', '../manage/serialNumber.html', b'0', '0246', b'1', '电脑版', '');
+-- ----------------------------
+-- 删除单据主表供应商id字段对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_3;
+-- ----------------------------
+-- 序列号表添加单据主表id字段,用于跟踪序列号流向
+-- ----------------------------
+alter table jsh_serial_number add depothead_Id bigint(20) DEFAULT null COMMENT '单据主表id,用于跟踪序列号流向';
+-- ----------------------------
+-- 修改商品表enableSerialNumber字段类型为varchar(1)
+-- ----------------------------
+alter table jsh_material change enableSerialNumber enableSerialNumber varchar(1) DEFAULT '0' COMMENT '是否开启序列号,0否,1是';
+-- ----------------------------
+-- 修改序列号表is_Sell字段类型为varchar(1)
+-- 修改序列号表delete_Flag字段类型为varchar(1)
+-- ----------------------------
+alter table jsh_serial_number change is_Sell is_Sell varchar(1) DEFAULT '0' COMMENT '是否卖出,0未卖出,1卖出';
+alter table jsh_serial_number change delete_Flag delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- ----------------------------
+-- 删除单据子表单据主表id字段对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_depot_item DROP FOREIGN KEY jsh_depot_item_ibfk_1;
+-- ----------------------------
+-- 时间:2019年2月1日
+-- version:1.0.2
+-- 此次更新添加sequence表,用于获取一个唯一的数值
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+-- ----------------------------
+-- 添加表tbl_sequence
+-- ----------------------------
+DROP TABLE IF EXISTS `tbl_sequence`;
+CREATE TABLE tbl_sequence (
+ seq_name VARCHAR(50) NOT NULL COMMENT '序列名称',
+ min_value bigint(20) NOT NULL COMMENT '最小值',
+ max_value bigint(20) NOT NULL COMMENT '最大值',
+ current_val bigint(20) NOT NULL COMMENT '当前值',
+ increment_val INT DEFAULT '1' NOT NULL COMMENT '增长步数',
+ remark VARCHAR(500) DEFAULT null COMMENT '备注',
+ PRIMARY KEY (seq_name)
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='sequence表';
+
+-- ----------------------------
+-- 添加表单据编号sequence
+-- 插入数据前判断,防止数据重复插入
+-- ----------------------------
+insert into tbl_sequence (seq_name, min_value, max_value, current_val, increment_val,remark)
+select 'depot_number_seq', 1, 999999999999999999, 1, 1,'单据编号sequence' from dual where not exists
+(select * from tbl_sequence where seq_name='depot_number_seq');
+-- ----------------------------
+-- 创建function _nextval() 用于获取当前序列号
+-- ----------------------------
+DROP FUNCTION IF EXISTS `_nextval`;
+DELIMITER ;;
+CREATE FUNCTION `_nextval`(name varchar(50)) RETURNS mediumtext CHARSET utf8
+begin
+declare _cur bigint;
+declare _maxvalue bigint; -- 接收最大值
+declare _increment int; -- 接收增长步数
+set _increment = (select increment_val from tbl_sequence where seq_name = name);
+set _maxvalue = (select max_value from tbl_sequence where seq_name = name);
+set _cur = (select current_val from tbl_sequence where seq_name = name for update);
+update tbl_sequence -- 更新当前值
+ set current_val = _cur + increment_val
+ where seq_name = name ;
+if(_cur + _increment >= _maxvalue) then -- 判断是都达到最大值
+ update tbl_sequence
+ set current_val = minvalue
+ where seq_name = name ;
+end if;
+return _cur;
+end
+;;
+DELIMITER ;
+
+-- ----------------------------
+-- 时间:2019年2月18日
+-- version:1.0.3
+-- 此次更新修改产品类型表jsh_materialcategory,添加一些字段
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+-- ----------------------------
+-- 产品类型表添加字段sort,显示顺序
+-- ----------------------------
+alter table jsh_materialcategory add sort varchar(10) DEFAULT null COMMENT '显示顺序';
+-- ----------------------------
+-- 产品类型表添加字段status,状态,0系统默认,1启用,2删除
+-- ----------------------------
+alter table jsh_materialcategory add status varchar(1) DEFAULT '0' COMMENT '状态,0系统默认,1启用,2删除';
+-- ----------------------------
+-- 产品类型表添加字段serial_no,编号
+-- ----------------------------
+alter table jsh_materialcategory add serial_no varchar(100) DEFAULT null COMMENT '编号';
+-- ----------------------------
+-- 产品类型表添加字段remark,备注
+-- ----------------------------
+alter table jsh_materialcategory add remark varchar(1024) DEFAULT null COMMENT '备注';
+-- ----------------------------
+-- 产品类型表添加字段create_time,创建时间
+-- ----------------------------
+alter table jsh_materialcategory add create_time datetime DEFAULT null COMMENT '创建时间';
+-- ----------------------------
+-- 产品类型表添加字段creator,创建人
+-- ----------------------------
+alter table jsh_materialcategory add creator bigint(20) DEFAULT null COMMENT '创建人';
+-- ----------------------------
+-- 产品类型表添加字段update_time,更新时间
+-- ----------------------------
+alter table jsh_materialcategory add update_time datetime DEFAULT null COMMENT '更新时间';
+-- ----------------------------
+-- 产品类型表添加字段updater,更新人
+-- ----------------------------
+alter table jsh_materialcategory add updater bigint(20) DEFAULT null COMMENT '更新人';
+
+-- ----------------------------
+-- 去掉jsh_materialcategory外键
+-- ----------------------------
+ALTER TABLE jsh_materialcategory DROP FOREIGN KEY FK3EE7F725237A77D8;
+
+-- ----------------------------
+-- 修改根目录父节点id为-1
+-- 设置根目录编号为1
+-- ----------------------------
+update jsh_materialcategory set ParentId='-1' where id='1';
+
+-- ----------------------------
+-- 删除礼品卡管理、礼品充值、礼品销售、礼品卡统计的功能数据
+-- ----------------------------
+delete from jsh_functions where id in (213,214,215,216);
+
+-- ----------------------------
+-- 新增采购订单、销售订单的功能数据
+-- 主键自增长,直接指定主键插入数据的方式可能会和本地数据冲突
+-- 插入数据前判断,防止数据重复插入
+-- ----------------------------
+insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`)
+select '050202', '采购订单', '0502', '../materials/purchase_orders_list.html', b'0', '0335',b'1', '电脑版', '' from dual where not exists
+(select * from jsh_functions where Number='050202' and PNumber='0502');
+insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`)
+select '060301', '销售订单', '0603', '../materials/sale_orders_list.html', b'0', '0392', b'1', '电脑版', '' from dual where not exists
+(select * from jsh_functions where Number='060301' and PNumber='0603');
+
+-- ----------------------------
+-- 改管理员的功能权限
+-- ----------------------------
+update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4',
+Value = '[13][12][16][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][242][33][199][243][41][200][201][202][40][232][233][197][203][204][205][206][212]'
+where Id = 5;
+
+-- ----------------------------
+-- 时间:2019年2月25日
+-- version:1.0.4
+-- 此次更新仓库添加负责人信息,负责人信息从用户表获取
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+-- ----------------------------
+-- 仓库表添加字段principal,负责人
+-- ----------------------------
+alter table jsh_depot add principal bigint(20) DEFAULT null COMMENT '负责人';
+
+-- ----------------------------
+-- 时间:2019年3月6日
+-- version:1.0.5
+-- 此次更新
+-- 1、添加机构表
+-- 2、添加机构用户关系表
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+-- ----------------------------
+-- 添加机构表
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_organization`;
+CREATE TABLE `jsh_organization` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `org_no` varchar(20) DEFAULT NULL COMMENT '机构编号',
+ `org_full_name` varchar(500) DEFAULT NULL COMMENT '机构全称',
+ `org_abr` varchar(20) DEFAULT NULL COMMENT '机构简称',
+ `org_tpcd` varchar(9) DEFAULT NULL COMMENT '机构类型',
+ `org_stcd` char(1) DEFAULT NULL COMMENT '机构状态,1未营业、2正常营业、3暂停营业、4终止营业、5已除名',
+ `org_parent_no` varchar(20) DEFAULT NULL COMMENT '机构父节点编号',
+ `sort` varchar(20) DEFAULT NULL COMMENT '机构显示顺序',
+ remark VARCHAR(500) DEFAULT null COMMENT '备注',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `creator` bigint(20) DEFAULT NULL COMMENT '创建人',
+ `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+ `updater` bigint(20) DEFAULT NULL COMMENT '更新人',
+ `org_create_time` datetime DEFAULT NULL COMMENT '机构创建时间',
+ `org_stop_time` datetime DEFAULT NULL COMMENT '机构停运时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='机构表';
+-- ----------------------------
+-- 添加机构用户关系表
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_orga_user_rel`;
+CREATE TABLE `jsh_orga_user_rel` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `orga_id` bigint(20) NOT NULL COMMENT '机构id',
+ `user_id` bigint(20) NOT NULL COMMENT '用户id',
+ `user_blng_orga_dspl_seq` varchar(20) DEFAULT NULL COMMENT '用户在所属机构中显示顺序',
+ `delete_flag` char(1) DEFAULT 0 COMMENT '删除标记,0未删除,1删除',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ `creator` bigint(20) DEFAULT NULL COMMENT '创建人',
+ `update_time` datetime DEFAULT NULL COMMENT '更新时间',
+ `updater` bigint(20) DEFAULT NULL COMMENT '更新人',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='机构用户关系表';
+-- ----------------------------
+-- 添加机构管理菜单
+-- 插入数据前判断,防止数据重复插入
+-- ----------------------------
+INSERT INTO `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`)
+select '000108', '机构管理', '0001', '../manage/organization.html', b'1', '0139', b'1', '电脑版', '' from dual where not exists
+(select * from jsh_functions where Number='000108' and PNumber='0001');
+-- ----------------------------
+-- 添加根机构
+-- 插入时判断对应数据是否存在,防止多次执行产生重复数据
+-- ----------------------------
+INSERT INTO jsh_organization (org_no, org_full_name, org_abr, org_tpcd, org_stcd, org_parent_no, sort, remark, create_time, creator, update_time, updater, org_create_time, org_stop_time)
+select '01', '根机构', '根机构', NULL, '2', '-1', '1', '根机构,初始化存在', NULL, NULL, NULL, NULL, NULL, NULL from dual where not exists
+(select * from jsh_organization where org_no='01' and org_abr='根机构' and org_parent_no='-1' );
+-- ----------------------------
+-- 时间:2019年3月9日
+-- version:1.0.6
+-- 此次更新
+-- 整改jsh_systemconfig表的字段
+-- ----------------------------
+alter table jsh_systemconfig drop type;
+alter table jsh_systemconfig drop name;
+alter table jsh_systemconfig drop value;
+alter table jsh_systemconfig drop description;
+alter table jsh_systemconfig add company_name varchar(50) DEFAULT null COMMENT '公司名称';
+alter table jsh_systemconfig add company_contacts varchar(20) DEFAULT null COMMENT '公司联系人';
+alter table jsh_systemconfig add company_address varchar(50) DEFAULT null COMMENT '公司地址';
+alter table jsh_systemconfig add company_tel varchar(20) DEFAULT null COMMENT '公司电话';
+alter table jsh_systemconfig add company_fax varchar(20) DEFAULT null COMMENT '公司传真';
+alter table jsh_systemconfig add company_post_code varchar(20) DEFAULT null COMMENT '公司邮编';
+delete from jsh_systemconfig;
+insert into jsh_systemconfig (`company_name`, `company_contacts`, `company_address`, `company_tel`, `company_fax`, `company_post_code`) values("南通jshERP公司","张三","南通市通州区某某路","0513-10101010","0513-18181818","226300");
+
+-- ----------------------------
+-- 时间:2019年3月9日
+-- version:1.0.7
+-- 改管理员的功能权限
+-- ----------------------------
+update jsh_userbusiness SET
+Value = '[13][12][16][243][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]'
+where Id = 5;
+-- ----------------------------
+-- 给订单功能加审核和反审核的功能按钮权限
+-- ----------------------------
+update jsh_functions SET PushBtn = '3' where Number = '050202' and PNumber = '0502';
+update jsh_functions SET PushBtn = '3' where Number = '060301' and PNumber = '0603';
+-- ----------------------------
+-- 改管理员的按钮权限
+-- ----------------------------
+update jsh_userbusiness SET
+BtnStr = '[{"funId":"25","btnStr":"1"},{"funId":"217","btnStr":"1"},{"funId":"218","btnStr":"1"},{"funId":"241","btnStr":"3"},{"funId":"242","btnStr":"3"}]'
+where Id = 5;
+
+-- ----------------------------
+-- 时间:2019年3月10日
+-- version:1.0.8
+-- 改状态字段的类型,增加关联单据字段
+-- ----------------------------
+alter table jsh_depot_head change Status Status varchar(1) DEFAULT '0' COMMENT '状态,0未审核、1已审核、2已转采购|销售';
+alter table jsh_depot_head add `LinkNumber` varchar(50) DEFAULT null COMMENT '关联订单号';
+-- ----------------------------
+-- 时间:2019年3月12日
+-- version:1.0.9
+-- 此次更新
+-- 1、根据本地用户表中现有部门生成机构表数据,同时重建机构和用户的关联关系
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+DROP FUNCTION IF EXISTS `_buildOrgAndOrgUserRel`;
+DELIMITER ;;
+CREATE FUNCTION `_buildOrgAndOrgUserRel` (name varchar(50)) RETURNS mediumtext CHARSET utf8
+begin
+
+declare _org_full_name varchar(500); -- 机构全称
+declare _org_abr varchar(20); -- 机构简称
+declare _sort int default 0;
+declare _success_msg varchar(50) default '重建机构及机构用户关系成功'; -- 机构全称
+ -- 遍历数据结束标志
+declare done int DEFAULT 0;
+-- 获取用户表中唯一的部门信息列表
+declare orgCur cursor for select distinct department from jsh_user where department!='' and department is not null;
+
+ -- 将结束标志绑定到游标
+declare continue handler for not found set done = 1;
+ -- 循环部门信息列表在机构表插入数据
+ -- 打开游标
+ open orgCur;
+ -- 开始循环
+ read_loop: loop
+ -- 提取游标里的数据,这里只有一个,多个的话也一样;
+ fetch orgCur into _org_full_name;
+ -- 声明结束的时候
+ if done=1 then
+ leave read_loop;
+ end if;
+ -- 这里做你想做的循环的事件
+ if length(_org_full_name)<=20 then
+ set _org_abr=_org_full_name;
+ else
+ set _org_abr=left(_org_full_name,20);
+ end if;
+ set _sort=_sort+1;
+ insert into jsh_organization (org_full_name, org_abr, org_stcd, org_parent_no, sort, remark)
+ values (_org_full_name,_org_abr, '1', '01', _sort, '机构表初始化');
+ begin
+ declare _userId bigint;
+ declare _orgId bigint;
+ -- 遍历数据结束标志
+ declare ogrUserRelDone int DEFAULT 0;
+ -- 根据用户表和机构表部门关联关系,重建用户和机构关联关系
+ declare ogrUserRelCur cursor for select user.id as userId,org.id as orgId from jsh_user user,jsh_organization org
+ where 1=1 and user.department=org.org_full_name and user.department =_org_full_name;
+ -- 将结束标志绑定到游标
+ declare continue handler for not found set ogrUserRelDone = 1;
+ -- 打开游标
+ open ogrUserRelCur;
+ -- 开始循环
+ rel_read_loop: loop
+ -- 提取游标里的数据,这里只有一个,多个的话也一样;
+ fetch ogrUserRelCur into _userId,_orgId;
+ -- 声明结束的时候
+ if ogrUserRelDone=1 then
+ leave rel_read_loop;
+ end if;
+ insert into `jsh_orga_user_rel`(`orga_id`, `user_id`, `delete_flag`) VALUES (_orgId,_userId,'0');
+
+ end loop rel_read_loop;
+ -- 关闭游标
+ close ogrUserRelCur;
+ end;
+
+ end loop read_loop;
+ -- 关闭游标
+ close orgCur;
+
+-- 清空用户表中的部门信息
+update jsh_user set department=null;
+
+return _success_msg;
+end
+;;
+DELIMITER ;
+-- ----------------------------
+-- 初始化机构数据,重建机构用户关系
+-- ----------------------------
+select _buildOrgAndOrgUserRel('初始化机构数据,重建机构用户关系') from dual;
+-- ----------------------------
+-- 删除一次性函数
+-- ----------------------------
+DROP FUNCTION _buildOrgAndOrgUserRel;
+
+-- ----------------------------
+-- 时间:2019年3月13日
+-- version:1.0.10
+-- 此次更新
+-- 1、设置用户表的用户状态status默认值为0
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+
+alter table jsh_user change Status Status tinyint(4) DEFAULT '0' COMMENT '状态,0:正常,1:删除,2封禁';
+update jsh_user set status='0' where status is null;
+-- ----------------------------
+-- 设置根目录编号为1
+-- ----------------------------
+update jsh_materialcategory set serial_no='1' where id='1';
+
+-- ----------------------------
+-- 时间:2019年3月18日
+-- version:1.0.11
+-- 此次更新
+-- 1、批量增加大部分表的tenant_id租户字段
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+alter table jsh_account add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_accounthead add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_accountitem add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_asset add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_assetcategory add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_assetname add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_depot add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_depot_head add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_depot_item add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_inoutitem add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_log add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_material add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_materialcategory add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_orga_user_rel add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_organization add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_person add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_role add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_serial_number add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_supplier add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_systemconfig add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_unit add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+alter table jsh_user add tenant_id bigint(20) DEFAULT null COMMENT '租户id';
+
+-- ----------------------------
+-- 时间:2019年3月27日
+-- version:1.0.12
+-- 此次更新
+-- 添加删除标记,将物理删除修改为逻辑删除
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+-- 角色表 jsh_role
+alter table jsh_role add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 用户 角色 模块关系表 jsh_userbusiness
+alter table jsh_userbusiness add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 功能模块表 jsh_functions
+alter table jsh_functions add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 应用表 jsh_app
+alter table jsh_app add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 产品表 jsh_material
+alter table jsh_material add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 产品扩展字段表 jsh_materialproperty
+alter table jsh_materialproperty add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 经手人表 jsh_person
+alter table jsh_person add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 供应商 客户信息表 jsh_supplier
+alter table jsh_supplier add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 系统参数表 jsh_systemconfig
+alter table jsh_systemconfig add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 多单位表 jsh_unit
+alter table jsh_unit add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 仓库表 jsh_depot
+alter table jsh_depot add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 账户信息表 jsh_account
+alter table jsh_account add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 财务主表 jsh_accounthead
+alter table jsh_accounthead add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 财务子表 jsh_accountitem
+alter table jsh_accountitem add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 资产记录表 jsh_asset
+alter table jsh_asset add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 资产类型表 jsh_assetcategory
+alter table jsh_assetcategory add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 资产信息表 jsh_assetname
+alter table jsh_assetname add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 单据主表 jsh_depot_head
+alter table jsh_depot_head add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 单据子表 jsh_depot_item
+alter table jsh_depot_item add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+-- 收支项目表 jsh_inoutitem
+alter table jsh_inoutitem add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+-- ----------------------------
+-- 时间:2019年4月11日
+-- version:1.0.13
+-- 此次更新
+-- 删除所有外键
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+
+-- ----------------------------
+-- 删除财务主表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_accounthead DROP FOREIGN KEY FK9F4C0D8DAAE50527;
+ALTER TABLE jsh_accounthead DROP FOREIGN KEY FK9F4C0D8DB610FC06;
+ALTER TABLE jsh_accounthead DROP FOREIGN KEY FK9F4C0D8DC4170B37;
+-- ----------------------------
+-- 删除财务子表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_accountitem DROP FOREIGN KEY FK9F4CBAC0AAE50527;
+ALTER TABLE jsh_accountitem DROP FOREIGN KEY FK9F4CBAC0C5FE6007;
+ALTER TABLE jsh_accountitem DROP FOREIGN KEY FK9F4CBAC0D203EDC5;
+-- ----------------------------
+-- 删除资产记录表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED27D23FE4;
+ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED3E226853;
+ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED61FE182C;
+ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED9B6CB285;
+ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690EDAD45B659;
+-- ----------------------------
+-- 删除资产信息表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_assetname DROP FOREIGN KEY FKA4ADCCF866BC8AD3;
+-- ----------------------------
+-- 删除单据主表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_depot_head DROP FOREIGN KEY FK2A80F214AAE50527;
+ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_1;
+ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_4;
+ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_5;
+-- ----------------------------
+-- 删除单据子表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_depot_item DROP FOREIGN KEY FK2A819F47729F5392;
+ALTER TABLE jsh_depot_item DROP FOREIGN KEY FK2A819F479485B3F5;
+ALTER TABLE jsh_depot_item DROP FOREIGN KEY jsh_depot_item_ibfk_2;
+-- ----------------------------
+-- 删除操作日志表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_log DROP FOREIGN KEY FKF2696AA13E226853;
+-- ----------------------------
+-- 删除产品表对应外键约束
+-- ----------------------------
+ALTER TABLE jsh_material DROP FOREIGN KEY FK675951272AB6672C;
+ALTER TABLE jsh_material DROP FOREIGN KEY jsh_material_ibfk_1;
+
+-- ----------------------------
+-- 时间:2019年4月30日
+-- version:1.0.14
+-- 此次更新
+-- 增加仓库默认功能 增加库存预警功能
+-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
+-- ----------------------------
+alter table jsh_depot add is_default bit(1) DEFAULT NULL COMMENT '是否默认';
+insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`)
+select '030112', '库存预警', '0301', '../reports/stock_warning_report.html', b'0', '0670', b'1', '电脑版', '' from dual where not exists
+(select * from jsh_functions where Number='030112' and PNumber='0301');
+
+-- ----------------------------
+-- 改管理员的功能权限
+-- ----------------------------
+update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4',
+Value = '[13][12][16][243][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][244][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]'
+where Id = 5;
+
+-- ----------------------------
+-- 给app的功能增加代号 在功能表增加个人信息
+-- ----------------------------
+update jsh_app SET Number = '02' where name='个人信息';
+insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`)
+select '02', '个人信息', '0', '', b'1', '0005', b'1', '电脑版', '' from dual where not exists
+(select * from jsh_functions where Number='02' and PNumber='0');
+
+-- ----------------------------
+-- 时间:2019年6月23日
+-- 增加新手引导模块
+-- ----------------------------
+INSERT INTO `jsh_app` VALUES ('28', '09', '新手引导', 'app', 'userHelp.png', '../user/userHelp.html', '1000', '500', '\0', '\0', '\0', 'dock', '210', '', '', '0');
+INSERT INTO `jsh_functions` VALUES ('246', '09', '新手引导', '0', '', '', '0115', '', '电脑版', '', '0');
+update jsh_userbusiness SET Value = '[3][6][7][22][23][24][25][26][27][28]'
+where Type = 'RoleAPP' and (KeyId = '4' or KeyId = '10');
+update jsh_userbusiness SET
+Value = '[245][13][12][16][243][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][244][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212][246]'
+where Type = 'RoleFunctions' and KeyId = '4';
+update jsh_userbusiness SET
+Value = '[245][13][243][14][15][234][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][244][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212][246]'
+where Type = 'RoleFunctions' and KeyId = '10';
+
+
+-- ----------------------------
+-- 时间:2019年6月26日
+-- 删除多余的资产相关表
+-- ----------------------------
+drop table jsh_asset;
+drop table jsh_assetcategory;
+drop table jsh_assetname;
+
+
+-- ----------------------------
+-- 时间:2019年6月27日
+-- 增加租户表
+-- ----------------------------
+DROP TABLE IF EXISTS `jsh_tenant`;
+CREATE TABLE `jsh_tenant` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `tenant_id` bigint(20) DEFAULT NULL COMMENT '用户id',
+ `login_name` varchar(255) DEFAULT NULL COMMENT '登录名',
+ `user_num_limit` int(11) DEFAULT NULL COMMENT '用户数量限制',
+ `bills_num_limit` int(11) DEFAULT NULL COMMENT '单据数量限制',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8 COMMENT='租户';
+
+-- ----------------------------
+-- 时间:2019年6月27日
+-- 给租户表增加数据
+-- ----------------------------
+INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '20', '2000', null);
+
+-- ----------------------------
+-- 时间:2019年7月10日
+-- 删除函数
+-- ----------------------------
+DROP FUNCTION IF EXISTS `_nextval`;
+
+-- ----------------------------
+-- 时间:2019年8月1日
+-- 增加仓库和客户的启用标记
+-- ----------------------------
+alter table jsh_systemconfig add customer_flag varchar(1) DEFAULT '0' COMMENT '客户启用标记,0未启用,1启用' after company_post_code;
+alter table jsh_systemconfig add depot_flag varchar(1) DEFAULT '0' COMMENT '仓库启用标记,0未启用,1启用' after company_post_code;
+
+-- ----------------------------
+-- 时间:2019年9月13日
+-- 给功能表增加icon字段
+-- ----------------------------
+alter table jsh_functions add icon varchar(50) DEFAULT NULL COMMENT '图标' after PushBtn;
+
+-- ----------------------------
+-- 时间:2019年9月13日
+-- 创建消息表
+-- ----------------------------
+CREATE TABLE `jsh_msg` (
+`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
+`msg_title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息标题' ,
+`msg_content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息内容' ,
+`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间' ,
+`type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息类型' ,
+`status` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态,1未读 2已读' ,
+`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' ,
+`delete_Flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' ,
+PRIMARY KEY (`id`)
+)
+ENGINE=InnoDB
+DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
+COMMENT='消息表'
+AUTO_INCREMENT=2
+ROW_FORMAT=COMPACT
+;
+
+-- ----------------------------
+-- 时间:2019年9月13日
+-- 删除表 jsh_app databasechangelog databasechangeloglock
+-- ----------------------------
+drop table databasechangelog;
+drop table databasechangeloglock;
+drop table jsh_app;
+
+-- ----------------------------
+-- 时间:2019年11月28日
+-- 单据编号表-改表名
+-- ----------------------------
+ALTER TABLE tbl_sequence RENAME TO jsh_sequence;
+
+-- ----------------------------
+-- 增加产品初始库存表
+-- 时间 2019-11-28
+-- by jishenghua
+-- ----------------------------
+CREATE TABLE `jsh_material_stock` (
+`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
+`material_id` bigint(20) NULL DEFAULT NULL COMMENT '产品id' ,
+`depot_id` bigint(20) NULL DEFAULT NULL COMMENT '仓库id' ,
+`number` decimal(24,6) NULL DEFAULT NULL COMMENT '初始库存数量' ,
+`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' ,
+`delete_fag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' ,
+PRIMARY KEY (`id`)
+)
+ENGINE=InnoDB
+DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
+COMMENT='产品初始库存'
+AUTO_INCREMENT=48
+ROW_FORMAT=COMPACT
+;
+
+-- ----------------------------
+-- 增加商品扩展信息表
+-- 时间 2020-02-15
+-- by jishenghua
+-- ----------------------------
+CREATE TABLE `jsh_material_extend` (
+`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
+`material_id` bigint(20) NULL DEFAULT NULL COMMENT '商品id' ,
+`bar_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品条码' ,
+`commodity_unit` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品单位' ,
+`purchase_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '采购价格' ,
+`commodity_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '零售价格' ,
+`wholesale_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '销售价格' ,
+`low_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '最低售价' ,
+`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期' ,
+`create_serial` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人编码' ,
+`update_serial` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人编码' ,
+`update_time` bigint(20) NULL DEFAULT NULL COMMENT '更新时间戳' ,
+`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' ,
+`delete_Flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' ,
+PRIMARY KEY (`id`)
+)
+ENGINE=InnoDB
+DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
+COMMENT='产品价格扩展'
+AUTO_INCREMENT=1
+ROW_FORMAT=COMPACT
+;
+
+-- ----------------------------
+-- 给单据明细表增加商品扩展id
+-- 时间 2020-02-16
+-- by jishenghua
+-- ----------------------------
+alter table jsh_depot_item add material_extend_id bigint(20) DEFAULT NULL COMMENT '商品扩展id' after MaterialId;
+
+-- ----------------------------
+-- 给单据主表删除字段ProjectId 和 AllocationProjectId
+-- 时间 2020-02-18
+-- by jishenghua
+-- ----------------------------
+alter table jsh_depot_head drop column ProjectId;
+alter table jsh_depot_head drop column AllocationProjectId;
+
+-- ----------------------------
+-- 给计量单位表增加基础单位、副单位、比例三个字段
+-- 时间 2020-03-24
+-- by jishenghua
+-- ----------------------------
+alter table jsh_unit add basic_unit varchar(50) DEFAULT NULL COMMENT '基础单位' after UName;
+alter table jsh_unit add other_unit varchar(50) DEFAULT NULL COMMENT '副单位' after basic_unit;
+alter table jsh_unit add ratio INT DEFAULT NULL COMMENT '比例' after other_unit;
+
+-- ----------------------------
+-- 时间:2020年03月31日
+-- by jishenghua
+-- 给用户表增加 登录用户名 字段
+-- ----------------------------
+alter table jsh_user change loginame login_name varchar(255) NOT NULL COMMENT '登录用户名';
+
+-- ----------------------------
+-- 时间:2020年04月12日
+-- by jishenghua
+-- 给功能表增加插件管理
+-- ----------------------------
+INSERT INTO `jsh_functions` VALUES (245,'000107', '插件管理', '0001', '/pages/manage/plugin.html', '\0', '0170', '', '电脑版', '', 'icon-notebook', '0');
+
+-- ----------------------------
+-- 时间:2020年04月25日
+-- by jishenghua
+-- 给商品扩展表增加 是否默认基础单位 字段
+-- ----------------------------
+alter table jsh_material_extend add default_flag VARCHAR(1) DEFAULT 1 COMMENT '是否为默认单位,1是,0否' after low_decimal;
+
+-- ----------------------------
+-- 时间:2020年05月04日
+-- by jishenghua
+-- 删除商品表的多价格相关的字段
+-- ----------------------------
+alter table jsh_material drop Packing;
+alter table jsh_material drop RetailPrice;
+alter table jsh_material drop LowPrice;
+alter table jsh_material drop PresetPriceOne;
+alter table jsh_material drop PresetPriceTwo;
+alter table jsh_material drop FirstOutUnit;
+alter table jsh_material drop FirstInUnit;
+alter table jsh_material drop PriceStrategy;
+
+-- ----------------------------
+-- 时间:2020年6月18日
+-- 增加负库存的启用标记
+-- ----------------------------
+alter table jsh_systemconfig add minus_stock_flag varchar(1) DEFAULT '0' COMMENT '负库存启用标记,0未启用,1启用' after customer_flag;
+
+-- ----------------------------
+-- 时间 2020年07月13日
+-- by jishenghua
+-- 增加产品当前库存表
+-- ----------------------------
+CREATE TABLE `jsh_material_current_stock` (
+`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' ,
+`material_id` bigint(20) NULL DEFAULT NULL COMMENT '产品id' ,
+`depot_id` bigint(20) NULL DEFAULT NULL COMMENT '仓库id' ,
+`current_number` decimal(24,6) NULL DEFAULT NULL COMMENT '当前库存数量' ,
+`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' ,
+`delete_flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' ,
+PRIMARY KEY (`id`)
+)
+ENGINE=InnoDB
+DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
+COMMENT='产品当前库存'
+AUTO_INCREMENT=1
+ROW_FORMAT=COMPACT
+;
+
+-- --------------------------------------------------------
+-- 时间 2020年07月13日
+-- by jishenghua
+-- 修改jsh_material_stock的表名为jsh_material_initial_stock
+-- 修改jsh_material_initial_stock表的删除字段
+-- --------------------------------------------------------
+alter table jsh_material_stock rename to jsh_material_initial_stock;
+alter table jsh_material_initial_stock change delete_fag delete_flag varchar(1) NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+-- --------------------------------------------------------
+-- 时间 2020年07月20日
+-- by jishenghua
+-- 优化表和字段的格式
+-- --------------------------------------------------------
+alter table jsh_log change userID user_id bigint(20) DEFAULT NULL COMMENT '用户id';
+alter table jsh_log change clientIP client_ip varchar(50) DEFAULT NULL COMMENT '客户端IP';
+alter table jsh_log change createtime create_time datetime DEFAULT NULL COMMENT '创建时间';
+alter table jsh_log change contentdetails content varchar(1000) DEFAULT NULL COMMENT '详情';
+alter table jsh_log drop column remark;
+
+alter table jsh_materialcategory rename to jsh_material_category;
+alter table jsh_material_category change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_material_category change Name name varchar(50) DEFAULT NULL COMMENT '名称';
+alter table jsh_material_category change CategoryLevel category_level smallint(6) DEFAULT NULL COMMENT '等级';
+alter table jsh_material_category change ParentId parent_id bigint(20) DEFAULT NULL COMMENT '上级id';
+
+alter table jsh_materialproperty rename to jsh_material_property;
+alter table jsh_material_property change nativeName native_name varchar(50) DEFAULT NULL COMMENT '原始名称';
+alter table jsh_material_property change anotherName another_name varchar(50) DEFAULT NULL COMMENT '别名';
+alter table jsh_material_property change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_role change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_role change Name name varchar(50) DEFAULT NULL COMMENT '名称';
+alter table jsh_role change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_person change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_person change Type type varchar(20) DEFAULT NULL COMMENT '类型';
+alter table jsh_person change Name name varchar(50) DEFAULT NULL COMMENT '姓名';
+alter table jsh_person change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_systemconfig rename to jsh_system_config;
+alter table jsh_system_config change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_account change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_account change Name name varchar(50) DEFAULT NULL COMMENT '名称';
+alter table jsh_account change SerialNo serial_no varchar(50) DEFAULT NULL COMMENT '编号';
+alter table jsh_account change InitialAmount initial_amount decimal(24,6) DEFAULT NULL COMMENT '期初金额';
+alter table jsh_account change CurrentAmount current_amount decimal(24,6) DEFAULT NULL COMMENT '当前余额';
+alter table jsh_account change Remark remark varchar(100) DEFAULT NULL COMMENT '备注';
+alter table jsh_account change IsDefault is_default bit(1) DEFAULT NULL COMMENT '是否默认';
+alter table jsh_account change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_functions rename to jsh_function;
+alter table jsh_function change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_function change Number number varchar(50) DEFAULT NULL COMMENT '编号';
+alter table jsh_function change Name name varchar(50) DEFAULT NULL COMMENT '名称';
+alter table jsh_function change PNumber parent_number varchar(50) DEFAULT NULL COMMENT '上级编号';
+alter table jsh_function change URL url varchar(100) DEFAULT NULL COMMENT '链接';
+alter table jsh_function change State state bit(1) DEFAULT NULL COMMENT '收缩';
+alter table jsh_function change Sort sort varchar(50) DEFAULT NULL COMMENT '排序';
+alter table jsh_function change Enabled enabled bit(1) DEFAULT NULL COMMENT '启用';
+alter table jsh_function change Type type varchar(50) DEFAULT NULL COMMENT '类型';
+alter table jsh_function change PushBtn push_btn varchar(50) DEFAULT NULL COMMENT '功能按钮';
+alter table jsh_function change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_userbusiness rename to jsh_user_business;
+alter table jsh_user_business change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_user_business change Type type varchar(50) DEFAULT NULL COMMENT '类别';
+alter table jsh_user_business change KeyId key_id varchar(50) DEFAULT NULL COMMENT '主id';
+alter table jsh_user_business change Value value varchar(10000) DEFAULT NULL COMMENT '值';
+alter table jsh_user_business change BtnStr btn_str varchar(2000) DEFAULT NULL COMMENT '按钮权限';
+alter table jsh_user_business change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_unit change UName name varchar(50) DEFAULT NULL COMMENT '名称,支持多单位';
+alter table jsh_unit change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_inoutitem rename to jsh_in_out_item;
+alter table jsh_in_out_item change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_in_out_item change Name name varchar(50) DEFAULT NULL COMMENT '名称';
+alter table jsh_in_out_item change Type type varchar(20) DEFAULT NULL COMMENT '类型';
+alter table jsh_in_out_item change Remark remark varchar(100) DEFAULT NULL COMMENT '备注';
+alter table jsh_in_out_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_serial_number change material_Id material_id bigint(20) DEFAULT NULL COMMENT '产品表id';
+alter table jsh_serial_number change serial_Number serial_number varchar(64) DEFAULT NULL COMMENT '序列号';
+alter table jsh_serial_number change is_Sell is_sell varchar(1) DEFAULT '0' COMMENT '是否卖出,0未卖出,1卖出';
+alter table jsh_serial_number change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+alter table jsh_serial_number change create_Time create_time datetime DEFAULT NULL COMMENT '创建时间';
+alter table jsh_serial_number change update_Time update_time datetime DEFAULT NULL COMMENT '更新时间';
+alter table jsh_serial_number change depothead_Id depot_head_id bigint(20) DEFAULT NULL COMMENT '单据主表id,用于跟踪序列号流向';
+
+alter table jsh_supplier change phonenum phone_num varchar(30) DEFAULT NULL COMMENT '联系电话';
+alter table jsh_supplier change AdvanceIn advance_in decimal(24,6) DEFAULT '0.000000' COMMENT '预收款';
+alter table jsh_supplier change BeginNeedGet begin_need_get decimal(24,6) DEFAULT NULL COMMENT '期初应收';
+alter table jsh_supplier change BeginNeedPay begin_need_pay decimal(24,6) DEFAULT NULL COMMENT '期初应付';
+alter table jsh_supplier change AllNeedGet all_need_get decimal(24,6) DEFAULT NULL COMMENT '累计应收';
+alter table jsh_supplier change AllNeedPay all_need_pay decimal(24,6) DEFAULT NULL COMMENT '累计应付';
+alter table jsh_supplier change taxNum tax_num varchar(50) DEFAULT NULL COMMENT '纳税人识别号';
+alter table jsh_supplier change bankName bank_name varchar(50) DEFAULT NULL COMMENT '开户行';
+alter table jsh_supplier change accountNumber account_number varchar(50) DEFAULT NULL COMMENT '账号';
+alter table jsh_supplier change taxRate tax_rate decimal(24,6) DEFAULT NULL COMMENT '税率';
+alter table jsh_supplier change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_accounthead rename to jsh_account_head;
+alter table jsh_account_head change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_account_head change Type type varchar(50) DEFAULT NULL COMMENT '类型(支出/收入/收款/付款/转账)';
+alter table jsh_account_head change OrganId organ_id bigint(20) DEFAULT NULL COMMENT '单位Id(收款/付款单位)';
+alter table jsh_account_head change HandsPersonId hands_person_id bigint(20) DEFAULT NULL COMMENT '经手人id';
+alter table jsh_account_head change ChangeAmount change_amount decimal(24,6) DEFAULT NULL COMMENT '变动金额(优惠/收款/付款/实付)';
+alter table jsh_account_head change TotalPrice total_price decimal(24,6) DEFAULT NULL COMMENT '合计金额';
+alter table jsh_account_head change AccountId account_id bigint(20) DEFAULT NULL COMMENT '账户(收款/付款)';
+alter table jsh_account_head change BillNo bill_no varchar(50) DEFAULT NULL COMMENT '单据编号';
+alter table jsh_account_head change BillTime bill_time datetime DEFAULT NULL COMMENT '单据日期';
+alter table jsh_account_head change Remark remark varchar(100) DEFAULT NULL COMMENT '备注';
+alter table jsh_account_head change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_accountitem rename to jsh_account_item;
+alter table jsh_account_item change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_account_item change HeaderId header_id bigint(20) NOT NULL COMMENT '表头Id';
+alter table jsh_account_item change AccountId account_id bigint(20) DEFAULT NULL COMMENT '账户Id';
+alter table jsh_account_item change InOutItemId in_out_item_id bigint(20) DEFAULT NULL COMMENT '收支项目Id';
+alter table jsh_account_item change EachAmount each_amount decimal(24,6) DEFAULT NULL COMMENT '单项金额';
+alter table jsh_account_item change Remark remark varchar(100) DEFAULT NULL COMMENT '单据备注';
+alter table jsh_account_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_material change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_material change CategoryId category_id bigint(20) DEFAULT NULL COMMENT '产品类型id';
+alter table jsh_material change Name name varchar(50) DEFAULT NULL COMMENT '名称';
+alter table jsh_material change Mfrs mfrs varchar(50) DEFAULT NULL COMMENT '制造商';
+alter table jsh_material change SafetyStock safety_stock decimal(24,6) DEFAULT NULL COMMENT '安全存量(KG)';
+alter table jsh_material change Model model varchar(50) DEFAULT NULL COMMENT '型号';
+alter table jsh_material change Standard standard varchar(50) DEFAULT NULL COMMENT '规格';
+alter table jsh_material change Color color varchar(50) DEFAULT NULL COMMENT '颜色';
+alter table jsh_material change Unit unit varchar(50) DEFAULT NULL COMMENT '单位-单个';
+alter table jsh_material change Remark remark varchar(100) DEFAULT NULL COMMENT '备注';
+alter table jsh_material change UnitId unit_id bigint(20) DEFAULT NULL COMMENT '计量单位Id';
+alter table jsh_material change Enabled enabled bit(1) DEFAULT NULL COMMENT '启用 0-禁用 1-启用';
+alter table jsh_material change OtherField1 other_field1 varchar(50) DEFAULT NULL COMMENT '自定义1';
+alter table jsh_material change OtherField2 other_field2 varchar(50) DEFAULT NULL COMMENT '自定义2';
+alter table jsh_material change OtherField3 other_field3 varchar(50) DEFAULT NULL COMMENT '自定义3';
+alter table jsh_material change enableSerialNumber enable_serial_number varchar(1) DEFAULT '0' COMMENT '是否开启序列号,0否,1是';
+alter table jsh_material change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_depothead rename to jsh_depot_head;
+alter table jsh_depot_head change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_depot_head change Type type varchar(50) DEFAULT NULL COMMENT '类型(出库/入库)';
+alter table jsh_depot_head change SubType sub_type varchar(50) DEFAULT NULL COMMENT '出入库分类';
+alter table jsh_depot_head change DefaultNumber default_number varchar(50) DEFAULT NULL COMMENT '初始票据号';
+alter table jsh_depot_head change Number number varchar(50) DEFAULT NULL COMMENT '票据号';
+alter table jsh_depot_head change OperPersonName oper_person_name varchar(50) DEFAULT NULL COMMENT '操作员名字';
+alter table jsh_depot_head change CreateTime create_time datetime DEFAULT NULL COMMENT '创建时间';
+alter table jsh_depot_head change OperTime oper_time datetime DEFAULT NULL COMMENT '出入库时间';
+alter table jsh_depot_head change OrganId organ_id bigint(20) DEFAULT NULL COMMENT '供应商id';
+alter table jsh_depot_head change HandsPersonId hands_person_id bigint(20) DEFAULT NULL COMMENT '采购/领料-经手人id';
+alter table jsh_depot_head change AccountId account_id bigint(20) DEFAULT NULL COMMENT '账户id';
+alter table jsh_depot_head change ChangeAmount change_amount decimal(24,6) DEFAULT NULL COMMENT '变动金额(收款/付款)';
+alter table jsh_depot_head change TotalPrice total_price decimal(24,6) DEFAULT NULL COMMENT '合计金额';
+alter table jsh_depot_head change PayType pay_type varchar(50) DEFAULT NULL COMMENT '付款类型(现金、记账等)';
+alter table jsh_depot_head change Remark remark varchar(1000) DEFAULT NULL COMMENT '备注';
+alter table jsh_depot_head change Salesman sales_man varchar(50) DEFAULT NULL COMMENT '业务员(可以多个)';
+alter table jsh_depot_head change AccountIdList account_id_list varchar(50) DEFAULT NULL COMMENT '多账户ID列表';
+alter table jsh_depot_head change AccountMoneyList account_money_list varchar(200) DEFAULT NULL COMMENT '多账户金额列表';
+alter table jsh_depot_head change Discount discount decimal(24,6) DEFAULT NULL COMMENT '优惠率';
+alter table jsh_depot_head change DiscountMoney discount_money decimal(24,6) DEFAULT NULL COMMENT '优惠金额';
+alter table jsh_depot_head change DiscountLastMoney discount_last_money decimal(24,6) DEFAULT NULL COMMENT '优惠后金额';
+alter table jsh_depot_head change OtherMoney other_money decimal(24,6) DEFAULT NULL COMMENT '销售或采购费用合计';
+alter table jsh_depot_head change OtherMoneyList other_money_list varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目Id数组(包括快递、招待等)';
+alter table jsh_depot_head change OtherMoneyItem other_money_item varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目(包括快递、招待等)';
+alter table jsh_depot_head change AccountDay account_day int(10) DEFAULT NULL COMMENT '结算天数';
+alter table jsh_depot_head change Status status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2已转采购|销售';
+alter table jsh_depot_head change LinkNumber link_number varchar(50) DEFAULT NULL COMMENT '关联订单号';
+alter table jsh_depot_head change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+alter table jsh_depotitem rename to jsh_depot_item;
+alter table jsh_depot_item change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键';
+alter table jsh_depot_item change HeaderId header_id bigint(20) NOT NULL COMMENT '表头Id';
+alter table jsh_depot_item change MaterialId material_id bigint(20) NOT NULL COMMENT '商品Id';
+alter table jsh_depot_item change MUnit material_unit varchar(20) DEFAULT NULL COMMENT '商品计量单位';
+alter table jsh_depot_item change OperNumber oper_number decimal(24,6) DEFAULT NULL COMMENT '数量';
+alter table jsh_depot_item change BasicNumber basic_number decimal(24,6) DEFAULT NULL COMMENT '基础数量,如kg、瓶';
+alter table jsh_depot_item change UnitPrice unit_price decimal(24,6) DEFAULT NULL COMMENT '单价';
+alter table jsh_depot_item change TaxUnitPrice tax_unit_price decimal(24,6) DEFAULT NULL COMMENT '含税单价';
+alter table jsh_depot_item change AllPrice all_price decimal(24,6) DEFAULT NULL COMMENT '金额';
+alter table jsh_depot_item change Remark remark varchar(200) DEFAULT NULL COMMENT '备注';
+alter table jsh_depot_item change Img img varchar(50) DEFAULT NULL COMMENT '图片';
+alter table jsh_depot_item change Incidentals incidentals decimal(24,6) DEFAULT NULL COMMENT '运杂费';
+alter table jsh_depot_item change DepotId depot_id bigint(20) DEFAULT NULL COMMENT '仓库ID';
+alter table jsh_depot_item change AnotherDepotId another_depot_id bigint(20) DEFAULT NULL COMMENT '调拨时,对方仓库Id';
+alter table jsh_depot_item change TaxRate tax_rate decimal(24,6) DEFAULT NULL COMMENT '税率';
+alter table jsh_depot_item change TaxMoney tax_money decimal(24,6) DEFAULT NULL COMMENT '税额';
+alter table jsh_depot_item change TaxLastMoney tax_last_money decimal(24,6) DEFAULT NULL COMMENT '价税合计';
+alter table jsh_depot_item change OtherField1 other_field1 varchar(50) DEFAULT NULL COMMENT '自定义字段1-名称';
+alter table jsh_depot_item change OtherField2 other_field2 varchar(50) DEFAULT NULL COMMENT '自定义字段2-型号';
+alter table jsh_depot_item change OtherField3 other_field3 varchar(50) DEFAULT NULL COMMENT '自定义字段3-制造商';
+alter table jsh_depot_item change OtherField4 other_field4 varchar(50) DEFAULT NULL COMMENT '自定义字段4-名称';
+alter table jsh_depot_item change OtherField5 other_field5 varchar(50) DEFAULT NULL COMMENT '自定义字段5-名称';
+alter table jsh_depot_item change MType material_type varchar(20) DEFAULT NULL COMMENT '商品类型';
+alter table jsh_depot_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+
+-- --------------------------------------------------------
+-- 时间 2020年09月13日
+-- by jishenghua
+-- 给单据表增加操作员字段,去掉经手头姓名字段
+-- --------------------------------------------------------
+alter table jsh_depot_head add creator bigint(20) DEFAULT NULL COMMENT '操作员' after hands_person_id;
+alter table jsh_account_head add creator bigint(20) DEFAULT NULL COMMENT '操作员' after hands_person_id;
+alter table jsh_depot_head drop column oper_person_name;
+update jsh_depot_head set creator=hands_person_id;
+
+
+-- --------------------------------------------------------
+-- 时间 2020年10月17日
+-- by jishenghua
+-- 增加平台表
+-- --------------------------------------------------------
+DROP TABLE IF EXISTS `jsh_platform_config`;
+CREATE TABLE `jsh_platform_config` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `platform_key` varchar(100) DEFAULT NULL COMMENT '关键词',
+ `platform_key_info` varchar(100) DEFAULT NULL COMMENT '关键词名称',
+ `platform_value` varchar(200) DEFAULT NULL COMMENT '值',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='平台参数';
+
+INSERT INTO `jsh_platform_config` VALUES ('1', 'platform_name', '平台名称', '华夏ERP');
+INSERT INTO `jsh_platform_config` VALUES ('2', 'activation_code', '激活码', null);
+
+-- --------------------------------------------------------
+-- 时间 2020年11月24日
+-- by jishenghua
+-- 给单据主表增加单据类型字段bill_type
+-- --------------------------------------------------------
+alter table jsh_depot_head add bill_type varchar(50) DEFAULT NULL COMMENT '单据类型' after pay_type;
+
+-- --------------------------------------------------------
+-- 时间 2021年1月19日
+-- by jishenghua
+-- 给功能表增加组件字段component
+-- --------------------------------------------------------
+alter table jsh_function add component varchar(100) DEFAULT NULL COMMENT '组件' after url;
+
+-- --------------------------------------------------------
+-- 时间 2021年2月13日
+-- by jishenghua
+-- 优化机构和商品类型表的字段
+-- --------------------------------------------------------
+alter table jsh_organization change org_parent_no parent_id bigint(20) DEFAULT NULL COMMENT '父机构id';
+alter table jsh_organization change org_stcd delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+alter table jsh_organization drop column org_tpcd;
+alter table jsh_organization drop column org_create_time;
+alter table jsh_organization drop column org_stop_time;
+alter table jsh_organization drop column creator;
+alter table jsh_organization drop column updater;
+alter table jsh_material_category drop column creator;
+alter table jsh_material_category drop column updater;
+alter table jsh_material_category change status delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
+update jsh_material_category set delete_flag='0';
\ No newline at end of file
diff --git a/jshERP-boot/pom.xml b/jshERP-boot/pom.xml
new file mode 100644
index 000000000..1372af326
--- /dev/null
+++ b/jshERP-boot/pom.xml
@@ -0,0 +1,178 @@
+
+
+ 4.0.0
+ com.jsh
+ jshERP-boot
+ 2.3-SNAPSHOT
+ jar
+
+ jshERP-boot
+ 华夏ERP
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.0.0.RELEASE
+
+
+
+ UTF-8
+ UTF-8
+ 1.8
+
+
+
+
+ com.gitee.starblues
+ springboot-plugin-framework
+ 2.2.1-RELEASE
+
+
+ com.gitee.starblues
+ springboot-plugin-framework-extension-mybatis
+ 2.2.1-RELEASE
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ com.alibaba
+ fastjson
+ 1.2.55
+
+
+ mysql
+ mysql-connector-java
+ 5.1.30
+
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.2
+
+
+ net.sourceforge.jexcelapi
+ jxl
+ 2.6.12
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.12
+
+
+
+ org.apache.logging.log4j
+ log4j-to-slf4j
+ 2.10.0
+ compile
+
+
+ org.slf4j
+ jul-to-slf4j
+ 1.7.25
+ compile
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.0.7.1
+
+
+ org.springframework.boot
+ spring-boot-starter-redis
+ 1.4.1.RELEASE
+
+
+ io.springfox
+ springfox-swagger2
+ 2.7.0
+ compile
+
+
+ com.github.xiaoymin
+ swagger-bootstrap-ui
+ 1.6
+
+
+
+
+ jshERP3.0
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.0.3.RELEASE
+
+
+ build-info
+ generate-sources
+
+ build-info
+
+
+
+ repackage
+ package
+
+ repackage
+
+
+ com.jsh.erp.ErpApplication
+ JAR
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 2.5.1
+
+
+ make-zip
+ package
+
+ single
+
+
+
+ src/main/assembly/assembly.xml
+
+ ./dist
+
+
+
+
+
+ org.mybatis.generator
+ mybatis-generator-maven-plugin
+ 1.4.0
+
+ ${basedir}/src/test/resources/generatorConfig.xml
+ true
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.7.0
+
+ 1.8
+ 1.8
+ true
+
+
+
+
+
diff --git a/jshERP-boot/src/main/assembly/assembly.xml b/jshERP-boot/src/main/assembly/assembly.xml
new file mode 100644
index 000000000..eadda257a
--- /dev/null
+++ b/jshERP-boot/src/main/assembly/assembly.xml
@@ -0,0 +1,71 @@
+
+
+
+ bin
+
+
+ zip
+
+
+ true
+
+
+
+ erp_web
+ /erp_web
+
+
+ ${project.basedir}/target
+
+ *.jar
+
+ /lib
+
+
+ ${project.basedir}/src/main/resources
+
+ *.properties
+ *.yml
+ *.yaml
+ *.xml
+
+ /config
+
+
+ ${project.basedir}/src/main/bin
+ /bin
+
+ run-manage.sh
+
+ unix
+
+
+ ${project.basedir}/src/main/bin/
+ /
+
+ start.bat
+ restart.sh
+ start.sh
+ stop.sh
+ status.sh
+
+
+
+ docs
+ /docs
+
+
+ ${project.basedir}
+
+ *.md
+ *.txt
+
+ /
+
+
+
\ No newline at end of file
diff --git a/jshERP-boot/src/main/bin/restart.sh b/jshERP-boot/src/main/bin/restart.sh
new file mode 100644
index 000000000..70c0be158
--- /dev/null
+++ b/jshERP-boot/src/main/bin/restart.sh
@@ -0,0 +1 @@
+./bin/run-manage.sh restart
\ No newline at end of file
diff --git a/jshERP-boot/src/main/bin/run-manage.sh b/jshERP-boot/src/main/bin/run-manage.sh
new file mode 100644
index 000000000..fb86505f4
--- /dev/null
+++ b/jshERP-boot/src/main/bin/run-manage.sh
@@ -0,0 +1,146 @@
+SERVER_NAME=jshERP
+readonly APP_HOME=${FILE_PATH:-$(dirname $(cd `dirname $0`; pwd))}
+
+#readonly JAVA_HOME=""
+
+readonly CONFIG_HOME="$APP_HOME/config/"
+readonly LIB_HOME="$APP_HOME/lib"
+readonly LOGS_HOME="$APP_HOME/logs"
+
+readonly PID_FILE="$LOGS_HOME/application.pid"
+readonly APP_MAIN_CLASS="jshERP3.0.jar"
+readonly LOG_CONFIG="$CONFIG_HOME/logback-spring.xml"
+
+readonly JAVA_RUN="-Dlogs.home=$LOGS_HOME -Dlogging.config=$LOG_CONFIG -Dspring.config.location=file:$CONFIG_HOME -Dspring.pid.file=$PID_FILE -Dspring.pid.fail-on-write-error=true"
+readonly JAVA_OPTS="-server -Xms128m -Xmx320m -XX:PermSize=128M -XX:MaxPermSize=256M $JAVA_RUN"
+
+readonly JAVA="java"
+
+PID=0
+
+
+if [ ! -x "$LOGS_HOME" ]
+then
+ mkdir $LOGS_HOME
+fi
+chmod +x -R "$JAVA_HOME/bin/"
+
+functions="/etc/functions.sh"
+if test -f $functions ; then
+ . $functions
+else
+ success()
+ {
+ echo " SUCCESS! $@"
+ }
+ failure()
+ {
+ echo " ERROR! $@"
+ }
+ warning()
+ {
+ echo "WARNING! $@"
+ }
+fi
+
+function checkpid() {
+ PID=$(ps -ef | grep $APP_MAIN_CLASS | grep -v 'grep' | awk '{print int($2)}')
+ if [[ -n "$PID" ]]
+ then
+ return 0
+ else
+ return 1
+ fi
+}
+
+function start() {
+ checkpid
+ if [[ $? -eq 0 ]]
+ then
+ warning "[$APP_MAIN_CLASS]: already started! (PID=$PID)"
+ else
+ echo -n "[$APP_MAIN_CLASS]: Starting ..."
+ JAVA_CMD="nohup $JAVA $JAVA_OPTS -jar $LIB_HOME/$APP_MAIN_CLASS > /dev/null 2>&1 &"
+ # echo "Exec cmmand : $JAVA_CMD"
+ sh -c "$JAVA_CMD"
+ sleep 3
+ checkpid
+ if [[ $? -eq 0 ]]
+ then
+ success "(PID=$PID) "
+ else
+ failure " "
+ fi
+ fi
+}
+
+function stop() {
+ checkpid
+ if [[ $? -eq 0 ]];
+ then
+ echo -n "[$APP_MAIN_CLASS]: Shutting down ...(PID=$PID) "
+ kill -9 $PID
+ if [[ $? -eq 0 ]];
+ then
+ echo 0 > $PID_FILE
+ success " "
+ else
+ failure " "
+ fi
+ else
+ warning "[$APP_MAIN_CLASS]: is not running ..."
+ fi
+}
+
+function status() {
+ checkpid
+ if [[ $? -eq 0 ]]
+ then
+ success "[$APP_MAIN_CLASS]: is running! (PID=$PID)"
+ return 0
+ else
+ failure "[$APP_MAIN_CLASS]: is not running"
+ return 1
+ fi
+}
+
+function info() {
+ echo "System Information:"
+ echo
+ echo "****************************"
+ echo `head -n 1 /etc/issue`
+ echo `uname -a`
+ echo
+ echo "JAVA_HOME=$JAVA_HOME"
+ echo
+ echo "JAVA Environment Information:"
+ echo `$JAVA -version`
+ echo
+ echo "APP_HOME=$APP_HOME"
+ echo "APP_MAIN_CLASS=$APP_MAIN_CLASS"
+ echo
+ echo "****************************"
+}
+
+case "$1" in
+ 'start')
+ start
+ ;;
+ 'stop')
+ stop
+ ;;
+ 'restart')
+ stop
+ start
+ ;;
+ 'status')
+ status
+ ;;
+ 'info')
+ info
+ ;;
+ *)
+ echo "Usage: $0 {help|start|stop|restart|status|info}"
+ ;;
+esac
+exit 0
diff --git a/jshERP-boot/src/main/bin/start.bat b/jshERP-boot/src/main/bin/start.bat
new file mode 100644
index 000000000..94ce4f469
--- /dev/null
+++ b/jshERP-boot/src/main/bin/start.bat
@@ -0,0 +1,6 @@
+@echo off
+
+title jshERP
+
+java -Xms1000m -Xmx2000m -jar .\lib\jshERP.jar
+pause over
\ No newline at end of file
diff --git a/jshERP-boot/src/main/bin/start.sh b/jshERP-boot/src/main/bin/start.sh
new file mode 100644
index 000000000..d0bf0677c
--- /dev/null
+++ b/jshERP-boot/src/main/bin/start.sh
@@ -0,0 +1 @@
+./bin/run-manage.sh start
\ No newline at end of file
diff --git a/jshERP-boot/src/main/bin/status.sh b/jshERP-boot/src/main/bin/status.sh
new file mode 100644
index 000000000..46d65372b
--- /dev/null
+++ b/jshERP-boot/src/main/bin/status.sh
@@ -0,0 +1 @@
+./bin/run-manage.sh status
\ No newline at end of file
diff --git a/jshERP-boot/src/main/bin/stop.sh b/jshERP-boot/src/main/bin/stop.sh
new file mode 100644
index 000000000..8f3414e79
--- /dev/null
+++ b/jshERP-boot/src/main/bin/stop.sh
@@ -0,0 +1 @@
+./bin/run-manage.sh stop
\ No newline at end of file
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/ErpApplication.java b/jshERP-boot/src/main/java/com/jsh/erp/ErpApplication.java
new file mode 100644
index 000000000..2f3d82853
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/ErpApplication.java
@@ -0,0 +1,27 @@
+package com.jsh.erp;
+
+import com.jsh.erp.utils.ComputerInfo;
+import org.mybatis.spring.annotation.MapperScan;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.env.Environment;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import java.io.IOException;
+
+@SpringBootApplication
+@MapperScan("com.jsh.erp.datasource.mappers")
+@ServletComponentScan
+@EnableScheduling
+public class ErpApplication{
+ public static void main(String[] args) throws IOException {
+ ConfigurableApplicationContext context = SpringApplication.run(ErpApplication.class, args);
+ Environment environment = context.getBean(Environment.class);
+ System.out.println("启动成功,访问地址:http://" + ComputerInfo.getIpAddr() + ":"
+ + environment.getProperty("server.port") + ",测试用户:jsh,密码:123456");
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/config/PluginBeanConfig.java b/jshERP-boot/src/main/java/com/jsh/erp/config/PluginBeanConfig.java
new file mode 100644
index 000000000..301b1bfc3
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/config/PluginBeanConfig.java
@@ -0,0 +1,24 @@
+package com.jsh.erp.config;
+
+import com.gitee.starblues.extension.mybatis.SpringBootMybatisExtension;
+import com.gitee.starblues.integration.application.AutoPluginApplication;
+import com.gitee.starblues.integration.application.PluginApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Author: jishenghua
+ * @Version: 1.0
+ * @Create Date Time: 2019-05-30 15:53
+ * @Update Date Time:
+ * @see
+ */
+@Configuration
+public class PluginBeanConfig {
+ @Bean
+ public PluginApplication pluginApplication(){
+ PluginApplication pluginApplication = new AutoPluginApplication();
+ pluginApplication.addExtension(new SpringBootMybatisExtension());
+ return pluginApplication;
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/config/PluginConfiguration.java b/jshERP-boot/src/main/java/com/jsh/erp/config/PluginConfiguration.java
new file mode 100644
index 000000000..4c3bf4645
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/config/PluginConfiguration.java
@@ -0,0 +1,104 @@
+package com.jsh.erp.config;
+
+import com.gitee.starblues.integration.DefaultIntegrationConfiguration;
+import org.pf4j.RuntimeMode;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @Description:
+ * @Author: jishenghua
+ * @Version: 1.0
+ * @Create Date Time: 2019-05-25 12:36
+ * @Update Date Time:
+ * @see
+ */
+@Component
+@ConfigurationProperties(prefix = "plugin")
+public class PluginConfiguration extends DefaultIntegrationConfiguration {
+
+ /**
+ * 运行模式
+ * 开发环境: development、dev
+ * 生产/部署 环境: deployment、prod
+ */
+ @Value("${runMode:dev}")
+ private String runMode;
+
+ @Value("${pluginPath:plugins}")
+ private String pluginPath;
+
+ @Value("${pluginConfigFilePath:pluginConfigs}")
+ private String pluginConfigFilePath;
+
+ @Override
+ public RuntimeMode environment() {
+ return RuntimeMode.byName(runMode);
+ }
+
+ @Override
+ public String pluginPath() {
+ return pluginPath;
+ }
+
+ @Override
+ public String pluginConfigFilePath() {
+ return pluginConfigFilePath;
+ }
+
+ @Override
+ public String uploadTempPath() {
+ return "temp";
+ }
+
+ @Override
+ public String backupPath() {
+ return "backupPlugin";
+ }
+
+ @Override
+ public String pluginRestControllerPathPrefix() {
+ return "/api/plugin";
+ }
+
+ @Override
+ public boolean enablePluginIdRestControllerPathPrefix() {
+ return true;
+ }
+
+ public String getRunMode() {
+ return runMode;
+ }
+
+ public void setRunMode(String runMode) {
+ this.runMode = runMode;
+ }
+
+
+ public String getPluginPath() {
+ return pluginPath;
+ }
+
+ public void setPluginPath(String pluginPath) {
+ this.pluginPath = pluginPath;
+ }
+
+ public String getPluginConfigFilePath() {
+ return pluginConfigFilePath;
+ }
+
+ public void setPluginConfigFilePath(String pluginConfigFilePath) {
+ this.pluginConfigFilePath = pluginConfigFilePath;
+ }
+
+ @Override
+ public String toString() {
+ return "PluginArgConfiguration{" +
+ "runMode='" + runMode + '\'' +
+ ", pluginPath='" + pluginPath + '\'' +
+ ", pluginConfigFilePath='" + pluginConfigFilePath + '\'' +
+ '}';
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/config/Swagger2Config.java b/jshERP-boot/src/main/java/com/jsh/erp/config/Swagger2Config.java
new file mode 100644
index 000000000..0aec51c7a
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/config/Swagger2Config.java
@@ -0,0 +1,44 @@
+package com.jsh.erp.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * 插件集成配置
+ *
+ * @author jishenghua
+ * @version 1.0
+ */
+@Configuration
+@EnableSwagger2
+public class Swagger2Config {
+
+ @Bean
+ public Docket createRestApi() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .apiInfo(this.apiInfo())
+ .select()
+ .apis(RequestHandlerSelectors.any())
+ .paths(PathSelectors.any())
+ .build();
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder()
+ .title("Mybatis-Plus Plugin Example RESTful APIs")
+ .description("集成Mybatis-Plus模块接口描述")
+ .termsOfServiceUrl("http://127.0.0.1")
+ .contact(new Contact("jishenghua", "", ""))
+ .version("2.1.1")
+ .build();
+ }
+
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java b/jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java
new file mode 100644
index 000000000..0e51583c6
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/config/TenantConfig.java
@@ -0,0 +1,107 @@
+package com.jsh.erp.config;
+
+import com.baomidou.mybatisplus.core.parser.ISqlParser;
+import com.baomidou.mybatisplus.core.parser.ISqlParserFilter;
+import com.baomidou.mybatisplus.core.parser.SqlParserHelper;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.tenant.TenantHandler;
+import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
+import com.jsh.erp.utils.Tools;
+import net.sf.jsqlparser.expression.Expression;
+import net.sf.jsqlparser.expression.LongValue;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.reflection.MetaObject;
+import org.mybatis.spring.mapper.MapperScannerConfigurer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class TenantConfig {
+
+ @Bean
+ public PaginationInterceptor paginationInterceptor(HttpServletRequest request) {
+ PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
+ List sqlParserList = new ArrayList<>();
+ TenantSqlParser tenantSqlParser = new TenantSqlParser();
+ tenantSqlParser.setTenantHandler(new TenantHandler() {
+ @Override
+ public Expression getTenantId() {
+ String token = request.getHeader("X-Access-Token");
+ Long tenantId = Tools.getTenantIdByToken(token);
+ if (tenantId!=0L) {
+ return new LongValue(tenantId);
+ } else {
+ //超管
+ return null;
+ }
+ }
+
+ @Override
+ public String getTenantIdColumn() {
+ return "tenant_id";
+ }
+
+ @Override
+ public boolean doTableFilter(String tableName) {
+ //获取开启状态
+ Boolean res = true;
+ String token = request.getHeader("X-Access-Token");
+ Long tenantId = Tools.getTenantIdByToken(token);
+ if (tenantId!=0L) {
+ // 这里可以判断是否过滤表
+ if ("jsh_material_property".equals(tableName) || "jsh_sequence".equals(tableName)
+ || "jsh_user_business".equals(tableName) || "jsh_function".equals(tableName)
+ || "jsh_platform_config".equals(tableName) || "jsh_tenant".equals(tableName)) {
+ res = true;
+ } else {
+ res = false;
+ }
+ }
+ return res;
+ }
+ });
+
+ sqlParserList.add(tenantSqlParser);
+ paginationInterceptor.setSqlParserList(sqlParserList);
+ paginationInterceptor.setSqlParserFilter(new ISqlParserFilter() {
+ @Override
+ public boolean doFilter(MetaObject metaObject) {
+ MappedStatement ms = SqlParserHelper.getMappedStatement(metaObject);
+ // 过滤自定义查询此时无租户信息约束出现
+ if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserListByUserNameOrLoginName".equals(ms.getId())||
+ "com.jsh.erp.datasource.mappers.DepotItemMapperEx.getStockByParam".equals(ms.getId())) {
+ return true;
+ }
+ return false;
+ }
+ });
+ return paginationInterceptor;
+ }
+
+ /**
+ * 相当于顶部的:
+ * {@code @MapperScan("com.jsh.erp.datasource.mappers*")}
+ * 这里可以扩展,比如使用配置文件来配置扫描Mapper的路径
+ */
+ @Bean
+ public MapperScannerConfigurer mapperScannerConfigurer() {
+ MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer();
+ scannerConfigurer.setBasePackage("com.jsh.erp.datasource.mappers*");
+ return scannerConfigurer;
+ }
+
+ /**
+ * 性能分析拦截器,不建议生产使用
+ */
+ @Bean
+ public PerformanceInterceptor performanceInterceptor(){
+ return new PerformanceInterceptor();
+ }
+
+
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java b/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java
new file mode 100644
index 000000000..cb4a09ffc
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java
@@ -0,0 +1,177 @@
+package com.jsh.erp.constants;
+
+/**
+ * @ClassName:BusinessConstants
+ * @Description 业务字典类
+ * @Author qiankunpingtai
+ * @Date 2019-3-6 17:58
+ * @Version 1.0
+ **/
+public class BusinessConstants {
+
+ /**
+ * 默认的日期格式
+ */
+ public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+ /**
+ * 默认的分页起始页页码
+ */
+ public static final Integer DEFAULT_PAGINATION_PAGE_NUMBER = 1;
+ /**
+ * 无数据时列表返回的默认数据条数
+ */
+ public static final Long DEFAULT_LIST_NULL_NUMBER = 0L;
+ /**
+ * 默认的分页条数
+ */
+ public static final Integer DEFAULT_PAGINATION_PAGE_SIZE = 10;
+ /**
+ * 单据主表出入库类型 type 入库 出库
+ * depothead
+ * */
+ public static final String DEPOTHEAD_TYPE_STORAGE = "入库";
+ public static final String DEPOTHEAD_TYPE_OUT = "出库";
+ /**
+ * 付款类型 payType //现付/预付款
+ * */
+ public static final String PAY_TYPE_PREPAID = "预付款";
+ public static final String PAY_TYPE_BY_CASH = "现付";
+ /**
+ * 删除标记 deleteFlag '0'未删除 '1'已删除
+ * */
+ public static final String DELETE_FLAG_DELETED = "1";
+ public static final String DELETE_FLAG_EXISTS = "0";
+ /**
+ * 是否卖出 isSell '0'未卖出 '1'已卖出
+ * */
+ public static final String IS_SELL_SELLED = "1";
+ public static final String IS_SELL_HOLD = "0";
+ /**
+ * 商品是否开启序列号标识enableSerialNumber '0'未启用 '1'启用
+ * */
+ public static final String ENABLE_SERIAL_NUMBER_ENABLED = "1";
+ public static final String ENABLE_SERIAL_NUMBER_NOT_ENABLED = "0";
+ /**
+ * 单据状态 billsStatus '0'未审核 '1'审核 '2'已转采购|销售
+ * */
+ public static final String BILLS_STATUS_UN_AUDIT = "0";
+ public static final String BILLS_STATUS_AUDIT = "1";
+ public static final String BILLS_STATUS_SKIP = "2";
+ /**
+ * 出入库分类
+ *采购、采购退货、其它、零售、销售、调拨
+ * */
+ public static final String SUB_TYPE_PURCHASE = "采购";
+ public static final String SUB_TYPE_PURCHASE_TETURNS = "采购退货";
+ public static final String SUB_TYPE_OTHER = "其它";
+ public static final String SUB_TYPE_RETAIL = "零售";
+ public static final String SUB_TYPE_SALES = "销售";
+ public static final String SUB_TYPE_TRANSFER = "调拨";
+ /**
+ * 批量插入sql时最大的数据条数
+ * */
+ public static final int BATCH_INSERT_MAX_NUMBER = 500;
+ /**
+ * sequence名称
+ * */
+ //sequence返回字符串的最小长度
+ public static final Long SEQ_TO_STRING_MIN_LENGTH = 10000000000L;
+ //sequence长度小于基准长度时前追加基础值
+ public static final String SEQ_TO_STRING_LESS_INSERT = "0";
+ //单据编号
+ public static final String DEPOT_NUMBER_SEQ = "depot_number_seq";
+ /**
+ * 商品类别根目录id
+ * */
+ /**
+ * create by: qiankunpingtai
+ * create time: 2019/3/14 11:41
+ * description:
+ * 为了使用户可以自己建初始目录,设定根目录的父级目录id为-1
+ *
+ */
+ public static final Long MATERIAL_CATEGORY_ROOT_PARENT_ID = -1L;
+ /**
+ * 商品类别状态
+ * 0系统默认,1启用,2删除
+ * */
+ public static final String MATERIAL_CATEGORY_STATUS_DEFAULT = "0";
+ public static final String MATERIAL_CATEGORY_STATUS_ENABLE = "1";
+ public static final String MATERIAL_CATEGORY_STATUS_DELETE = "2";
+ /**
+ * 机构状态
+ * 1未营业、2正常营业、3暂停营业、4终止营业,5已除名
+ * */
+ public static final String ORGANIZATION_STCD_NOT_OPEN = "1";
+ public static final String ORGANIZATION_STCD_OPEN = "2";
+ public static final String ORGANIZATION_STCD_BUSINESS_SUSPENDED = "3";
+ public static final String ORGANIZATION_STCD_BUSINESS_TERMINATED = "4";
+ public static final String ORGANIZATION_STCD_REMOVED = "5";
+ /**
+ * 根机构父级编号
+ * 根机父级构编号默认为-1
+ * */
+ public static final String ORGANIZATION_ROOT_PARENT_NO = "-1";
+ /**
+ * 新增用户默认密码
+ * */
+ public static final String USER_DEFAULT_PASSWORD = "123456";
+ /**
+ * 用户是否系统自带
+ * 0、非系统自带,1系统自带
+ * */
+ public static final byte USER_NOT_SYSTEM = 0;
+ public static final byte USER_IS_SYSTEM = 1;
+ /**
+ * 用户是否为管理者
+ * 0、管理者,1员工
+ * */
+ public static final byte USER_IS_MANAGER = 0;
+ public static final byte USER_NOT_MANAGER = 1;
+ /**
+ * 用户状态
+ * 0:正常,1:删除,2封禁
+ * */
+ public static final byte USER_STATUS_NORMAL = 0;
+ public static final byte USER_STATUS_DELETE = 1;
+ public static final byte USER_STATUS_BANNED = 2;
+ /**
+ * 日志操作
+ * 新增、修改、删除、登录、导入
+ * */
+ public static final String LOG_OPERATION_TYPE_ADD = "新增";
+ public static final String LOG_OPERATION_TYPE_BATCH_ADD = "批量新增";
+ public static final String LOG_OPERATION_TYPE_EDIT = "修改";
+ public static final String LOG_OPERATION_TYPE_DELETE = "删除";
+ public static final String LOG_OPERATION_TYPE_LOGIN = "登录";
+ public static final String LOG_OPERATION_TYPE_IMPORT = "导入";
+
+ /**
+ * 数据数量单位
+ * 条
+ * */
+ public static final String LOG_DATA_UNIT = "条";
+
+ /**
+ * 删除类型
+ * 1正常删除
+ * 2强制删除
+ * */
+ public static final String DELETE_TYPE_NORMAL = "1";
+ public static final String DELETE_TYPE_FORCE = "2";
+
+ /**
+ * 默认管理员账号
+ */
+ public static final String DEFAULT_MANAGER = "admin";
+
+ public static final String ROLE_TYPE_PRIVATE = "个人数据";
+
+ public static final String ROLE_TYPE_THIS_ORG = "本机构数据";
+
+ /**
+ * redis相关
+ * */
+ //session的生命周期,秒
+ public static final Long MAX_SESSION_IN_SECONDS=60*60*24L;
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java b/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java
new file mode 100644
index 000000000..47bd7ebdb
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java
@@ -0,0 +1,416 @@
+package com.jsh.erp.constants;
+
+import com.alibaba.fastjson.JSONObject;
+
+public class ExceptionConstants {
+ /**
+ * code 格式 type+五位数字,例如3500000
+ * ResourceInfo(value = "inOutItem", type = 35)
+ *
+ * */
+
+ public static final String GLOBAL_RETURNS_CODE = "code";
+ public static final String GLOBAL_RETURNS_MESSAGE = "msg";
+ public static final String GLOBAL_RETURNS_DATA = "data";
+
+ /**
+ * 正常返回/操作成功
+ **/
+ public static final int SERVICE_SUCCESS_CODE = 200;
+ public static final String SERVICE_SUCCESS_MSG = "操作成功";
+ /**
+ * 数据查询异常
+ */
+ public static final int DATA_READ_FAIL_CODE = 300;
+ public static final String DATA_READ_FAIL_MSG = "数据查询异常";
+ /**
+ * 数据写入异常
+ */
+ public static final int DATA_WRITE_FAIL_CODE = 301;
+ public static final String DATA_WRITE_FAIL_MSG = "数据写入异常";
+
+ /**
+ * 系统运行时未知错误
+ **/
+ public static final int SERVICE_SYSTEM_ERROR_CODE = 500;
+ public static final String SERVICE_SYSTEM_ERROR_MSG = "未知异常";
+
+ /**
+ * 删除操作被拒绝,请联系管理员
+ **/
+ public static final int DELETE_REFUSED_CODE = 600;
+ public static final String DELETE_REFUSED_MSG = "删除操作被拒绝,请联系管理员";
+ /**
+ * 检测到存在依赖数据,是否强制删除?
+ **/
+ public static final int DELETE_FORCE_CONFIRM_CODE = 601;
+ public static final String DELETE_FORCE_CONFIRM_MSG = "检测到存在依赖数据,不能删除!";
+ /**
+ * 用户信息
+ * type = 5
+ * */
+ //添加用户信息失败
+ public static final int USER_ADD_FAILED_CODE = 500000;
+ public static final String USER_ADD_FAILED_MSG = "添加用户信息失败";
+ //删除用户信息失败
+ public static final int USER_DELETE_FAILED_CODE = 500001;
+ public static final String USER_DELETE_FAILED_MSG = "删除用户信息失败";
+ //修改用户信息失败
+ public static final int USER_EDIT_FAILED_CODE = 500002;
+ public static final String USER_EDIT_FAILED_MSG = "修改用户信息失败";
+ //用户名已存在
+ public static final int USER_USER_NAME_ALREADY_EXISTS_CODE = 500003;
+ public static final String USER_USER_NAME_ALREADY_EXISTS_MSG = "用户名在本系统已存在";
+ //登录名已存在
+ public static final int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003;
+ public static final String USER_LOGIN_NAME_ALREADY_EXISTS_MSG = "登录名在本系统已存在";
+ //用户录入数量超出限制
+ public static final int USER_OVER_LIMIT_FAILED_CODE = 500004;
+ public static final String USER_OVER_LIMIT_FAILED_MSG = "用户录入数量超出限制,请联系管理员";
+ //此用户名限制使用
+ public static final int USER_NAME_LIMIT_USE_CODE = 500004;
+ public static final String USER_NAME_LIMIT_USE_MSG = "此用户名限制使用";
+
+ /**
+ * 角色信息
+ * type = 10
+ * */
+ //添加角色信息失败
+ public static final int ROLE_ADD_FAILED_CODE = 1000000;
+ public static final String ROLE_ADD_FAILED_MSG = "添加角色信息失败";
+ //删除角色信息失败
+ public static final int ROLE_DELETE_FAILED_CODE = 1000001;
+ public static final String ROLE_DELETE_FAILED_MSG = "删除角色信息失败";
+ //修改角色信息失败
+ public static final int ROLE_EDIT_FAILED_CODE = 1000002;
+ public static final String ROLE_EDIT_FAILED_MSG = "修改角色信息失败";
+ /**
+ * 应用信息
+ * type = 15
+ * */
+ //添加角色信息失败
+ public static final int APP_ADD_FAILED_CODE = 1500000;
+ public static final String APP_ADD_FAILED_MSG = "添加应用信息失败";
+ //删除角色信息失败
+ public static final int APP_DELETE_FAILED_CODE = 1500001;
+ public static final String APP_DELETE_FAILED_MSG = "删除应用信息失败";
+ //修改角色信息失败
+ public static final int APP_EDIT_FAILED_CODE = 1500002;
+ public static final String APP_EDIT_FAILED_MSG = "修改应用信息失败";
+ /**
+ * 仓库信息
+ * type = 20
+ * */
+ //添加仓库信息失败
+ public static final int DEPOT_ADD_FAILED_CODE = 2000000;
+ public static final String DEPOT_ADD_FAILED_MSG = "添加仓库信息失败";
+ //删除仓库信息失败
+ public static final int DEPOT_DELETE_FAILED_CODE = 2000001;
+ public static final String DEPOT_DELETE_FAILED_MSG = "删除仓库信息失败";
+ //修改仓库信息失败
+ public static final int DEPOT_EDIT_FAILED_CODE = 2000002;
+ public static final String DEPOT_EDIT_FAILED_MSG = "修改仓库信息失败";
+
+ /**
+ * 功能模块信息
+ * type = 30
+ * */
+ //添加角色信息失败
+ public static final int FUNCTIONS_ADD_FAILED_CODE = 3000000;
+ public static final String FUNCTIONS_ADD_FAILED_MSG = "添加功能模块信息失败";
+ //删除角色信息失败
+ public static final int FUNCTIONS_DELETE_FAILED_CODE = 3000001;
+ public static final String FUNCTIONS_DELETE_FAILED_MSG = "删除功能模块信息失败";
+ //修改角色信息失败
+ public static final int FUNCTIONS_EDIT_FAILED_CODE = 3000002;
+ public static final String FUNCTIONS_EDIT_FAILED_MSG = "修改功能模块信息失败";
+ /**
+ * 收支项目信息
+ * type = 35
+ * */
+ //添加收支项目信息失败
+ public static final int IN_OUT_ITEM_ADD_FAILED_CODE = 3500000;
+ public static final String IN_OUT_ITEM_ADD_FAILED_MSG = "添加收支项目信息失败";
+ //删除收支项目信息失败
+ public static final int IN_OUT_ITEM_DELETE_FAILED_CODE = 3500001;
+ public static final String IN_OUT_ITEM_DELETE_FAILED_MSG = "删除收支项目信息失败";
+ //修改收支项目信息失败
+ public static final int IN_OUT_ITEM_EDIT_FAILED_CODE = 3500002;
+ public static final String IN_OUT_ITEM_EDIT_FAILED_MSG = "修改收支项目信息失败";
+ /**
+ * 多单位信息
+ * type = 40
+ * */
+ //添加多单位信息失败
+ public static final int UNIT_ADD_FAILED_CODE = 4000000;
+ public static final String UNIT_ADD_FAILED_MSG = "添加多单位信息失败";
+ //删除多单位信息失败
+ public static final int UNIT_DELETE_FAILED_CODE = 4000001;
+ public static final String UNIT_DELETE_FAILED_MSG = "删除多单位信息失败";
+ //修改多单位信息失败
+ public static final int UNIT_EDIT_FAILED_CODE = 4000002;
+ public static final String UNIT_EDIT_FAILED_MSG = "修改多单位信息失败";
+ /**
+ * 经手人信息
+ * type = 45
+ * */
+ //添加经手人信息失败
+ public static final int PERSON_ADD_FAILED_CODE = 4500000;
+ public static final String PERSON_ADD_FAILED_MSG = "添加经手人信息失败";
+ //删除经手人信息失败
+ public static final int PERSON_DELETE_FAILED_CODE = 4500001;
+ public static final String PERSON_DELETE_FAILED_MSG = "删除经手人信息失败";
+ //修改经手人信息失败
+ public static final int PERSON_EDIT_FAILED_CODE = 4500002;
+ public static final String PERSON_EDIT_FAILED_MSG = "修改经手人信息失败";
+ /**
+ * 用户角色模块关系信息
+ * type = 50
+ * */
+ //添加用户角色模块关系信息失败
+ public static final int USER_BUSINESS_ADD_FAILED_CODE = 5000000;
+ public static final String USER_BUSINESS_ADD_FAILED_MSG = "添加用户角色模块关系信息失败";
+ //删除用户角色模块关系信息失败
+ public static final int USER_BUSINESS_DELETE_FAILED_CODE = 5000001;
+ public static final String USER_BUSINESS_DELETE_FAILED_MSG = "删除用户角色模块关系信息失败";
+ //修改用户角色模块关系信息失败
+ public static final int USER_BUSINESS_EDIT_FAILED_CODE = 5000002;
+ public static final String USER_BUSINESS_EDIT_FAILED_MSG = "修改用户角色模块关系信息失败";
+ /**
+ * 系统参数信息
+ * type = 55
+ * */
+ //添加系统参数信息失败
+ public static final int SYSTEM_CONFIG_ADD_FAILED_CODE = 5500000;
+ public static final String SYSTEM_CONFIG_ADD_FAILED_MSG = "添加系统参数信息失败";
+ //删除系统参数信息失败
+ public static final int SYSTEM_CONFIG_DELETE_FAILED_CODE = 5500001;
+ public static final String SYSTEM_CONFIG_DELETE_FAILED_MSG = "删除系统参数信息失败";
+ //修改系统参数信息失败
+ public static final int SYSTEM_CONFIG_EDIT_FAILED_CODE = 5500002;
+ public static final String SYSTEM_CONFIG_EDIT_FAILED_MSG = "修改系统参数信息失败";
+ /**
+ * 商品扩展信息
+ * type = 60
+ * */
+ //添加商品扩展信息失败
+ public static final int MATERIAL_PROPERTY_ADD_FAILED_CODE = 6000000;
+ public static final String MATERIAL_PROPERTY_ADD_FAILED_MSG = "添加商品扩展信息失败";
+ //删除商品扩展信息失败
+ public static final int MATERIAL_PROPERTY_DELETE_FAILED_CODE = 6000001;
+ public static final String MATERIAL_PROPERTY_DELETE_FAILED_MSG = "删除商品扩展信息失败";
+ //修改商品扩展信息失败
+ public static final int MATERIAL_PROPERTY_EDIT_FAILED_CODE = 6000002;
+ public static final String MATERIAL_PROPERTY_EDIT_FAILED_MSG = "修改商品扩展信息失败";
+ /**
+ * 账户信息
+ * type = 65
+ * */
+ //添加账户信息失败
+ public static final int ACCOUNT_ADD_FAILED_CODE = 6500000;
+ public static final String ACCOUNT_ADD_FAILED_MSG = "添加账户信息失败";
+ //删除账户信息失败
+ public static final int ACCOUNT_DELETE_FAILED_CODE = 6500001;
+ public static final String ACCOUNT_DELETE_FAILED_MSG = "删除账户信息失败";
+ //修改账户信息失败
+ public static final int ACCOUNT_EDIT_FAILED_CODE = 6500002;
+ public static final String ACCOUNT_EDIT_FAILED_MSG = "修改账户信息失败";
+ /**
+ * 供应商信息
+ * type = 70
+ * */
+ //添加供应商信息失败
+ public static final int SUPPLIER_ADD_FAILED_CODE = 7000000;
+ public static final String SUPPLIER_ADD_FAILED_MSG = "添加供应商信息失败";
+ //删除供应商信息失败
+ public static final int SUPPLIER_DELETE_FAILED_CODE = 7000001;
+ public static final String SUPPLIER_DELETE_FAILED_MSG = "删除供应商信息失败";
+ //修改供应商信息失败
+ public static final int SUPPLIER_EDIT_FAILED_CODE = 7000002;
+ public static final String SUPPLIER_EDIT_FAILED_MSG = "修改供应商信息失败";
+ /**
+ * 商品类别信息
+ * type = 75
+ * */
+ //添加商品类别信息失败
+ public static final int MATERIAL_CATEGORY_ADD_FAILED_CODE = 7500000;
+ public static final String MATERIAL_CATEGORY_ADD_FAILED_MSG = "添加商品类别信息失败";
+ //删除商品类别信息失败
+ public static final int MATERIAL_CATEGORY_DELETE_FAILED_CODE = 7500001;
+ public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败";
+ //修改商品类别信息失败
+ public static final int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002;
+ public static final String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "修改商品类别信息失败";
+ //商品类别编号已存在
+ public static final int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003;
+ public static final String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在";
+ //根目录不支持修改
+ public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_CODE = 7500004;
+ public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_MSG = "根目录不支持修改";
+ //根目录不支持删除
+ public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005;
+ public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根目录不支持删除";
+ /**
+ * 商品信息
+ * type = 80
+ * */
+ //添加商品信息信息失败
+ public static final int MATERIAL_ADD_FAILED_CODE = 7500000;
+ public static final String MATERIAL_ADD_FAILED_MSG = "添加商品信息失败";
+ //删除商品信息失败
+ public static final int MATERIAL_DELETE_FAILED_CODE = 7500001;
+ public static final String MATERIAL_DELETE_FAILED_MSG = "删除商品信息失败";
+ //修改商品信息失败
+ public static final int MATERIAL_EDIT_FAILED_CODE = 7500002;
+ public static final String MATERIAL_EDIT_FAILED_MSG = "修改商品信息失败";
+ //商品信息不存在
+ public static final int MATERIAL_NOT_EXISTS_CODE = 8000000;
+ public static final String MATERIAL_NOT_EXISTS_MSG = "商品信息不存在";
+ //商品信息不唯一
+ public static final int MATERIAL_NOT_ONLY_CODE = 8000001;
+ public static final String MATERIAL_NOT_ONLY_MSG = "商品信息不唯一";
+ //该商品未开启序列号
+ public static final int MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE = 8000002;
+ public static final String MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG = "该商品未开启序列号功能";
+ //该商品已绑定序列号数量小于等于商品现有库存
+ public static final int MATERIAL_SERIAL_NUMBERE_NOT_MORE_THAN_STORAGE_CODE = 8000003;
+ public static final String MATERIAL_SERIAL_NUMBERE_NOT_MORE_THAN_STORAGE_MSG = "该商品已绑定序列号数量大于等于商品现有库存";
+ //商品库存不足
+ public static final int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004;
+ public static final String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足";
+ /**
+ * 单据信息
+ * type = 85
+ * */
+ //添加单据信息失败
+ public static final int DEPOT_HEAD_ADD_FAILED_CODE = 8500000;
+ public static final String DEPOT_HEAD_ADD_FAILED_MSG = "添加单据信息失败";
+ //删除单据信息失败
+ public static final int DEPOT_HEAD_DELETE_FAILED_CODE = 8500001;
+ public static final String DEPOT_HEAD_DELETE_FAILED_MSG = "删除单据信息失败";
+ //修改单据信息失败
+ public static final int DEPOT_HEAD_EDIT_FAILED_CODE = 8500002;
+ public static final String DEPOT_HEAD_EDIT_FAILED_MSG = "修改单据信息失败";
+ //单据录入数量超出限制
+ public static final int DEPOT_HEAD_OVER_LIMIT_FAILED_CODE = 8500003;
+ public static final String DEPOT_HEAD_OVER_LIMIT_FAILED_MSG = "单据录入数量超出限制,请联系管理员";
+ //单据录入-仓库不能为空
+ public static final int DEPOT_HEAD_DEPOT_FAILED_CODE = 8500004;
+ public static final String DEPOT_HEAD_DEPOT_FAILED_MSG = "仓库不能为空";
+ //单据录入-调入仓库不能为空
+ public static final int DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE = 8500005;
+ public static final String DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG = "调入仓库不能为空";
+ /**
+ * 单据明细信息
+ * type = 90
+ * */
+ //添加单据明细信息失败
+ public static final int DEPOT_ITEM_ADD_FAILED_CODE = 9000000;
+ public static final String DEPOT_ITEM_ADD_FAILED_MSG = "添加单据明细信息失败";
+ //删除单据明细信息失败
+ public static final int DEPOT_ITEM_DELETE_FAILED_CODE = 9000001;
+ public static final String DEPOT_ITEM_DELETE_FAILED_MSG = "删除单据明细信息失败";
+ //修改单据明细信息失败
+ public static final int DEPOT_ITEM_EDIT_FAILED_CODE = 9000002;
+ public static final String DEPOT_ITEM_EDIT_FAILED_MSG = "修改单据明细信息失败";
+ /**
+ * 财务信息
+ * type = 95
+ * */
+ //添加财务信息失败
+ public static final int ACCOUNT_HEAD_ADD_FAILED_CODE = 9500000;
+ public static final String ACCOUNT_HEAD_ADD_FAILED_MSG = "添加财务信息失败";
+ //删除财务信息失败
+ public static final int ACCOUNT_HEAD_DELETE_FAILED_CODE = 9500001;
+ public static final String ACCOUNT_HEAD_DELETE_FAILED_MSG = "删除财务信息失败";
+ //修改财务信息失败
+ public static final int ACCOUNT_HEAD_EDIT_FAILED_CODE = 9500002;
+ public static final String ACCOUNT_HEAD_EDIT_FAILED_MSG = "修改财务信息失败";
+ /**
+ * 财务明细信息
+ * type = 100
+ * */
+ //添加财务明细信息失败
+ public static final int ACCOUNT_ITEM_ADD_FAILED_CODE = 10000000;
+ public static final String ACCOUNT_ITEM_ADD_FAILED_MSG = "添加财务明细信息失败";
+ //删除财务明细信息失败
+ public static final int ACCOUNT_ITEM_DELETE_FAILED_CODE = 10000001;
+ public static final String ACCOUNT_ITEM_DELETE_FAILED_MSG = "删除财务明细信息失败";
+ //修改财务明细信息失败
+ public static final int ACCOUNT_ITEM_EDIT_FAILED_CODE = 10000002;
+ public static final String ACCOUNT_ITEM_EDIT_FAILED_MSG = "修改财务明细信息失败";
+ /**
+ * 序列号
+ * type = 105
+ * */
+ /**序列号已存在*/
+ public static final int SERIAL_NUMBERE_ALREADY_EXISTS_CODE = 10500000;
+ public static final String SERIAL_NUMBERE_ALREADY_EXISTS_MSG = "序列号已存在";
+ /**序列号不能为为空*/
+ public static final int SERIAL_NUMBERE_NOT_BE_EMPTY_CODE = 10500001;
+ public static final String SERIAL_NUMBERE_NOT_BE_EMPTY_MSG = "序列号不能为为空";
+ /**商品%s下序列号不充足,请补充后重试*/
+ public static final int MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE = 10500002;
+ public static final String MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG = "商品:%s下序列号不充足,请补充后重试";
+ /**删序列号信息失败*/
+ public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003;
+ public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败";
+ /**
+ * 机构信息
+ * type = 110
+ * */
+ //添加机构信息失败
+ public static final int ORGANIZATION_ADD_FAILED_CODE = 11000000;
+ public static final String ORGANIZATION_ADD_FAILED_MSG = "添加机构信息失败";
+ //删除机构信息失败
+ public static final int ORGANIZATION_DELETE_FAILED_CODE = 11000001;
+ public static final String ORGANIZATION_DELETE_FAILED_MSG = "删除机构信息失败";
+ //修改机构信息失败
+ public static final int ORGANIZATION_EDIT_FAILED_CODE = 11000002;
+ public static final String ORGANIZATION_EDIT_FAILED_MSG = "修改机构信息失败";
+ //机构编号已存在
+ public static final int ORGANIZATION_NO_ALREADY_EXISTS_CODE = 11000003;
+ public static final String ORGANIZATION_NO_ALREADY_EXISTS_MSG = "机构编号已存在";
+ //根机构不允许删除
+ public static final int ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_CODE = 11000004;
+ public static final String ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_MSG = "根机构不允许删除";
+ //根机构不允许修改
+ public static final int ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE = 11000005;
+ public static final String ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG = "根机构不允许修改";
+ /**
+ * 机构用户关联关系
+ * type = 115
+ * */
+ //添加机构用户关联关系失败
+ public static final int ORGA_USER_REL_ADD_FAILED_CODE = 11500000;
+ public static final String ORGA_USER_REL_ADD_FAILED_MSG = "添加机构用户关联关系失败";
+ //删除机构用户关联关系失败
+ public static final int ORGA_USER_REL_DELETE_FAILED_CODE = 11500001;
+ public static final String ORGA_USER_REL_DELETE_FAILED_MSG = "删除机构用户关联关系失败";
+ //修改机构用户关联关系失败
+ public static final int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002;
+ public static final String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败";
+
+ //演示用户禁止操作
+ public static final int SYSTEM_CONFIG_TEST_USER_CODE = -1;
+ public static final String SYSTEM_CONFIG_TEST_USER_MSG = "演示用户禁止操作";
+
+
+ /**
+ * 标准正常返回/操作成功返回
+ * @return
+ */
+ public static JSONObject standardSuccess () {
+ JSONObject success = new JSONObject();
+ success.put(GLOBAL_RETURNS_CODE, SERVICE_SUCCESS_CODE);
+ success.put(GLOBAL_RETURNS_MESSAGE, SERVICE_SUCCESS_MSG);
+ return success;
+ }
+
+ public static JSONObject standardErrorUserOver () {
+ JSONObject success = new JSONObject();
+ success.put(GLOBAL_RETURNS_CODE, USER_OVER_LIMIT_FAILED_CODE);
+ success.put(GLOBAL_RETURNS_MESSAGE, USER_OVER_LIMIT_FAILED_MSG);
+ return success;
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountController.java
new file mode 100644
index 000000000..996454c06
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountController.java
@@ -0,0 +1,166 @@
+package com.jsh.erp.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.constants.BusinessConstants;
+import com.jsh.erp.constants.ExceptionConstants;
+import com.jsh.erp.datasource.entities.Account;
+import com.jsh.erp.datasource.vo.AccountVo4InOutList;
+import com.jsh.erp.datasource.vo.AccountVo4List;
+import com.jsh.erp.exception.BusinessRunTimeException;
+import com.jsh.erp.service.account.AccountService;
+import com.jsh.erp.utils.BaseResponseInfo;
+import com.jsh.erp.utils.ErpInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
+
+/**
+ * @author jishenghua 75271*8920
+ */
+@RestController
+@RequestMapping(value = "/account")
+public class AccountController {
+ private Logger logger = LoggerFactory.getLogger(AccountController.class);
+
+ @Resource
+ private AccountService accountService;
+
+ /**
+ * 查找结算账户信息-下拉框
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findBySelect")
+ public String findBySelect(HttpServletRequest request) throws Exception {
+ String res = null;
+ try {
+ List dataList = accountService.findBySelect();
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if (null != dataList) {
+ for (Account account : dataList) {
+ JSONObject item = new JSONObject();
+ item.put("Id", account.getId());
+ //结算账户名称
+ item.put("AccountName", account.getName());
+ dataArray.add(item);
+ }
+ }
+ res = dataArray.toJSONString();
+ } catch(Exception e){
+ e.printStackTrace();
+ res = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 获取所有结算账户
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/getAccount")
+ public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ List accountList = accountService.getAccount();
+ map.put("accountList", accountList);
+ res.code = 200;
+ res.data = map;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 账户流水信息
+ * @param currentPage
+ * @param pageSize
+ * @param accountId
+ * @param initialAmount
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findAccountInOutList")
+ public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Integer currentPage,
+ @RequestParam("pageSize") Integer pageSize,
+ @RequestParam("accountId") Long accountId,
+ @RequestParam("initialAmount") BigDecimal initialAmount,
+ HttpServletRequest request) throws Exception{
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ List dataList = accountService.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize);
+ int total = accountService.findAccountInOutListCount(accountId);
+ map.put("total", total);
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if (null != dataList) {
+ for (AccountVo4InOutList aEx : dataList) {
+ String timeStr = aEx.getOperTime().toString();
+ BigDecimal balance = accountService.getAccountSum(accountId, timeStr, "date").add(accountService.getAccountSumByHead(accountId, timeStr, "date"))
+ .add(accountService.getAccountSumByDetail(accountId, timeStr, "date")).add(accountService.getManyAccountSum(accountId, timeStr, "date")).add(initialAmount);
+ aEx.setBalance(balance);
+ dataArray.add(aEx);
+ }
+ }
+ map.put("rows", dataArray);
+ res.code = 200;
+ res.data = map;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ @PostMapping(value = "/updateIsDefault")
+ public String updateIsDefault(@RequestBody JSONObject object,
+ HttpServletRequest request) throws Exception{
+ Long accountId = object.getLong("id");
+ Map objectMap = new HashMap<>();
+ int res = accountService.updateIsDefault(accountId);
+ if(res > 0) {
+ return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
+ } else {
+ return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
+ }
+ }
+
+ /**
+ * 结算账户的统计
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/getStatistics")
+ public BaseResponseInfo getStatistics(@RequestParam("name") String name,
+ @RequestParam("serialNo") String serialNo,
+ HttpServletRequest request) throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ try {
+ Map map = accountService.getStatistics(name, serialNo);
+ res.code = 200;
+ res.data = map;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java
new file mode 100644
index 000000000..1573967f8
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java
@@ -0,0 +1,117 @@
+package com.jsh.erp.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.constants.ExceptionConstants;
+import com.jsh.erp.datasource.entities.AccountHeadVo4Body;
+import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
+import com.jsh.erp.service.accountHead.AccountHeadService;
+import com.jsh.erp.utils.BaseResponseInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author jishenghua 752*718*920
+ */
+@RestController
+@RequestMapping(value = "/accountHead")
+public class AccountHeadController {
+ private Logger logger = LoggerFactory.getLogger(AccountHeadController.class);
+
+ @Resource
+ private AccountHeadService accountHeadService;
+
+ /**
+ * 新增财务主表及财务子表信息
+ * @param body
+ * @param request
+ * @return
+ * @throws Exception
+ */
+ @PostMapping(value = "/addAccountHeadAndDetail")
+ public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
+ JSONObject result = ExceptionConstants.standardSuccess();
+ String beanJson = body.getInfo();
+ String rows = body.getRows();
+ accountHeadService.addAccountHeadAndDetail(beanJson,rows, request);
+ return result;
+ }
+
+ /**
+ * 更新财务主表及财务子表信息
+ * @param body
+ * @param request
+ * @return
+ * @throws Exception
+ */
+ @PutMapping(value = "/updateAccountHeadAndDetail")
+ public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
+ JSONObject result = ExceptionConstants.standardSuccess();
+ String beanJson = body.getInfo();
+ String rows = body.getRows();
+ accountHeadService.updateAccountHeadAndDetail(beanJson,rows,request);
+ return result;
+ }
+
+ /**
+ * 查询单位的累计应收和累计应付,收预付款不计入此处
+ * @param supplierId
+ * @param endTime
+ * @param supType
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findTotalPay")
+ public BaseResponseInfo findTotalPay(@RequestParam("supplierId") Integer supplierId,
+ @RequestParam("endTime") String endTime,
+ @RequestParam("supType") String supType,
+ HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ JSONObject outer = new JSONObject();
+ BigDecimal sum = accountHeadService.findTotalPay(supplierId, endTime, supType);
+ outer.put("getAllMoney", sum);
+ map.put("rows", outer);
+ res.code = 200;
+ res.data = map;
+ } catch (Exception e) {
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 根据编号查询单据信息
+ * @param billNo
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/getDetailByNumber")
+ public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo,
+ HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ AccountHeadVo4ListEx ahl = new AccountHeadVo4ListEx();
+ try {
+ List list = accountHeadService.getDetailByNumber(billNo);
+ if(list.size() == 1) {
+ ahl = list.get(0);
+ }
+ res.code = 200;
+ res.data = ahl;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountItemController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountItemController.java
new file mode 100644
index 000000000..2e6e22c62
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountItemController.java
@@ -0,0 +1,70 @@
+package com.jsh.erp.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.datasource.vo.AccountItemVo4List;
+import com.jsh.erp.service.accountItem.AccountItemService;
+import com.jsh.erp.utils.BaseResponseInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author ji sheng hua 752*718*920
+ */
+@RestController
+@RequestMapping(value = "/accountItem")
+public class AccountItemController {
+ private Logger logger = LoggerFactory.getLogger(AccountItemController.class);
+
+ @Resource
+ private AccountItemService accountItemService;
+
+ @GetMapping(value = "/getDetailList")
+ public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
+ HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ try {
+ List dataList = new ArrayList<>();
+ if(headerId != 0) {
+ dataList = accountItemService.getDetailList(headerId);
+ }
+ JSONObject outer = new JSONObject();
+ outer.put("total", dataList.size());
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if (null != dataList) {
+ for (AccountItemVo4List ai : dataList) {
+ JSONObject item = new JSONObject();
+ item.put("accountId", ai.getAccountId());
+ item.put("accountName", ai.getAccountName());
+ item.put("inOutItemId", ai.getInOutItemId());
+ item.put("inOutItemName", ai.getInOutItemName());
+ BigDecimal eachAmount = ai.getEachAmount();
+ item.put("eachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount);
+ item.put("remark", ai.getRemark());
+ dataArray.add(item);
+ }
+ }
+ outer.put("rows", dataArray);
+ res.code = 200;
+ res.data = outer;
+ } catch (Exception e) {
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotController.java
new file mode 100644
index 000000000..195fdbd86
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotController.java
@@ -0,0 +1,193 @@
+package com.jsh.erp.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.constants.BusinessConstants;
+import com.jsh.erp.constants.ExceptionConstants;
+import com.jsh.erp.datasource.entities.Depot;
+import com.jsh.erp.datasource.entities.DepotEx;
+import com.jsh.erp.exception.BusinessRunTimeException;
+import com.jsh.erp.service.depot.DepotService;
+import com.jsh.erp.service.material.MaterialService;
+import com.jsh.erp.service.systemConfig.SystemConfigService;
+import com.jsh.erp.service.userBusiness.UserBusinessService;
+import com.jsh.erp.utils.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DataAccessException;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.*;
+
+import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
+
+/**
+ * @author ji sheng hua 752*718*920
+ */
+@RestController
+@RequestMapping(value = "/depot")
+public class DepotController {
+ private Logger logger = LoggerFactory.getLogger(DepotController.class);
+
+ @Resource
+ private DepotService depotService;
+
+ @Resource
+ private UserBusinessService userBusinessService;
+
+ @Resource
+ private SystemConfigService systemConfigService;
+
+ @Resource
+ private MaterialService materialService;
+
+ @GetMapping(value = "/getAllList")
+ public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
+ BaseResponseInfo res = new BaseResponseInfo();
+ try {
+ List depotList = depotService.getAllList();
+ res.code = 200;
+ res.data = depotList;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 用户对应仓库显示
+ * @param type
+ * @param keyId
+ * @param request
+ * @return
+ */
+ @PostMapping(value = "/findUserDepot")
+ public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
+ HttpServletRequest request) throws Exception{
+ JSONArray arr = new JSONArray();
+ try {
+ List dataList = depotService.findUserDepot();
+ //开始拼接json数据
+ JSONObject outer = new JSONObject();
+ outer.put("id", 1);
+ outer.put("text", "仓库列表");
+ outer.put("state", "open");
+ //存放数据json数组
+ JSONArray dataArray = new JSONArray();
+ if (null != dataList) {
+ for (Depot depot : dataList) {
+ JSONObject item = new JSONObject();
+ item.put("id", depot.getId());
+ item.put("text", depot.getName());
+ //勾选判断1
+ Boolean flag = false;
+ try {
+ flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + depot.getId().toString() + "]");
+ } catch (Exception e) {
+ logger.error(">>>>>>>>>>>>>>>>>设置用户对应的仓库:类型" + type + " KeyId为: " + keyId + " 存在异常!");
+ }
+ if (flag == true) {
+ item.put("checked", true);
+ }
+ //结束
+ dataArray.add(item);
+ }
+ }
+ outer.put("children", dataArray);
+ arr.add(outer);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return arr;
+ }
+
+ /**
+ * 获取用户拥有权限的仓库列表
+ * @param type
+ * @param keyId
+ * @param request
+ * @return
+ * @throws Exception
+ */
+ @GetMapping(value = "/findDepotByUserId")
+ public JSONArray findDepotByUserId(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
+ HttpServletRequest request) throws Exception{
+ JSONArray arr = new JSONArray();
+ try {
+ List dataList = depotService.findUserDepot();
+ //开始拼接json数据
+ if (null != dataList) {
+ boolean depotFlag = systemConfigService.getDepotFlag();
+ for (Depot depot : dataList) {
+ JSONObject item = new JSONObject();
+ //勾选判断1
+ Boolean flag = false;
+ try {
+ flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + depot.getId().toString() + "]");
+ } catch (DataAccessException e) {
+ logger.error(">>>>>>>>>>>>>>>>>查询用户对应的仓库:类型" + type + " KeyId为: " + keyId + " 存在异常!");
+ }
+ if (!depotFlag || flag) {
+ item.put("id", depot.getId());
+ item.put("depotName", depot.getName());
+ arr.add(item);
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return arr;
+ }
+
+ @PostMapping(value = "/updateIsDefault")
+ public String updateIsDefault(@RequestBody JSONObject object,
+ HttpServletRequest request) throws Exception{
+ Long depotId = object.getLong("id");
+ Map objectMap = new HashMap<>();
+ int res = depotService.updateIsDefault(depotId);
+ if(res > 0) {
+ return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
+ } else {
+ return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
+ }
+ }
+
+ @GetMapping(value = "/getAllListWithStock")
+ public BaseResponseInfo getAllList(@RequestParam("mId") Long mId,
+ HttpServletRequest request) {
+ BaseResponseInfo res = new BaseResponseInfo();
+ try {
+ List list = depotService.getAllList();
+ List depotList = new ArrayList();
+ for(Depot depot: list) {
+ DepotEx de = new DepotEx();
+ if(mId!=0) {
+ BigDecimal initStock = materialService.getInitStock(mId, depot.getId());
+ BigDecimal currentStock = materialService.getCurrentStock(mId, depot.getId());
+ de.setInitStock(initStock);
+ de.setCurrentStock(currentStock);
+ } else {
+ de.setInitStock(BigDecimal.ZERO);
+ de.setCurrentStock(BigDecimal.ZERO);
+ }
+ de.setId(depot.getId());
+ de.setName(depot.getName());
+ depotList.add(de);
+ }
+ res.code = 200;
+ res.data = depotList;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java
new file mode 100644
index 000000000..7beb23944
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java
@@ -0,0 +1,420 @@
+package com.jsh.erp.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.constants.ExceptionConstants;
+import com.jsh.erp.datasource.entities.DepotHead;
+import com.jsh.erp.datasource.entities.DepotHeadVo4Body;
+import com.jsh.erp.datasource.vo.DepotHeadVo4InDetail;
+import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount;
+import com.jsh.erp.datasource.vo.DepotHeadVo4List;
+import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
+import com.jsh.erp.exception.BusinessParamCheckingException;
+import com.jsh.erp.service.depotHead.DepotHeadService;
+import com.jsh.erp.service.log.LogService;
+import com.jsh.erp.service.redis.RedisService;
+import com.jsh.erp.utils.BaseResponseInfo;
+import com.jsh.erp.utils.ErpInfo;
+import com.jsh.erp.utils.StringUtil;
+import com.jsh.erp.utils.Tools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.sql.Date;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
+import static com.jsh.erp.utils.Tools.getNow3;
+
+/**
+ * @author ji-sheng-hua 752*718*920
+ */
+@RestController
+@RequestMapping(value = "/depotHead")
+public class DepotHeadController {
+ private Logger logger = LoggerFactory.getLogger(DepotHeadController.class);
+
+ @Resource
+ private DepotHeadService depotHeadService;
+
+ @Resource
+ private RedisService redisService;
+
+ /**
+ * 批量设置状态-审核或者反审核
+ * @param jsonObject
+ * @param request
+ * @return
+ */
+ @PostMapping(value = "/batchSetStatus")
+ public String batchSetStatus(@RequestBody JSONObject jsonObject,
+ HttpServletRequest request) throws Exception{
+ Map objectMap = new HashMap<>();
+ String status = jsonObject.getString("status");
+ String ids = jsonObject.getString("ids");
+ int res = depotHeadService.batchSetStatus(status, ids);
+ if(res > 0) {
+ return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
+ } else {
+ return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
+ }
+ }
+
+ /**
+ * 入库出库明细接口
+ * @param currentPage
+ * @param pageSize
+ * @param oId
+ * @param materialParam
+ * @param depotId
+ * @param beginTime
+ * @param endTime
+ * @param type
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findInDetail")
+ public BaseResponseInfo findInDetail(@RequestParam("currentPage") Integer currentPage,
+ @RequestParam("pageSize") Integer pageSize,
+ @RequestParam("organId") Integer oId,
+ @RequestParam("materialParam") String materialParam,
+ @RequestParam("depotId") Integer depotId,
+ @RequestParam("beginTime") String beginTime,
+ @RequestParam("endTime") String endTime,
+ @RequestParam("type") String type,
+ HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ List resList = new ArrayList();
+ List list = depotHeadService.findByAll(beginTime, endTime, type, materialParam, depotId, oId, (currentPage-1)*pageSize, pageSize);
+ int total = depotHeadService.findByAllCount(beginTime, endTime, type, materialParam, depotId, oId);
+ map.put("total", total);
+ //存放数据json数组
+ if (null != list) {
+ for (DepotHeadVo4InDetail dhd : list) {
+ resList.add(dhd);
+ }
+ }
+ map.put("rows", resList);
+ res.code = 200;
+ res.data = map;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 入库出库统计接口
+ * @param currentPage
+ * @param pageSize
+ * @param oId
+ * @param materialParam
+ * @param depotId
+ * @param beginTime
+ * @param endTime
+ * @param type
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findInOutMaterialCount")
+ public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage,
+ @RequestParam("pageSize") Integer pageSize,
+ @RequestParam("organId") Integer oId,
+ @RequestParam("materialParam") String materialParam,
+ @RequestParam("depotId") Integer depotId,
+ @RequestParam("beginTime") String beginTime,
+ @RequestParam("endTime") String endTime,
+ @RequestParam("type") String type,
+ HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ List resList = new ArrayList<>();
+ List list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, materialParam, depotId, oId, (currentPage-1)*pageSize, pageSize);
+ int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, materialParam, depotId, oId);
+ map.put("total", total);
+ //存放数据json数组
+ if (null != list) {
+ for (DepotHeadVo4InOutMCount dhc : list) {
+ resList.add(dhc);
+ }
+ }
+ map.put("rows", resList);
+ res.code = 200;
+ res.data = map;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 对账单接口
+ * @param currentPage
+ * @param pageSize
+ * @param beginTime
+ * @param endTime
+ * @param organId
+ * @param supType
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findStatementAccount")
+ public BaseResponseInfo findStatementAccount(@RequestParam("currentPage") Integer currentPage,
+ @RequestParam("pageSize") Integer pageSize,
+ @RequestParam("beginTime") String beginTime,
+ @RequestParam("endTime") String endTime,
+ @RequestParam("organId") Integer organId,
+ @RequestParam("supType") String supType,
+ HttpServletRequest request) throws Exception{
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ int j = 1;
+ if (supType.equals("客户")) { //客户
+ j = 1;
+ } else if (supType.equals("供应商")) { //供应商
+ j = -1;
+ }
+ List resList = new ArrayList();
+ List list = depotHeadService.findStatementAccount(beginTime, endTime, organId, supType, (currentPage-1)*pageSize, pageSize);
+ int total = depotHeadService.findStatementAccountCount(beginTime, endTime, organId, supType);
+ map.put("total", total);
+ //存放数据json数组
+ if (null != list) {
+ for (DepotHeadVo4StatementAccount dha : list) {
+ dha.setNumber(dha.getNumber()); //单据编号
+ dha.setType(dha.getType()); //类型
+ String type = dha.getType();
+ BigDecimal p1 = BigDecimal.ZERO ;
+ BigDecimal p2 = BigDecimal.ZERO;
+ if (dha.getDiscountLastMoney() != null) {
+ p1 = dha.getDiscountLastMoney();
+ }
+ if (dha.getChangeAmount() != null) {
+ p2 = dha.getChangeAmount();
+ }
+ BigDecimal allPrice = BigDecimal.ZERO;
+ if ((p1.compareTo(BigDecimal.ZERO))==-1) {
+ p1 = p1.abs();
+ }
+ if(dha.getOtherMoney()!=null) {
+ p1 = p1.add(dha.getOtherMoney()); //与其它费用相加
+ }
+ if ((p2 .compareTo(BigDecimal.ZERO))==-1) {
+ p2 = p2.abs();
+ }
+ if (type.equals("采购入库")) {
+ allPrice = p2.subtract(p1);
+ } else if (type.equals("销售退货入库")) {
+ allPrice = p2.subtract(p1);
+ } else if (type.equals("销售出库")) {
+ allPrice = p1.subtract(p2);
+ } else if (type.equals("采购退货出库")) {
+ allPrice = p1.subtract(p2);
+ } else if (type.equals("付款")) {
+ allPrice = p1.add(p2);
+ } else if (type.equals("收款")) {
+ allPrice = BigDecimal.ZERO.subtract(p1.add(p2));
+ } else if (type.equals("收入")) {
+ allPrice = p1.subtract(p2);
+ } else if (type.equals("支出")) {
+ allPrice = p2.subtract(p1);
+ }
+ dha.setBillMoney(p1); //单据金额
+ dha.setChangeAmount(p2); //实际支付
+ DecimalFormat df = new DecimalFormat(".##");
+ dha.setAllPrice(new BigDecimal(df.format(allPrice.multiply(new BigDecimal(j))))); //本期变化
+ dha.setSupplierName(dha.getSupplierName()); //单位名称
+ dha.setoTime(dha.getoTime()); //单据日期
+ resList.add(dha);
+ }
+ }
+ map.put("rows", resList);
+ res.code = 200;
+ res.data = map;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 查询单位的累计应收和累计应付,零售不能计入
+ * @param supplierId
+ * @param endTime
+ * @param supType
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findTotalPay")
+ public BaseResponseInfo findTotalPay(@RequestParam("supplierId") Integer supplierId,
+ @RequestParam("endTime") String endTime,
+ @RequestParam("supType") String supType,
+ HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ JSONObject outer = new JSONObject();
+ BigDecimal sum = depotHeadService.findTotalPay(supplierId, endTime, supType);
+ outer.put("getAllMoney", sum);
+ map.put("rows", outer);
+ res.code = 200;
+ res.data = map;
+ } catch (Exception e) {
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 根据编号查询单据信息
+ * @param number
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/getDetailByNumber")
+ public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number,
+ HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ DepotHeadVo4List dhl = new DepotHeadVo4List();
+ try {
+ List list = depotHeadService.getDetailByNumber(number);
+ if(list.size() == 1) {
+ dhl = list.get(0);
+ }
+ res.code = 200;
+ res.data = dhl;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 新增单据主表及单据子表信息
+ * @param body
+ * @param request
+ * @return
+ * @throws Exception
+ */
+ @PostMapping(value = "/addDepotHeadAndDetail")
+ public Object addDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
+ JSONObject result = ExceptionConstants.standardSuccess();
+ String beanJson = body.getInfo();
+ String rows = body.getRows();
+ Long billsNumLimit = Long.parseLong(redisService.getObjectFromSessionByKey(request,"billsNumLimit").toString());
+ Long tenantId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"tenantId").toString());
+ Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null,null,null);
+ if(count>= billsNumLimit) {
+ throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
+ ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
+ } else {
+ depotHeadService.addDepotHeadAndDetail(beanJson,rows,tenantId, request);
+ }
+ return result;
+ }
+
+ /**
+ * 更新单据主表及单据子表信息
+ * @param body
+ * @param request
+ * @return
+ * @throws Exception
+ */
+ @PutMapping(value = "/updateDepotHeadAndDetail")
+ public Object updateDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
+ Long tenantId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"tenantId").toString());
+ JSONObject result = ExceptionConstants.standardSuccess();
+ String beanJson = body.getInfo();
+ String rows = body.getRows();
+ BigDecimal preTotalPrice = body.getPreTotalPrice();
+ depotHeadService.updateDepotHeadAndDetail(beanJson,rows,preTotalPrice,tenantId,request);
+ return result;
+ }
+
+ /**
+ * 统计今日销售额、今日进货额、本月销售额、本月进货额
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/getBuyAndSaleStatistics")
+ public BaseResponseInfo getBuyAndSaleStatistics(HttpServletRequest request) {
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ String today = Tools.getNow() + " 00:00:00";
+ String firstDay = Tools.getCurrentMonth() + "-01 00:00:00";
+ BigDecimal todaySale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
+ 1, today, getNow3()); //今日销售出库
+ BigDecimal todayRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "零售",
+ 0, today, getNow3()); //今日零售出库
+ BigDecimal todayBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购",
+ 1, today, getNow3()); //今日采购入库
+ BigDecimal monthSale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
+ 1,firstDay, getNow3()); //本月销售出库
+ BigDecimal monthRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "零售",
+ 0,firstDay, getNow3()); //本月零售出库
+ BigDecimal monthBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购",
+ 1, firstDay, getNow3()); //本月采购入库
+ map.put("todaySale", todaySale.add(todayRetailSale));
+ map.put("todayBuy", todayBuy);
+ map.put("thisMonthSale", monthSale.add(monthRetailSale));
+ map.put("thisMonthBuy", monthBuy);
+ res.code = 200;
+ res.data = map;
+ } catch(Exception e){
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+
+ /**
+ * 根据当前用户获取操作员数组,用于控制当前用户的数据权限,限制可以看到的单据范围
+ * 注意:该接口提供给部分插件使用,勿删
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/getCreatorByCurrentUser")
+ public BaseResponseInfo getCreatorByRoleType(HttpServletRequest request) {
+ BaseResponseInfo res = new BaseResponseInfo();
+ Map map = new HashMap();
+ try {
+ String creator = "";
+ String roleType = redisService.getObjectFromSessionByKey(request,"roleType").toString();
+ if(StringUtil.isNotEmpty(roleType)) {
+ creator = depotHeadService.getCreatorByRoleType(roleType);
+ }
+ res.code = 200;
+ res.data = creator;
+ } catch (Exception e) {
+ e.printStackTrace();
+ res.code = 500;
+ res.data = "获取数据失败";
+ }
+ return res;
+ }
+}
diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
new file mode 100644
index 000000000..fbc006bf4
--- /dev/null
+++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
@@ -0,0 +1,698 @@
+package com.jsh.erp.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.constants.BusinessConstants;
+import com.jsh.erp.constants.ExceptionConstants;
+import com.jsh.erp.datasource.entities.*;
+import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
+import com.jsh.erp.exception.BusinessRunTimeException;
+import com.jsh.erp.service.materialExtend.MaterialExtendService;
+import com.jsh.erp.service.depotItem.DepotItemService;
+import com.jsh.erp.service.material.MaterialService;
+import com.jsh.erp.service.redis.RedisService;
+import com.jsh.erp.service.unit.UnitService;
+import com.jsh.erp.utils.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
+
+/**
+ * @author ji-sheng-hua 华夏erp
+ */
+@RestController
+@RequestMapping(value = "/depotItem")
+public class DepotItemController {
+ private Logger logger = LoggerFactory.getLogger(DepotItemController.class);
+
+ @Resource
+ private DepotItemService depotItemService;
+
+ @Resource
+ private MaterialService materialService;
+
+ @Resource
+ private MaterialExtendService materialExtendService;
+
+ @Resource
+ private UnitService unitService;
+
+ @Resource
+ private RedisService redisService;
+
+ /**
+ * 只根据商品id查询单据列表
+ * @param mId
+ * @param request
+ * @return
+ */
+ @GetMapping(value = "/findDetailByTypeAndMaterialId")
+ public String findDetailByTypeAndMaterialId(
+ @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
+ @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
+ @RequestParam("materialId") String mId, HttpServletRequest request)throws Exception {
+ Map parameterMap = ParamUtils.requestToMap(request);
+ parameterMap.put("mId", mId);
+ PageQueryInfo queryInfo = new PageQueryInfo();
+ Map objectMap = new HashMap();
+ if (pageSize != null && pageSize <= 0) {
+ pageSize = 10;
+ }
+ String offset = ParamUtils.getPageOffset(currentPage, pageSize);
+ if (StringUtil.isNotEmpty(offset)) {
+ parameterMap.put(Constants.OFFSET, offset);
+ }
+ List list = depotItemService.findDetailByTypeAndMaterialIdList(parameterMap);
+ JSONArray dataArray = new JSONArray();
+ if (list != null) {
+ for (DepotItemVo4DetailByTypeAndMId d: list) {
+ JSONObject item = new JSONObject();
+ item.put("Number", d.getNumber()); //商品编号
+ String type = d.getType();
+ String subType = d.getSubType();
+ if(("其它").equals(type)) {
+ item.put("Type", subType); //进出类型
+ } else {
+ item.put("Type", subType + type); //进出类型
+ }
+ item.put("depotName", d.getDepotName()); //仓库名称
+ item.put("BasicNumber", d.getBnum()); //数量
+ item.put("OperTime", d.getOtime().getTime()); //时间
+ dataArray.add(item);
+ }
+ }
+ objectMap.put("page", queryInfo);
+ if (list == null) {
+ queryInfo.setRows(new ArrayList