From c7180a0d0d47a9218c4b6b12bbd4386aa61cecd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 4 Sep 2020 01:20:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=92=E8=89=B2=E5=92=8C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/jsh_erp.sql | 113 +++++++++--------- erp_web/js/pages/manage/pushBtn.json | 16 ++- erp_web/js/pages/materials/in_out.js | 22 +++- erp_web/pages/manage/functions.html | 2 +- erp_web/pages/manage/role.html | 36 ++++-- erp_web/pages/manage/rolePushBtn.html | 38 +++++- erp_web/pages/manage/user.html | 6 +- .../erp/controller/DepotHeadController.java | 2 +- .../jsh/erp/controller/UserController.java | 17 +++ .../datasource/mappers/DepotHeadMapperEx.java | 2 + .../service/depotHead/DepotHeadComponent.java | 6 +- .../service/depotHead/DepotHeadService.java | 20 +++- .../com/jsh/erp/service/user/UserService.java | 39 +++++- .../mapper_xml/DepotHeadMapperEx.xml | 6 + 14 files changed, 236 insertions(+), 89 deletions(-) diff --git a/docs/jsh_erp.sql b/docs/jsh_erp.sql index 5b9117ae..c320699d 100644 --- a/docs/jsh_erp.sql +++ b/docs/jsh_erp.sql @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50704 File Encoding : 65001 -Date: 2020-07-23 22:43:43 +Date: 2020-09-04 01:18:11 */ SET FOREIGN_KEY_CHECKS=0; @@ -30,7 +30,7 @@ CREATE TABLE `jsh_account` ( `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户信息'; +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='账户信息'; -- ---------------------------- -- Records of jsh_account @@ -316,69 +316,69 @@ CREATE TABLE `jsh_function` ( `icon` varchar(50) DEFAULT NULL COMMENT '图标', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='功能模块表'; +) ENGINE=InnoDB AUTO_INCREMENT=246 DEFAULT CHARSET=utf8 COMMENT='功能模块表'; -- ---------------------------- -- Records of jsh_function -- ---------------------------- INSERT INTO `jsh_function` VALUES ('1', '0001', '系统管理', '0', '', '', '0910', '', '电脑版', '', 'icon-settings', '0'); -INSERT INTO `jsh_function` VALUES ('13', '000102', '角色管理', '0001', '/pages/manage/role.html', '\0', '0130', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('14', '000103', '用户管理', '0001', '/pages/manage/user.html', '\0', '0140', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('15', '000104', '日志管理', '0001', '/pages/manage/log.html', '\0', '0160', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('16', '000105', '功能管理', '0001', '/pages/manage/functions.html', '\0', '0135', '', '电脑版', null, 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('13', '000102', '角色管理', '0001', '/pages/manage/role.html', '\0', '0130', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('14', '000103', '用户管理', '0001', '/pages/manage/user.html', '\0', '0140', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('15', '000104', '日志管理', '0001', '/pages/manage/log.html', '\0', '0160', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('16', '000105', '功能管理', '0001', '/pages/manage/functions.html', '\0', '0135', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('21', '0101', '商品管理', '0', '', '\0', '0620', '', '电脑版', null, 'icon-social-dropbox', '0'); -INSERT INTO `jsh_function` VALUES ('22', '010101', '商品类别', '0101', '/pages/materials/materialcategory.html', '\0', '0230', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('23', '010102', '商品信息', '0101', '/pages/materials/material.html', '\0', '0240', '', '电脑版', null, 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('22', '010101', '商品类别', '0101', '/pages/materials/materialcategory.html', '\0', '0230', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('23', '010102', '商品信息', '0101', '/pages/materials/material.html', '\0', '0240', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('24', '0102', '基本资料', '0', '', '\0', '0750', '', '电脑版', null, 'icon-grid', '0'); -INSERT INTO `jsh_function` VALUES ('25', '01020101', '供应商信息', '0102', '/pages/manage/vendor.html', '\0', '0260', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('26', '010202', '仓库信息', '0102', '/pages/manage/depot.html', '\0', '0270', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('31', '010206', '经手人管理', '0102', '/pages/materials/person.html', '\0', '0284', '', '电脑版', null, 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('25', '01020101', '供应商信息', '0102', '/pages/manage/vendor.html', '\0', '0260', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('26', '010202', '仓库信息', '0102', '/pages/manage/depot.html', '\0', '0270', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('31', '010206', '经手人管理', '0102', '/pages/materials/person.html', '\0', '0284', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('32', '0502', '采购管理', '0', '', '\0', '0330', '', '电脑版', '', 'icon-loop', '0'); -INSERT INTO `jsh_function` VALUES ('33', '050201', '采购入库', '0502', '/pages/materials/purchase_in_list.html', '\0', '0340', '', '电脑版', '3,4,5', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('33', '050201', '采购入库', '0502', '/pages/materials/purchase_in_list.html', '\0', '0340', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('38', '0603', '销售管理', '0', '', '\0', '0390', '', '电脑版', '', 'icon-briefcase', '0'); -INSERT INTO `jsh_function` VALUES ('40', '080107', '调拨出库', '0801', '/pages/materials/allocation_out_list.html', '\0', '0807', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('41', '060303', '销售出库', '0603', '/pages/materials/sale_out_list.html', '\0', '0394', '', '电脑版', '3,4,5', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('40', '080107', '调拨出库', '0801', '/pages/materials/allocation_out_list.html', '\0', '0807', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('41', '060303', '销售出库', '0603', '/pages/materials/sale_out_list.html', '\0', '0394', '', '电脑版', '1,2', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('44', '0704', '财务管理', '0', '', '\0', '0450', '', '电脑版', '', 'icon-map', '0'); -INSERT INTO `jsh_function` VALUES ('59', '030101', '库存状况', '0301', '/pages/reports/in_out_stock_report.html', '\0', '0600', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('194', '010204', '收支项目', '0102', '/pages/manage/inOutItem.html', '\0', '0282', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('195', '010205', '结算账户', '0102', '/pages/manage/account.html', '\0', '0283', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('197', '070402', '收入单', '0704', '/pages/financial/item_in.html', '\0', '0465', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('59', '030101', '库存状况', '0301', '/pages/reports/in_out_stock_report.html', '\0', '0600', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('194', '010204', '收支项目', '0102', '/pages/manage/inOutItem.html', '\0', '0282', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('195', '010205', '结算账户', '0102', '/pages/manage/account.html', '\0', '0283', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('197', '070402', '收入单', '0704', '/pages/financial/item_in.html', '\0', '0465', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('198', '0301', '报表查询', '0', '', '\0', '0570', '', '电脑版', null, 'icon-pie-chart', '0'); -INSERT INTO `jsh_function` VALUES ('199', '050204', '采购退货', '0502', '/pages/materials/purchase_back_list.html', '\0', '0345', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('200', '060305', '销售退货', '0603', '/pages/materials/sale_back_list.html', '\0', '0396', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('201', '080103', '其它入库', '0801', '/pages/materials/other_in_list.html', '\0', '0803', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('202', '080105', '其它出库', '0801', '/pages/materials/other_out_list.html', '\0', '0805', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('203', '070403', '支出单', '0704', '/pages/financial/item_out.html', '\0', '0470', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('204', '070404', '收款单', '0704', '/pages/financial/money_in.html', '\0', '0475', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('205', '070405', '付款单', '0704', '/pages/financial/money_out.html', '\0', '0480', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('206', '070406', '转账单', '0704', '/pages/financial/giro.html', '\0', '0490', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('207', '030102', '账户统计', '0301', '/pages/reports/account_report.html', '\0', '0610', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('208', '030103', '进货统计', '0301', '/pages/reports/buy_in_report.html', '\0', '0620', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('209', '030104', '销售统计', '0301', '/pages/reports/sale_out_report.html', '\0', '0630', '', '电脑版', null, 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('210', '040102', '零售出库', '0401', '/pages/materials/retail_out_list.html', '\0', '0405', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/pages/materials/retail_back_list.html', '\0', '0407', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('212', '070407', '收预付款', '0704', '/pages/financial/advance_in.html', '\0', '0495', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('217', '01020102', '客户信息', '0102', '/pages/manage/customer.html', '\0', '0262', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('218', '01020103', '会员信息', '0102', '/pages/manage/member.html', '\0', '0263', '', '电脑版', '1,2', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('220', '010103', '计量单位', '0101', '/pages/manage/unit.html', '\0', '0245', '', '电脑版', null, 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('199', '050204', '采购退货', '0502', '/pages/materials/purchase_back_list.html', '\0', '0345', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('200', '060305', '销售退货', '0603', '/pages/materials/sale_back_list.html', '\0', '0396', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('201', '080103', '其它入库', '0801', '/pages/materials/other_in_list.html', '\0', '0803', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('202', '080105', '其它出库', '0801', '/pages/materials/other_out_list.html', '\0', '0805', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('203', '070403', '支出单', '0704', '/pages/financial/item_out.html', '\0', '0470', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('204', '070404', '收款单', '0704', '/pages/financial/money_in.html', '\0', '0475', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('205', '070405', '付款单', '0704', '/pages/financial/money_out.html', '\0', '0480', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('206', '070406', '转账单', '0704', '/pages/financial/giro.html', '\0', '0490', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('207', '030102', '账户统计', '0301', '/pages/reports/account_report.html', '\0', '0610', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('208', '030103', '进货统计', '0301', '/pages/reports/buy_in_report.html', '\0', '0620', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('209', '030104', '销售统计', '0301', '/pages/reports/sale_out_report.html', '\0', '0630', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('210', '040102', '零售出库', '0401', '/pages/materials/retail_out_list.html', '\0', '0405', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/pages/materials/retail_back_list.html', '\0', '0407', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('212', '070407', '收预付款', '0704', '/pages/financial/advance_in.html', '\0', '0495', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('217', '01020102', '客户信息', '0102', '/pages/manage/customer.html', '\0', '0262', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('218', '01020103', '会员信息', '0102', '/pages/manage/member.html', '\0', '0263', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('220', '010103', '计量单位', '0101', '/pages/manage/unit.html', '\0', '0245', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('225', '0401', '零售管理', '0', '', '\0', '0101', '', '电脑版', '', 'icon-present', '0'); INSERT INTO `jsh_function` VALUES ('226', '030106', '入库明细', '0301', '/pages/reports/in_detail.html', '\0', '0640', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('227', '030107', '出库明细', '0301', '/pages/reports/out_detail.html', '\0', '0645', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('228', '030108', '入库汇总', '0301', '/pages/reports/in_material_count.html', '\0', '0650', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('229', '030109', '出库汇总', '0301', '/pages/reports/out_material_count.html', '\0', '0655', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('232', '080109', '组装单', '0801', '/pages/materials/assemble_list.html', '\0', '0809', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('233', '080111', '拆卸单', '0801', '/pages/materials/disassemble_list.html', '\0', '0811', '', '电脑版', '3,4,5', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('234', '000105', '系统配置', '0001', '/pages/manage/systemConfig.html', '\0', '0165', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('232', '080109', '组装单', '0801', '/pages/materials/assemble_list.html', '\0', '0809', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('233', '080111', '拆卸单', '0801', '/pages/materials/disassemble_list.html', '\0', '0811', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('234', '000105', '系统配置', '0001', '/pages/manage/systemConfig.html', '\0', '0165', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('235', '030110', '客户对账', '0301', '/pages/reports/customer_account.html', '\0', '0660', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('236', '000106', '商品属性', '0001', '/pages/materials/materialProperty.html', '\0', '0168', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('236', '000106', '商品属性', '0001', '/pages/materials/materialProperty.html', '\0', '0168', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('237', '030111', '供应商对账', '0301', '/pages/reports/vendor_account.html', '\0', '0665', '', '电脑版', '', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('239', '0801', '仓库管理', '0', '', '\0', '0420', '', '电脑版', '', 'icon-layers', '0'); -INSERT INTO `jsh_function` VALUES ('240', '010104', '序列号', '0101', '/pages/manage/serialNumber.html', '\0', '0246', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('241', '050202', '采购订单', '0502', '/pages/materials/purchase_orders_list.html', '\0', '0335', '', '电脑版', '3', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('242', '060301', '销售订单', '0603', '/pages/materials/sale_orders_list.html', '\0', '0392', '', '电脑版', '3', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('243', '000108', '机构管理', '0001', '/pages/manage/organization.html', '', '0139', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('240', '010104', '序列号', '0101', '/pages/manage/serialNumber.html', '\0', '0246', '', '电脑版', '1', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('241', '050202', '采购订单', '0502', '/pages/materials/purchase_orders_list.html', '\0', '0335', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('242', '060301', '销售订单', '0603', '/pages/materials/sale_orders_list.html', '\0', '0392', '', '电脑版', '1,2', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('243', '000108', '机构管理', '0001', '/pages/manage/organization.html', '', '0139', '', '电脑版', '1', 'icon-notebook', '0'); INSERT INTO `jsh_function` VALUES ('244', '030112', '库存预警', '0301', '/pages/reports/stock_warning_report.html', '\0', '0670', '', '电脑版', '', 'icon-notebook', '0'); -INSERT INTO `jsh_function` VALUES ('245', '000107', '插件管理', '0001', '/pages/manage/plugin.html', '\0', '0170', '', '电脑版', '', 'icon-notebook', '0'); +INSERT INTO `jsh_function` VALUES ('245', '000107', '插件管理', '0001', '/pages/manage/plugin.html', '\0', '0170', '', '电脑版', '1', 'icon-notebook', '0'); -- ---------------------------- -- Table structure for jsh_in_out_item @@ -416,13 +416,17 @@ CREATE TABLE `jsh_log` ( `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', PRIMARY KEY (`id`), KEY `FKF2696AA13E226853` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6779 DEFAULT CHARSET=utf8 COMMENT='操作日志'; +) ENGINE=InnoDB AUTO_INCREMENT=6783 DEFAULT CHARSET=utf8 COMMENT='操作日志'; -- ---------------------------- -- Records of jsh_log -- ---------------------------- INSERT INTO `jsh_log` VALUES ('6761', '63', '用户', '127.0.0.1', '2020-07-21 23:58:39', '0', '登录jsh', '63'); INSERT INTO `jsh_log` VALUES ('6778', '63', '用户', '127.0.0.1', '2020-07-23 22:42:48', '0', '登录jsh', '63'); +INSERT INTO `jsh_log` VALUES ('6779', '120', '用户', '127.0.0.1', '2020-09-04 01:16:20', '0', '登录admin', null); +INSERT INTO `jsh_log` VALUES ('6780', '120', '关联关系', '127.0.0.1', '2020-09-04 01:16:41', '0', '修改5', null); +INSERT INTO `jsh_log` VALUES ('6781', '120', '关联关系', '127.0.0.1', '2020-09-04 01:16:57', '0', '修改32', null); +INSERT INTO `jsh_log` VALUES ('6782', '63', '用户', '127.0.0.1', '2020-09-04 01:17:34', '0', '登录jsh', '63'); -- ---------------------------- -- Table structure for jsh_material @@ -682,7 +686,7 @@ CREATE TABLE `jsh_person` ( `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='经手人表'; +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='经手人表'; -- ---------------------------- -- Records of jsh_person @@ -704,15 +708,16 @@ CREATE TABLE `jsh_role` ( `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='角色表'; +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='角色表'; -- ---------------------------- -- Records of jsh_role -- ---------------------------- -INSERT INTO `jsh_role` VALUES ('4', '管理员', null, null, null, null, '0'); -INSERT INTO `jsh_role` VALUES ('10', '租户', null, null, null, null, '0'); -INSERT INTO `jsh_role` VALUES ('16', '测试角色', null, null, null, '63', '0'); -INSERT INTO `jsh_role` VALUES ('17', '角色666', null, null, null, '63', '0'); +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 @@ -916,7 +921,7 @@ CREATE TABLE `jsh_user_business` ( -- ---------------------------- -- 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\":\"25\",\"btnStr\":\"1\"},{\"funId\":\"217\",\"btnStr\":\"1\"},{\"funId\":\"218\",\"btnStr\":\"1\"},{\"funId\":\"241\",\"btnStr\":\"3\"},{\"funId\":\"242\",\"btnStr\":\"3\"}]', '0'); +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'); @@ -940,7 +945,7 @@ INSERT INTO `jsh_user_business` VALUES ('27', 'UserCustomer', '63', '[58]', null 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\":\"25\",\"btnStr\":\"1\"},{\"funId\":\"217\",\"btnStr\":\"1\"},{\"funId\":\"218\",\"btnStr\":\"1\"},{\"funId\":\"241\",\"btnStr\":\"3\"},{\"funId\":\"242\",\"btnStr\":\"3\"}]', '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'); diff --git a/erp_web/js/pages/manage/pushBtn.json b/erp_web/js/pages/manage/pushBtn.json index 881d1bbd..f4d1cc17 100644 --- a/erp_web/js/pages/manage/pushBtn.json +++ b/erp_web/js/pages/manage/pushBtn.json @@ -1,22 +1,26 @@ [ { "id": 1, - "text": "导入导出" + "text": "编辑" }, { "id": 2, - "text": "启用禁用" - }, - { - "id": 3, "text": "审核反审核" }, + { + "id": 3, + "text": "导入导出" + }, { "id": 4, - "text": "打印" + "text": "启用禁用" }, { "id": 5, + "text": "打印" + }, + { + "id": 6, "text": "作废" } ] \ No newline at end of file diff --git a/erp_web/js/pages/materials/in_out.js b/erp_web/js/pages/materials/in_out.js index f76603a3..668b2f79 100644 --- a/erp_web/js/pages/materials/in_out.js +++ b/erp_web/js/pages/materials/in_out.js @@ -26,9 +26,11 @@ var btnEnableList = getBtnStr(); //获取按钮的权限 var mPropertyList = ""; //商品属性列表 var defaultAccountId = 0; //默认账户id + var roleType = ""; //角色类型 $(function(){ //初始化系统基础信息 getType(); + getRoleType(); initSystemData_UB(); initSystemData_depot(); initSystemData_account(); @@ -142,6 +144,21 @@ amountNum = "CXD"; } } + function getRoleType(){ + $.ajax({ + type:"get", + url: "/user/getRoleTypeByUserId", + async: false, + success: function (res) { + if (res && res.code === 200) { + roleType = res.data.roleType; + } + else { + roleType = null; + } + } + }); + } //初始化系统基础信息 function initSystemData_UB(){ $.ajax({ @@ -360,8 +377,8 @@ } } ]; - //如果允许的按钮列表中存在就显示,3-代表审核|反审核的权限 - if(btnEnableList && btnEnableList.indexOf(3)>-1 && listTitle.indexOf("订单")>-1){ + //如果允许的按钮列表中存在就显示,2-代表审核|反审核的权限 + if(btnEnableList && btnEnableList.indexOf(2)>-1 && listTitle.indexOf("订单")>-1){ isHiddenStatus = false; //显示 tableToolBar.push({ id:'okDepotHead', @@ -2214,6 +2231,7 @@ search: JSON.stringify({ type: listType, subType: listSubType, + roleType: roleType, state: $.trim($("#searchState").val()), number: $.trim($("#searchNumber").val()), beginTime: beginTime, diff --git a/erp_web/pages/manage/functions.html b/erp_web/pages/manage/functions.html index 3e6a4a0c..ced05efa 100644 --- a/erp_web/pages/manage/functions.html +++ b/erp_web/pages/manage/functions.html @@ -245,7 +245,7 @@ url: url, valueField: 'id', textField: 'text', - panelHeight: 120, + panelHeight: 160, multiple: true, method: 'get' }); diff --git a/erp_web/pages/manage/role.html b/erp_web/pages/manage/role.html index 576e5e3a..3b9900fd 100644 --- a/erp_web/pages/manage/role.html +++ b/erp_web/pages/manage/role.html @@ -31,8 +31,8 @@
查询  - 重置 - 分配功能   + 重置  + 分配功能  分配按钮
@@ -50,6 +50,24 @@ data-options="required:true,validType:'length[2,30]'" style="width: 230px;"/> + + 数据类型   + + + + + + 描述   + + + + @@ -110,7 +128,9 @@ return str; } }, - {title: '角色名称', field: 'name', width: 200} + {title: '角色名称', field: 'name', width: 200}, + {title: '数据类型', field: 'type', width: 200}, + {title: '描述', field: 'description', width: 200} ]], toolbar: [ { @@ -147,7 +167,7 @@ //兼容 IE,firefox 兼容 var obj = e.srcElement ? e.srcElement : e.target; //绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题 - if (k == "13" && (obj.id == "name" || obj.id == "sort" || obj.id == "remark")) { + if (k == "13" && (obj.id == "name" || obj.id == "description")) { $("#saveRole").click(); } //搜索按钮添加快捷键 @@ -258,13 +278,9 @@ var oldName = ""; function addRole() { - $("#sort").val(""); - $("#remark").val(""); + $('#roleFM').form('clear'); $('#roleDlg').dialog('open').dialog('setTitle', ' 增加角色信息'); $(".window-mask").css({width: webW, height: webH}); - $("#name").val("").focus(); - //$('#roleFM').form('clear'); - oldName = ""; roleID = 0; url = '/role/add'; @@ -305,6 +321,8 @@ function editRole(index) { var rowsdata = $("#tableData").datagrid("getRows")[index]; $("#name").textbox("setValue", rowsdata.name); + $("#type").combobox("setValue", rowsdata.type); + $("#description").textbox("setValue", rowsdata.description); oldName = rowsdata.name; $('#roleDlg').dialog('open').dialog('setTitle', ' 编辑角色信息'); $(".window-mask").css({width: webW, height: webH}); diff --git a/erp_web/pages/manage/rolePushBtn.html b/erp_web/pages/manage/rolePushBtn.html index ba058c9c..8dfbe013 100644 --- a/erp_web/pages/manage/rolePushBtn.html +++ b/erp_web/pages/manage/rolePushBtn.html @@ -19,6 +19,8 @@
+ 全选  + 全取消  保存
@@ -83,7 +85,7 @@ for (var i = 0; i < arr.length; i++) { for (var j = 0; j < pushBtnJSON.length; j++) { if (pushBtnJSON[j].id === arr[i] - 0) { - str += "" + pushBtnJSON[j].text; + str += "" + pushBtnJSON[j].text + " "; } } } @@ -211,6 +213,40 @@ } $(this).closest(".datagrid-row").find("[field='Id']").attr("data-btn", checkStr); }); + + //全选 + $("#btnAllCheck").off("click").on("click", function () { + bindBody.find(".datagrid-row").each(function () { + $(this).find("[field='PushBtnList']").find("input").each(function () { + $(this).prop("checked", "checked"); + }); + $(this).find("[field='PushBtnList']").find("input").each(function () { + var checkStr = ""; + $(this).closest(".datagrid-cell").find("input").each(function () { + var thisValue = $(this).val(); //勾选的值 + var isChecked = $(this).prop("checked"); + if (isChecked) { + checkStr = checkStr + thisValue + ","; + } + }); + if (checkStr) { + checkStr = checkStr.substring(0, checkStr.length - 1); + } + $(this).closest(".datagrid-row").find("[field='Id']").attr("data-btn", checkStr); + }); + }); + }); + + //全取消 + $("#btnAllCancel").off("click").on("click", function () { + bindBody.find(".datagrid-row").each(function () { + $(this).find("[field='Id']").attr("data-btn", ""); + $(this).find("[field='PushBtnList']").find("input").each(function () { + $(this).prop("checked", ""); + }); + }); + }); + }, 500); $("#btnOK").off("click").on("click", function () { diff --git a/erp_web/pages/manage/user.html b/erp_web/pages/manage/user.html index 0d5c5548..8245d999 100644 --- a/erp_web/pages/manage/user.html +++ b/erp_web/pages/manage/user.html @@ -35,9 +35,9 @@
查询  - 重置 - 分配角色 - 分配仓库 + 重置  + 分配角色  + 分配仓库  分配客户
diff --git a/src/main/java/com/jsh/erp/controller/DepotHeadController.java b/src/main/java/com/jsh/erp/controller/DepotHeadController.java index d0de07cf..beb7da87 100644 --- a/src/main/java/com/jsh/erp/controller/DepotHeadController.java +++ b/src/main/java/com/jsh/erp/controller/DepotHeadController.java @@ -368,7 +368,7 @@ public class DepotHeadController { String updated = body.getUpdated(); Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString()); Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString()); - Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null); + Long count = depotHeadService.countDepotHead(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); diff --git a/src/main/java/com/jsh/erp/controller/UserController.java b/src/main/java/com/jsh/erp/controller/UserController.java index a4730c4f..ea7e8479 100644 --- a/src/main/java/com/jsh/erp/controller/UserController.java +++ b/src/main/java/com/jsh/erp/controller/UserController.java @@ -106,6 +106,8 @@ public class UserController { //验证通过 ,可以登录,放入session,记录登录日志 user = userService.getUserByLoginName(loginName); request.getSession().setAttribute("user",user); + String roleType = userService.getRoleTypeByUserId(user.getId()); //角色类型 + request.getSession().setAttribute("roleType",roleType); if(user.getTenantId()!=null) { Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId()); if(tenant!=null) { @@ -346,4 +348,19 @@ public class UserController { } return arr; } + @GetMapping("/getRoleTypeByUserId") + public BaseResponseInfo getRoleTypeByUserId(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap(); + data.put("roleType", request.getSession().getAttribute("roleType")); + res.code = 200; + res.data = data; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取失败"; + } + return res; + } } diff --git a/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java index 6b3280d6..c5154c98 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java @@ -21,6 +21,7 @@ public interface DepotHeadMapperEx { List selectByConditionDepotHead( @Param("type") String type, @Param("subType") String subType, + @Param("handsPersonId") Long handsPersonId, @Param("number") String number, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @@ -32,6 +33,7 @@ public interface DepotHeadMapperEx { Long countsByDepotHead( @Param("type") String type, @Param("subType") String subType, + @Param("handsPersonId") Long handsPersonId, @Param("number") String number, @Param("beginTime") String beginTime, @Param("endTime") String endTime, diff --git a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadComponent.java b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadComponent.java index 70f0fbf0..f22ee504 100644 --- a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadComponent.java +++ b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadComponent.java @@ -32,12 +32,13 @@ public class DepotHeadComponent implements ICommonQuery { String search = map.get(Constants.SEARCH); String type = StringUtil.getInfo(search, "type"); String subType = StringUtil.getInfo(search, "subType"); + String roleType = StringUtil.getInfo(search, "roleType"); String number = StringUtil.getInfo(search, "number"); String beginTime = StringUtil.getInfo(search, "beginTime"); String endTime = StringUtil.getInfo(search, "endTime"); String materialParam = StringUtil.getInfo(search, "materialParam"); String depotIds = StringUtil.getInfo(search, "depotIds"); - return depotHeadService.select(type, subType, number, beginTime, endTime, materialParam, depotIds, QueryUtils.offset(map), QueryUtils.rows(map)); + return depotHeadService.select(type, subType, roleType, number, beginTime, endTime, materialParam, depotIds, QueryUtils.offset(map), QueryUtils.rows(map)); } @Override @@ -45,12 +46,13 @@ public class DepotHeadComponent implements ICommonQuery { String search = map.get(Constants.SEARCH); String type = StringUtil.getInfo(search, "type"); String subType = StringUtil.getInfo(search, "subType"); + String roleType = StringUtil.getInfo(search, "roleType"); String number = StringUtil.getInfo(search, "number"); String beginTime = StringUtil.getInfo(search, "beginTime"); String endTime = StringUtil.getInfo(search, "endTime"); String materialParam = StringUtil.getInfo(search, "materialParam"); String depotIds = StringUtil.getInfo(search, "depotIds"); - return depotHeadService.countDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds); + return depotHeadService.countDepotHead(type, subType, roleType, number, beginTime, endTime, materialParam, depotIds); } @Override diff --git a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index 430c9029..d77763c1 100644 --- a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -79,12 +79,17 @@ public class DepotHeadService { return list; } - public List select(String type, String subType, String number, String beginTime, String endTime, + public List select(String type, String subType, String roleType, String number, String beginTime, String endTime, String materialParam, String depotIds, int offset, int rows)throws Exception { + Long handsPersonId = null; + User user = userService.getCurrentUser(); + if("个人数据".equals(roleType)) { + handsPersonId = user.getId(); + } List resList = new ArrayList(); List list=null; try{ - list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds, offset, rows); + list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, handsPersonId, number, beginTime, endTime, materialParam, depotIds, offset, rows); }catch(Exception e){ JshException.readFail(logger, e); } @@ -118,13 +123,16 @@ public class DepotHeadService { return resList; } - - - public Long countDepotHead(String type, String subType, String number, String beginTime, String endTime, + public Long countDepotHead(String type, String subType, String roleType,String number, String beginTime, String endTime, String materialParam, String depotIds) throws Exception{ + Long handsPersonId = null; + User user = userService.getCurrentUser(); + if("个人数据".equals(roleType)) { + handsPersonId = user.getId(); + } Long result=null; try{ - result=depotHeadMapperEx.countsByDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds); + result=depotHeadMapperEx.countsByDepotHead(type, subType, handsPersonId, number, beginTime, endTime, materialParam, depotIds); }catch(Exception e){ JshException.readFail(logger, e); } diff --git a/src/main/java/com/jsh/erp/service/user/UserService.java b/src/main/java/com/jsh/erp/service/user/UserService.java index dfea2e9b..9900a126 100644 --- a/src/main/java/com/jsh/erp/service/user/UserService.java +++ b/src/main/java/com/jsh/erp/service/user/UserService.java @@ -1,14 +1,12 @@ package com.jsh.erp.service.user; +import com.jsh.erp.datasource.entities.*; +import com.jsh.erp.service.role.RoleService; import org.springframework.util.StringUtils; 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.OrgaUserRel; -import com.jsh.erp.datasource.entities.User; -import com.jsh.erp.datasource.entities.UserEx; -import com.jsh.erp.datasource.entities.UserExample; import com.jsh.erp.datasource.mappers.UserMapper; import com.jsh.erp.datasource.mappers.UserMapperEx; import com.jsh.erp.datasource.vo.TreeNodeEx; @@ -61,6 +59,8 @@ public class UserService { private TenantService tenantService; @Resource private UserBusinessService userBusinessService; + @Resource + private RoleService roleService; public User getUser(long id)throws Exception { User result=null; @@ -675,4 +675,35 @@ public class UserService { } return list; } + + /** + * 根据用户id查询角色类型 + * @param userId + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String getRoleTypeByUserId(long userId) throws Exception { + List list = userBusinessService.getBasicData(String.valueOf(userId), "UserRole"); + UserBusiness ub = null; + if(list.size() > 0) { + ub = list.get(0); + String values = ub.getValue(); + String roleId = null; + if(values!=null) { + values = values.replaceAll("\\[\\]",",").replace("[","").replace("]",""); + } + String [] valueArray=values.split(","); + if(valueArray.length>0) { + roleId = valueArray[0]; + } + Role role = roleService.getRole(Long.parseLong(roleId)); + if(role!=null) { + return role.getType(); + } else { + return null; + } + } else { + return null; + } + } } diff --git a/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/src/main/resources/mapper_xml/DepotHeadMapperEx.xml index c6b40eef..b2bef646 100644 --- a/src/main/resources/mapper_xml/DepotHeadMapperEx.xml +++ b/src/main/resources/mapper_xml/DepotHeadMapperEx.xml @@ -55,6 +55,9 @@ and dh.sub_type='${subType}' + + and dh.hands_person_id='${handsPersonId}' + and dh.number like '%${number}%' @@ -89,6 +92,9 @@ and sub_type='${subType}' + + and hands_person_id='${handsPersonId}' + and number like '%${number}%'