diff --git a/README.md b/README.md index 3dcbd3a1b1..fb3626cdb0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ * 虽然目前只有进销存+财务+生产的功能,但后面将会推出ERP的全部功能,有兴趣请帮点一下 **Star** 哦 * **官网URL:http://www.huaxiaerp.com 商务合作或技术交流,请联系QQ:752718920** * 欢迎加入华夏ERP交流QQ群,群1:120725710(满)、群3:805736336 -* 平台地址:http://47.116.69.14 欢迎大家注册租户进行体验 +* 平台地址:http://cloud.huaxiaerp.vip 欢迎大家注册租户进行体验 * 系统默认租户账号:jsh,默认超管账户:admin,默认密码均为:123456 * 部署如遇到困难请参考Wiki文档 https://gitee.com/jishenghua/JSH_ERP/wikis/pages @@ -43,7 +43,7 @@ * Nginx代理:nginx1.12.2 * 操作系统:Windows、Linux等 * 为方便大家搭建运行环境,分享了下载地址 https://pan.baidu.com/s/1jlild9uyGdQ7H2yaMx76zw  提取码:814g -* 不会打包的小伙伴,请下载此打包后的文件 http://47.116.69.14:8899/down/J6SsL8UWr7fb 提取码:siB2FW +* 不会打包的小伙伴,请下载此打包后的文件 https://share.weiyun.com/Y6BXPOxn 密码:ae8jcy * 不会部署的小伙伴,请参考部署教程 http://www.huaxiaerp.com/thread-177-1-1.html # 开源说明 diff --git a/jshERP-boot/docs/jsh_erp.sql b/jshERP-boot/docs/jsh_erp.sql index 31889310b3..d7520b435e 100644 --- a/jshERP-boot/docs/jsh_erp.sql +++ b/jshERP-boot/docs/jsh_erp.sql @@ -10,7 +10,7 @@ Target Server Type : MYSQL Target Server Version : 50704 File Encoding : 65001 -Date: 2021-07-28 01:03:33 +Date: 2021-09-05 21:08:09 */ SET FOREIGN_KEY_CHECKS=0; @@ -56,6 +56,7 @@ CREATE TABLE `jsh_account_head` ( `bill_time` datetime DEFAULT NULL COMMENT '单据日期', `remark` varchar(100) DEFAULT NULL COMMENT '备注', `file_name` varchar(500) DEFAULT NULL COMMENT '附件名称', + `status` varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核', `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', PRIMARY KEY (`id`), @@ -67,12 +68,12 @@ CREATE TABLE `jsh_account_head` ( -- ---------------------------- -- Records of jsh_account_head -- ---------------------------- -INSERT INTO `jsh_account_head` VALUES ('118', '收入', '58', '16', '63', '55.000000', null, '55.000000', '17', 'SR00000000643', '2021-06-02 00:24:49', null, null, '63', '0'); -INSERT INTO `jsh_account_head` VALUES ('119', '支出', '68', '16', '63', '66.000000', null, '66.000000', '17', 'ZC00000000644', '2021-06-02 00:25:01', null, null, '63', '0'); -INSERT INTO `jsh_account_head` VALUES ('122', '转账', null, '17', '63', '11.000000', null, '11.000000', '17', 'ZZ00000000647', '2021-06-02 00:25:32', null, null, '63', '0'); -INSERT INTO `jsh_account_head` VALUES ('124', '收预付款', '60', '17', '63', '80.000000', '0.000000', '80.000000', null, 'SYF00000000649', '2021-07-06 23:43:48', null, null, '63', '0'); -INSERT INTO `jsh_account_head` VALUES ('125', '收款', '58', '17', '63', '10.000000', '0.000000', '10.000000', '17', 'SK00000000653', '2021-07-06 23:46:38', null, null, '63', '0'); -INSERT INTO `jsh_account_head` VALUES ('126', '付款', '57', '17', '63', '50.000000', '0.000000', '-50.000000', '17', 'FK00000000654', '2021-07-06 23:47:23', null, null, '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('118', '收入', '58', '16', '63', '55.000000', null, '55.000000', '17', 'SR00000000643', '2021-06-02 00:24:49', null, null, '1', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('119', '支出', '68', '16', '63', '66.000000', null, '66.000000', '17', 'ZC00000000644', '2021-06-02 00:25:01', null, null, '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('122', '转账', null, '17', '63', '11.000000', null, '11.000000', '17', 'ZZ00000000647', '2021-06-02 00:25:32', null, null, '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('124', '收预付款', '60', '17', '63', '80.000000', '0.000000', '80.000000', null, 'SYF00000000649', '2021-07-06 23:43:48', null, null, '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('125', '收款', '58', '17', '63', '10.000000', '0.000000', '10.000000', '17', 'SK00000000653', '2021-07-06 23:46:38', null, null, '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('126', '付款', '57', '17', '63', '50.000000', '0.000000', '-50.000000', '17', 'FK00000000654', '2021-07-06 23:47:23', null, null, '0', '63', '0'); -- ---------------------------- -- Table structure for jsh_account_item @@ -161,7 +162,7 @@ CREATE TABLE `jsh_depot_head` ( `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 '销售或采购费用合计', - `status` varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2已转采购|销售', + `status` varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2完成采购|销售、3部分采购|销售', `link_number` varchar(50) DEFAULT NULL COMMENT '关联订单号', `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', @@ -181,7 +182,7 @@ INSERT INTO `jsh_depot_head` VALUES ('262', '出库', '销售', 'XSCK00000000634 INSERT INTO `jsh_depot_head` VALUES ('263', '入库', '销售退货', 'XSTH00000000635', 'XSTH00000000635', '2021-06-02 00:23:12', '2021-06-02 00:23:05', '71', '63', '17', '-22.000000', '-22.000000', '现付', null, null, null, '', '', '', '0.000000', '0.000000', '22.000000', '0.000000', '0', null, '63', '0'); INSERT INTO `jsh_depot_head` VALUES ('264', '出库', '零售', 'LSCK00000000636', 'LSCK00000000636', '2021-06-02 00:23:21', '2021-06-02 00:23:14', '60', '63', '17', '22.000000', '22.000000', '现付', null, null, null, null, null, null, null, null, null, null, '0', null, '63', '0'); INSERT INTO `jsh_depot_head` VALUES ('265', '入库', '零售退货', 'LSTH00000000637', 'LSTH00000000637', '2021-06-02 00:23:29', '2021-06-02 00:23:23', '60', '63', '17', '-22.000000', '-22.000000', '现付', null, null, null, null, null, null, null, null, null, null, '0', null, '63', '0'); -INSERT INTO `jsh_depot_head` VALUES ('266', '入库', '其它', 'QTRK00000000638', 'QTRK00000000638', '2021-06-02 00:23:48', '2021-06-02 00:23:36', '57', '63', null, null, '55.000000', '现付', null, null, null, null, null, null, null, null, null, null, '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('266', '入库', '其它', 'QTRK00000000638', 'QTRK00000000638', '2021-06-02 00:23:48', '2021-06-02 00:23:36', '57', '63', null, null, '55.000000', '现付', null, null, null, null, null, null, null, null, null, null, '1', null, '63', '0'); INSERT INTO `jsh_depot_head` VALUES ('267', '出库', '其它', 'QTCK00000000639', 'QTCK00000000639', '2021-06-02 00:23:59', '2021-06-02 00:23:50', '58', '63', null, null, '30.000000', '现付', null, null, null, null, null, null, null, null, null, null, '0', null, '63', '0'); INSERT INTO `jsh_depot_head` VALUES ('268', '出库', '调拨', 'DBCK00000000640', 'DBCK00000000640', '2021-06-02 00:24:09', '2021-06-02 00:24:00', null, '63', null, null, '11.000000', '现付', null, null, null, null, null, null, null, null, null, null, '0', null, '63', '0'); INSERT INTO `jsh_depot_head` VALUES ('269', '其它', '组装单', 'ZZD00000000641', 'ZZD00000000641', '2021-06-02 00:24:29', '2021-06-02 00:24:11', null, '63', null, null, '0.000000', '现付', null, null, null, null, null, null, null, null, null, null, '0', null, '63', '0'); @@ -283,48 +284,48 @@ INSERT INTO `jsh_function` VALUES ('25', '01020101', '供应商信息', '0102', 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 ('33', '050201', '采购入库', '0502', '/bill/purchase_in', '/bill/PurchaseInList', '\0', '0340', '', '电脑版', '1,2,7', 'profile', '0'); INSERT INTO `jsh_function` VALUES ('38', '0603', '销售管理', '0', '/billB', '/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 ('40', '080107', '调拨出库', '0801', '/bill/allocation_out', '/bill/AllocationOutList', '\0', '0807', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('41', '060303', '销售出库', '0603', '/bill/sale_out', '/bill/SaleOutList', '\0', '0394', '', '电脑版', '1,2,7', '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', '0658', '', '电脑版', '', '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 ('197', '070402', '收入单', '0704', '/financial/item_in', '/financial/ItemInList', '\0', '0465', '', '电脑版', '1,2,7', '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 ('199', '050204', '采购退货', '0502', '/bill/purchase_back', '/bill/PurchaseBackList', '\0', '0345', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('200', '060305', '销售退货', '0603', '/bill/sale_back', '/bill/SaleBackList', '\0', '0396', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('201', '080103', '其它入库', '0801', '/bill/other_in', '/bill/OtherInList', '\0', '0803', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('202', '080105', '其它出库', '0801', '/bill/other_out', '/bill/OtherOutList', '\0', '0805', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('203', '070403', '支出单', '0704', '/financial/item_out', '/financial/ItemOutList', '\0', '0470', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('204', '070404', '收款单', '0704', '/financial/money_in', '/financial/MoneyInList', '\0', '0475', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('205', '070405', '付款单', '0704', '/financial/money_out', '/financial/MoneyOutList', '\0', '0480', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('206', '070406', '转账单', '0704', '/financial/giro', '/financial/GiroList', '\0', '0490', '', '电脑版', '1,2,7', '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 ('210', '040102', '零售出库', '0401', '/bill/retail_out', '/bill/RetailOutList', '\0', '0405', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/bill/retail_back', '/bill/RetailBackList', '\0', '0407', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('212', '070407', '收预付款', '0704', '/financial/advance_in', '/financial/AdvanceInList', '\0', '0495', '', '电脑版', '1,2,7', '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', '/billC', '/layouts/TabLayout', '\0', '0101', '', '电脑版', '[]', 'gift', '0'); +INSERT INTO `jsh_function` VALUES ('225', '0401', '零售管理', '0', '/billC', '/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 ('232', '080109', '组装单', '0801', '/bill/assemble', '/bill/AssembleList', '\0', '0809', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('233', '080111', '拆卸单', '0801', '/bill/disassemble', '/bill/DisassembleList', '\0', '0811', '', '电脑版', '1,2,7', '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', '/material/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', '/billD', '/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_order', '/bill/SaleOrderList', '\0', '0392', '', '电脑版', '1,2', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('241', '050202', '采购订单', '0502', '/bill/purchase_order', '/bill/PurchaseOrderList', '\0', '0335', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('242', '060301', '销售订单', '0603', '/bill/sale_order', '/bill/SaleOrderList', '\0', '0392', '', '电脑版', '1,2,7', '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'); @@ -361,19 +362,18 @@ 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', + `client_ip` varchar(200) 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=7536 DEFAULT CHARSET=utf8 COMMENT='操作日志'; +) ENGINE=InnoDB AUTO_INCREMENT=7557 DEFAULT CHARSET=utf8 COMMENT='操作日志'; -- ---------------------------- -- Records of jsh_log -- ---------------------------- -INSERT INTO `jsh_log` VALUES ('7530', '63', '用户', '127.0.0.1/127.0.0.1', '2021-07-22 22:54:31', '0', '登录jsh', '63'); -- ---------------------------- -- Table structure for jsh_material @@ -687,6 +687,8 @@ CREATE TABLE `jsh_platform_config` ( INSERT INTO `jsh_platform_config` VALUES ('1', 'platform_name', '平台名称', '华夏ERP'); INSERT INTO `jsh_platform_config` VALUES ('2', 'activation_code', '激活码', 'e20cc75acddfe869428bcb8ce5e37b161b2490c81c178fba384938e5b3df5fbac2cd553a8d2f91de'); INSERT INTO `jsh_platform_config` VALUES ('3', 'platform_url', '官方网站', 'http://www.huaxiaerp.com/'); +INSERT INTO `jsh_platform_config` VALUES ('4', 'bill_print_flag', '三联打印启用标记', '0'); +INSERT INTO `jsh_platform_config` VALUES ('5', 'bill_print_url', '三联打印地址', ''); -- ---------------------------- -- Table structure for jsh_role @@ -914,7 +916,7 @@ CREATE TABLE `jsh_user_business` ( -- ---------------------------- -- Records of jsh_user_business -- ---------------------------- -INSERT INTO `jsh_user_business` VALUES ('5', 'RoleFunctions', '4', '[225][210][211][32][241][33][199][38][242][41][200][239][201][202][40][232][233][44][197][203][204][205][206][212][198][246][207][208][209][226][227][228][229][59][235][237][244][22][23][220][240][24][25][217][218][26][194][195][31][1][13][14][243][15][234][16][18][236][245][247][21][0]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":16,\"btnStr\":\"1\"},{\"funId\":18,\"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\":247,\"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 ('5', 'RoleFunctions', '4', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][1][14][243][15][234][16][18][236][245][248][198]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":16,\"btnStr\":\"1\"},{\"funId\":18,\"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\":247,\"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,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,2,7\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,7,2\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,7,2\"},{\"funId\":206,\"btnStr\":\"1,2,7\"},{\"funId\":212,\"btnStr\":\"1,7,2\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', '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'); @@ -938,14 +940,12 @@ 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', '[225][210][211][32][241][33][199][38][242][41][200][239][201][202][40][232][233][44][197][203][204][205][206][212][198][246][207][208][209][226][227][228][229][59][235][237][244][21][22][23][220][240][247][24][25][217][218][26][194][195][31][13][14][243][15][234]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"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 ('32', 'RoleFunctions', '10', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][14][243][15][234][248][198]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"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,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,7,2\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,2,7\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,2,7\"},{\"funId\":206,\"btnStr\":\"1,7,2\"},{\"funId\":212,\"btnStr\":\"1,2,7\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', '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'); diff --git "a/jshERP-boot/docs/\346\225\260\346\215\256\345\272\223\346\233\264\346\226\260\350\256\260\345\275\225-\351\246\226\346\254\241\345\256\211\350\243\205\350\257\267\345\213\277\344\275\277\347\224\250.txt" "b/jshERP-boot/docs/\346\225\260\346\215\256\345\272\223\346\233\264\346\226\260\350\256\260\345\275\225-\351\246\226\346\254\241\345\256\211\350\243\205\350\257\267\345\213\277\344\275\277\347\224\250.txt" index d6a892178a..ff0460334d 100644 --- "a/jshERP-boot/docs/\346\225\260\346\215\256\345\272\223\346\233\264\346\226\260\350\256\260\345\275\225-\351\246\226\346\254\241\345\256\211\350\243\205\350\257\267\345\213\277\344\275\277\347\224\250.txt" +++ "b/jshERP-boot/docs/\346\225\260\346\215\256\345\272\223\346\233\264\346\226\260\350\256\260\345\275\225-\351\246\226\346\254\241\345\256\211\350\243\205\350\257\267\345\213\277\344\275\277\347\224\250.txt" @@ -1200,4 +1200,34 @@ INSERT INTO `jsh_function` VALUES ('248', '030150', '调拨明细', '0301', '/re -- -------------------------------------------------------- alter table jsh_tenant add type varchar(1) DEFAULT '0' COMMENT '租户类型,0免费租户,1付费租户' after bills_num_limit; alter table jsh_tenant drop column bills_num_limit; -alter table jsh_tenant add expire_time datetime DEFAULT NULL COMMENT '到期时间' after create_time; \ No newline at end of file +alter table jsh_tenant add expire_time datetime DEFAULT NULL COMMENT '到期时间' after create_time; + +-- -------------------------------------------------------- +-- 时间 2021年8月29日 +-- by jishenghua +-- 给日志表的ip字段改长度 +-- -------------------------------------------------------- +alter table jsh_log change client_ip client_ip varchar(200) DEFAULT NULL COMMENT '客户端IP'; + +-- -------------------------------------------------------- +-- 时间 2021年9月5日 +-- by jishenghua +-- 给财务表增加状态字段,给历史数据赋值为0 +-- -------------------------------------------------------- +alter table jsh_account_head add status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核' after file_name; +update jsh_account_head set status=0; + +-- -------------------------------------------------------- +-- 时间 2021年9月12日 +-- by jishenghua +-- 插入jsh_platform_config数据,控制是否显示三联打印 +-- -------------------------------------------------------- +INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `platform_value`) VALUES ('4', 'bill_print_flag', '三联打印启用标记', '0'); +INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `platform_value`) VALUES ('5', 'bill_print_url', '三联打印地址', ''); + +-- -------------------------------------------------------- +-- 时间 2021年9月24日 +-- by jishenghua +-- 修改单据主表的状态字段描述 +-- -------------------------------------------------------- +alter table jsh_depot_head change status status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2完成采购|销售、3部分采购|销售'; \ No newline at end of file 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 index fb68641e36..dc804fdfbf 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java @@ -37,7 +37,7 @@ public class BusinessConstants { * 单据主表出入库类型 type 入库 出库 * depothead * */ - public static final String DEPOTHEAD_TYPE_STORAGE = "入库"; + public static final String DEPOTHEAD_TYPE_IN = "入库"; public static final String DEPOTHEAD_TYPE_OUT = "出库"; /** * 付款类型 payType //现付/预付款 @@ -67,12 +67,14 @@ public class BusinessConstants { public static final String BILLS_STATUS_SKIP = "2"; /** * 出入库分类 - *采购、采购退货、其它、零售、销售、调拨 + *采购、采购退货、其它、零售、销售、调拨等 * */ + public static final String SUB_TYPE_PURCHASE_ORDER = "采购订单"; 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_ORDER = "销售订单"; public static final String SUB_TYPE_SALES = "销售"; public static final String SUB_TYPE_TRANSFER = "调拨"; /** 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 index 867eb49afd..f972df61b7 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java @@ -327,6 +327,15 @@ public class ExceptionConstants { //单据录入-调入仓库与原仓库不能重复 public static final int DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE = 8500010; public static final String DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG = "调入仓库与原仓库不能重复"; + //单据删除-只有未审核的单据才能删除 + public static final int DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 8500011; + public static final String DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; + //单据审核-只有未审核的单据才能审核 + public static final int DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE = 8500012; + public static final String DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG = "抱歉,只有未审核的单据才能审核"; + //单据反审核-只有已审核的单据才能反审核 + public static final int DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE = 8500013; + public static final String DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG = "抱歉,只有已审核的单据才能反审核"; /** * 单据明细信息 * type = 90 @@ -356,6 +365,9 @@ public class ExceptionConstants { //单据录入-明细不能为空 public static final int ACCOUNT_HEAD_ROW_FAILED_CODE = 9500003; public static final String ACCOUNT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; + //单据删除-只有未审核的单据才能删除 + public static final int ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 9500004; + public static final String ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; /** * 财务明细信息 * type = 100 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 index a1023ecab4..83906685ad 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountHeadController.java @@ -7,6 +7,7 @@ import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx; import com.jsh.erp.service.accountHead.AccountHeadService; 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.*; @@ -17,6 +18,8 @@ import java.util.List; import java.util.Map; +import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; + /** * @author jishenghua 752*718*920 */ @@ -28,6 +31,26 @@ public class AccountHeadController { @Resource private AccountHeadService accountHeadService; + /** + * 批量设置状态-审核或者反审核 + * @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 = accountHeadService.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 body 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 index 6ec2a5a673..4b6587c6ff 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -77,7 +77,9 @@ public String findDetailByTypeAndMaterialId( if (list != null) { for (DepotItemVo4DetailByTypeAndMId d: list) { JSONObject item = new JSONObject(); - item.put("number", d.getNumber()); //商品编号 + item.put("number", d.getNumber()); //编号 + item.put("barCode", d.getBarCode()); //条码 + item.put("materialName", d.getMaterialName()); //名称 String type = d.getType(); String subType = d.getSubType(); if(("其它").equals(type)) { @@ -121,16 +123,20 @@ public BaseResponseInfo findStockByDepotAndBarCode( List list = materialService.getMaterialByBarCode(barCode); if(list!=null && list.size()>0) { MaterialVo4Unit materialVo4Unit = list.get(0); - stock = depotItemService.getStockByParam(depotId,materialVo4Unit.getId(),null,null); - String commodityUnit = materialVo4Unit.getCommodityUnit(); - Long unitId = materialVo4Unit.getUnitId(); - if(unitId!=null) { - Integer ratio = 1; - Unit unit = unitService.getUnit(unitId); - if(commodityUnit.equals(unit.getOtherUnit())){ - ratio = unit.getRatio(); - if(ratio!=0) { - stock = stock.divide(BigDecimal.valueOf(ratio),2,BigDecimal.ROUND_HALF_UP); //两位小数 + if(StringUtil.isNotEmpty(materialVo4Unit.getSku())){ + stock = depotItemService.getSkuStockByParam(depotId,materialVo4Unit.getMeId(),null,null); + } else { + stock = depotItemService.getStockByParam(depotId,materialVo4Unit.getId(),null,null); + String commodityUnit = materialVo4Unit.getCommodityUnit(); + Long unitId = materialVo4Unit.getUnitId(); + if(unitId!=null) { + Integer ratio = 1; + Unit unit = unitService.getUnit(unitId); + if(commodityUnit.equals(unit.getOtherUnit())){ + ratio = unit.getRatio(); + if(ratio!=0) { + stock = stock.divide(BigDecimal.valueOf(ratio),2,BigDecimal.ROUND_HALF_UP); //两位小数 + } } } } @@ -171,13 +177,18 @@ public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, item.put("model", diEx.getMModel()); item.put("materialOther", getOtherInfo(mpArr, diEx)); Integer ratio = diEx.getRatio(); - BigDecimal stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null); - if(ratio!=null){ - BigDecimal ratioDecimal = new BigDecimal(ratio.toString()); - if(ratioDecimal.compareTo(BigDecimal.ZERO)!=0){ - String otherUnit = diEx.getOtherUnit(); - if(otherUnit.equals(diEx.getMaterialUnit())) { - stock = stock.divide(ratioDecimal,2,BigDecimal.ROUND_HALF_UP); //两位小数 + BigDecimal stock; + if(StringUtil.isNotEmpty(diEx.getSku())){ + stock = depotItemService.getSkuStockByParam(diEx.getDepotId(),diEx.getMaterialExtendId(),null,null); + } else { + stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null); + if(ratio!=null){ + BigDecimal ratioDecimal = new BigDecimal(ratio.toString()); + if(ratioDecimal.compareTo(BigDecimal.ZERO)!=0){ + String otherUnit = diEx.getOtherUnit(); + if(otherUnit.equals(diEx.getMaterialUnit())) { + stock = stock.divide(ratioDecimal,2,BigDecimal.ROUND_HALF_UP); //两位小数 + } } } } @@ -316,55 +327,6 @@ public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPa return res; } - /** - * 导出excel表格 - * @param depotId - * @param monthTime - * @param materialParam - * @param request - * @param response - * @return - */ - @GetMapping(value = "/exportExcel") - public void exportExcel(@RequestParam("depotId") Long depotId, - @RequestParam("monthTime") String monthTime, - @RequestParam("materialParam") String materialParam, - HttpServletRequest request, HttpServletResponse response) throws Exception { - String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; - String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; - try { - List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), - timeB, null, null); - //存放数据json数组 - String[] names = {"条码", "名称", "规格", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"}; - String title = "库存报表"; - List objects = new ArrayList(); - if (null != dataList) { - for (DepotItemVo4WithInfoEx diEx : dataList) { - Long mId = diEx.getMId(); - String[] objs = new String[11]; - objs[0] = diEx.getBarCode(); - objs[1] = diEx.getMName(); - objs[2] = diEx.getMStandard(); - objs[3] = diEx.getMModel(); - objs[4] = diEx.getMaterialUnit(); - objs[5] = diEx.getPurchaseDecimal().toString(); - objs[6] = depotItemService.getStockByParam(depotId,mId,null,timeA).toString(); - objs[7] = depotItemService.getInNumByParam(depotId,mId,timeA,timeB).toString(); - objs[8] = depotItemService.getOutNumByParam(depotId,mId,timeA,timeB).toString(); - BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,timeB); - objs[9] = thisSum.toString(); - objs[10] = thisSum.multiply(diEx.getPurchaseDecimal()).toString(); - objects.add(objs); - } - } - File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects); - ExportExecUtil.showExec(file, file.getName() + "-" + monthTime, response); - } catch (Exception e) { - e.printStackTrace(); - } - } - /** * 统计总计金额 * @param depotId @@ -596,62 +558,6 @@ public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integ } return res; } - /** - * 导出库存预警excel表格 - * @param depotId - * @param request - * @param response - * @return - */ - @GetMapping(value = "/exportWarningExcel") - public BaseResponseInfo exportWarningExcel( - @RequestParam("depotId") Long depotId, - @RequestParam("materialParam") String materialParam, - @RequestParam("mpList") String mpList, - HttpServletRequest request, HttpServletResponse response)throws Exception { - BaseResponseInfo res = new BaseResponseInfo(); - Map map = new HashMap(); - String message = "成功"; - try { - String[] mpArr = mpList.split(","); - List dataList = depotItemService.findStockWarningCount(null, null, materialParam, depotId); - //存放数据json数组 - Long pid = depotId; - String[] names = {"条码", "名称", "规格", "型号", "扩展信息", "单位", "安全存量", "当前库存", "建议入库量"}; - String title = "库存预警报表"; - List objects = new ArrayList(); - if (null != dataList) { - for (DepotItemStockWarningCount diEx : dataList) { - DepotItemVo4WithInfoEx diVI = new DepotItemVo4WithInfoEx(); - diVI.setMMfrs(diEx.getMMfrs()); - diVI.setMOtherField1(diEx.getMOtherField1()); - diVI.setMOtherField2(diEx.getMOtherField2()); - diVI.setMOtherField3(diEx.getMOtherField3()); - String materialOther = getOtherInfo(mpArr, diVI); - String unitName = getUName(diEx.getMaterialUnit(), diEx.getUnitName()); - String[] objs = new String[9]; - objs[0] = diEx.getBarCode(); - objs[1] = diEx.getMName(); - objs[2] = diEx.getMStandard(); - objs[3] = diEx.getMModel(); - objs[4] = materialOther; - objs[5] = unitName; - objs[6] = diEx.getSafetystock() == null ? "0" : diEx.getSafetystock().toString(); - objs[7] = diEx.getCurrentNumber() == null ? "0" : diEx.getCurrentNumber().toString(); - objs[8] = diEx.getLinjieNumber() == null ? "0" : diEx.getLinjieNumber().toString(); - objects.add(objs); - } - } - File file = ExcelUtils.exportObjectsWithoutTitle(title+pid, names, title, objects); - ExportExecUtil.showExec(file, file.getName(), response); - res.code = 200; - } catch (Exception e) { - e.printStackTrace(); - message = "导出失败"; - res.code = 500; - } - return res; - } /** * 统计采购或销售的总金额 diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java index fc8c3c5bb5..4bd5bad91f 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/FunctionController.java @@ -161,16 +161,14 @@ public JSONArray getFunctionList(List dataList, String type, String ke item.put("value", function.getId()); item.put("title", function.getName()); item.put("attributes", function.getName()); - Boolean flag = ubValue.contains("[" + function.getId().toString() + "]"); - if (flag) { - item.put("checked", true); - } List funList = functionService.findRoleFunction(function.getNumber()); if(funList.size()>0) { JSONArray funArr = getFunctionList(funList, type, keyId); item.put("children", funArr); dataArray.add(item); } else { + Boolean flag = ubValue.contains("[" + function.getId().toString() + "]"); + item.put("checked", flag); dataArray.add(item); } } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java index 6aa7da006d..33b5e0d04d 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialController.java @@ -199,16 +199,17 @@ public JSONObject findBySelect(@RequestParam(value = "categoryId", required = fa item.put("model", material.getModel()); item.put("unit", material.getCommodityUnit() + ratio); item.put("sku", material.getSku()); - BigDecimal skuStock = depotItemService.getSkuStockByParam(depotId,material.getMeId(),null,null); + BigDecimal stock; if(StringUtil.isNotEmpty(material.getSku())){ - item.put("skuStock", skuStock); - } - BigDecimal stock = depotItemService.getStockByParam(depotId,material.getId(),null,null); - if (material.getUnitId()!=null){ - Unit unit = unitService.getUnit(material.getUnitId()); - if(material.getCommodityUnit().equals(unit.getOtherUnit())) { - if(unit.getRatio()!=0) { - stock = stock.divide(BigDecimal.valueOf(unit.getRatio()),2,BigDecimal.ROUND_HALF_UP); + stock = depotItemService.getSkuStockByParam(depotId,material.getMeId(),null,null); + } else { + stock = depotItemService.getStockByParam(depotId,material.getId(),null,null); + if (material.getUnitId()!=null){ + Unit unit = unitService.getUnit(material.getUnitId()); + if(material.getCommodityUnit().equals(unit.getOtherUnit())) { + if(unit.getRatio()!=0) { + stock = stock.divide(BigDecimal.valueOf(unit.getRatio()),2,BigDecimal.ROUND_HALF_UP); + } } } } @@ -490,12 +491,17 @@ public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String bar Long depotId = depotObj.getLong("id"); mvo.setDepotId(depotId); //库存 - BigDecimal stock = depotItemService.getStockByParam(depotId,mvo.getId(),null,null); - if (mvo.getUnitId()!=null){ - Unit unit = unitService.getUnit(mvo.getUnitId()); - if(mvo.getCommodityUnit().equals(unit.getOtherUnit())) { - if(unit.getRatio()!=0) { - stock = stock.divide(BigDecimal.valueOf(unit.getRatio()),2,BigDecimal.ROUND_HALF_UP); + BigDecimal stock; + if(StringUtil.isNotEmpty(mvo.getSku())){ + stock = depotItemService.getSkuStockByParam(depotId,mvo.getMeId(),null,null); + } else { + stock = depotItemService.getStockByParam(depotId,mvo.getId(),null,null); + if (mvo.getUnitId()!=null){ + Unit unit = unitService.getUnit(mvo.getUnitId()); + if(mvo.getCommodityUnit().equals(unit.getOtherUnit())) { + if(unit.getRatio()!=0) { + stock = stock.divide(BigDecimal.valueOf(unit.getRatio()),2,BigDecimal.ROUND_HALF_UP); + } } } } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/SystemConfigController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/SystemConfigController.java index a8feed9a27..bc87cc3714 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/SystemConfigController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/SystemConfigController.java @@ -13,6 +13,7 @@ import com.jsh.erp.utils.BaseResponseInfo; import com.jsh.erp.utils.FileUtils; 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; @@ -126,6 +127,9 @@ public BaseResponseInfo upload(HttpServletRequest request, HttpServletResponse r if(StringUtil.isEmpty(bizPath)){ bizPath = ""; } + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + bizPath = bizPath + File.separator + tenantId; savePath = this.uploadLocal(file,bizPath); if(StringUtil.isNotEmpty(savePath)){ res.code = 200; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java index d97820477c..17abb1aadb 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/UserController.java @@ -223,14 +223,12 @@ public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest r String oldpwd = jsonObject.getString("oldpassword"); String password = jsonObject.getString("password"); User user = userService.getUser(userId); - String oldPassword = Tools.md5Encryp(oldpwd); - String md5Pwd = Tools.md5Encryp(password); //必须和原始密码一致才可以更新密码 if(demonstrateOpen && user.getLoginName().equals(TEST_USER)){ flag = 3; //jsh用户不能修改密码 info = "jsh用户不能修改密码"; - } else if (oldPassword.equalsIgnoreCase(user.getPassword())) { - user.setPassword(md5Pwd); + } else if (oldpwd.equalsIgnoreCase(user.getPassword())) { + user.setPassword(password); flag = userService.updateUserByObj(user); //1-成功 info = "修改成功"; } else { diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHead.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHead.java index ace93f06de..575abebc91 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHead.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHead.java @@ -30,6 +30,8 @@ public class AccountHead { private String fileName; + private String status; + private Long tenantId; private String deleteFlag; @@ -138,6 +140,14 @@ public void setFileName(String fileName) { this.fileName = fileName == null ? null : fileName.trim(); } + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + public Long getTenantId() { return tenantId; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHeadExample.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHeadExample.java index 3981086bbf..2a838d32b4 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHeadExample.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/AccountHeadExample.java @@ -926,6 +926,76 @@ public Criteria andFileNameNotBetween(String value1, String value2) { return (Criteria) this; } + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + public Criteria andTenantIdIsNull() { addCriterion("tenant_id is null"); return (Criteria) this; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java index 93a80c4082..93810e0567 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemVo4DetailByTypeAndMId.java @@ -7,6 +7,10 @@ public class DepotItemVo4DetailByTypeAndMId { private String number; + private String barCode; + + private String materialName; + private String type; private String subType; @@ -25,6 +29,22 @@ public void setNumber(String number) { this.number = number; } + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + public String getType() { return type; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java index 1310a767a4..0eb05e7de7 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java @@ -2,13 +2,12 @@ import com.alibaba.fastjson.JSONObject; import com.jsh.erp.constants.BusinessConstants; -import com.jsh.erp.datasource.entities.AccountHead; -import com.jsh.erp.datasource.entities.AccountHeadExample; -import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx; -import com.jsh.erp.datasource.entities.User; +import com.jsh.erp.constants.ExceptionConstants; +import com.jsh.erp.datasource.entities.*; import com.jsh.erp.datasource.mappers.AccountHeadMapper; import com.jsh.erp.datasource.mappers.AccountHeadMapperEx; import com.jsh.erp.datasource.mappers.AccountItemMapperEx; +import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.JshException; import com.jsh.erp.service.accountItem.AccountItemService; import com.jsh.erp.service.log.LogService; @@ -197,21 +196,20 @@ public int batchDeleteAccountHeadByIds(String ids)throws Exception { List list = getAccountHeadListByIds(ids); for(AccountHead accountHead: list){ sb.append("[").append(accountHead.getBillNo()).append("]"); + if("1".equals(accountHead.getStatus())) { + throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE, + String.format(ExceptionConstants.ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG)); + } } - logService.insertLog("财务", sb.toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); User userInfo=userService.getCurrentUser(); String [] idArray=ids.split(","); - int result = 0; - try{ - //删除主表 - result = accountItemMapperEx.batchDeleteAccountItemByHeadIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); - //删除子表 - result = accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); - }catch(Exception e){ - JshException.writeFail(logger, e); - } - return result; + //删除主表 + accountItemMapperEx.batchDeleteAccountItemByHeadIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + //删除子表 + accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + logService.insertLog("财务", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + return 1; } public int checkIsNameExist(Long id, String name)throws Exception { @@ -226,11 +224,45 @@ public int checkIsNameExist(Long id, String name)throws Exception { return list==null?0:list.size(); } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(String status, String accountHeadIds)throws Exception { + int result = 0; + try{ + List ahIds = new ArrayList<>(); + List ids = StringUtil.strToLongList(accountHeadIds); + for(Long id: ids) { + AccountHead accountHead = getAccountHead(id); + if("0".equals(status)){ + if("1".equals(accountHead.getStatus())) { + ahIds.add(id); + } + } else if("1".equals(status)){ + if("0".equals(accountHead.getStatus())) { + ahIds.add(id); + } + } + } + if(ahIds.size()>0) { + AccountHead accountHead = new AccountHead(); + accountHead.setStatus(status); + AccountHeadExample example = new AccountHeadExample(); + example.createCriteria().andIdIn(ahIds); + result = accountHeadMapper.updateByExampleSelective(accountHead, example); + } else { + return 1; + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) public void addAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request) throws Exception { AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class); User userInfo=userService.getCurrentUser(); accountHead.setCreator(userInfo==null?null:userInfo.getId()); + accountHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); accountHeadMapper.insertSelective(accountHead); //根据单据编号查询单据id AccountHeadExample dhExample = new AccountHeadExample(); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index a932c05dc5..4ed04cdd2a 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -105,8 +105,7 @@ public List select(String type, String subType, String roleTyp List resList = new ArrayList<>(); List list=new ArrayList<>(); try{ - String depotIds = depotService.findDepotStrByCurrentUser(); - String [] depotArray=depotIds.split(","); + String [] depotArray = getDepotArray(subType); String [] creatorArray = getCreatorArray(roleType); Map personMap = personService.getPersonMap(); Map accountMap = accountService.getAccountMap(); @@ -154,8 +153,7 @@ public Long countDepotHead(String type, String subType, String roleType, String String materialParam, Long organId, Long creator, Long depotId) throws Exception{ Long result=null; try{ - String depotIds = depotService.findDepotStrByCurrentUser(); - String [] depotArray=depotIds.split(","); + String [] depotArray = getDepotArray(subType); String [] creatorArray = getCreatorArray(roleType); beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); @@ -167,6 +165,21 @@ public Long countDepotHead(String type, String subType, String roleType, String return result; } + /** + * 根据单据类型获取仓库数组 + * @param subType + * @return + * @throws Exception + */ + public String[] getDepotArray(String subType) throws Exception { + String [] depotArray = null; + if(!BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(subType) && !BusinessConstants.SUB_TYPE_SALES_ORDER.equals(subType)) { + String depotIds = depotService.findDepotStrByCurrentUser(); + depotArray = StringUtil.isNotEmpty(depotIds) ? depotIds.split(",") : null; + } + return depotArray; + } + /** * 根据角色类型获取操作员数组 * @param roleType @@ -248,70 +261,72 @@ public int batchDeleteDepotHead(String ids, HttpServletRequest request)throws Ex @Transactional(value = "transactionManager", rollbackFor = Exception.class) public int batchDeleteBillByIds(String ids)throws Exception { - int result=0; - try{ - StringBuffer sb = new StringBuffer(); - sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); - List dhList = getDepotHeadListByIds(ids); - for(DepotHead depotHead: dhList){ - sb.append("[").append(depotHead.getNumber()).append("]"); - } - logService.insertLog("单据", sb.toString(), - ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); - if(StringUtil.isNotEmpty(ids)){ - String [] headIds=ids.split(","); - for(int i=0;i depotItemList = null; - try { - depotItemList = depotItemMapperEx.findDepotItemListBydepotheadId(id, BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED); - } catch (Exception e) { - JshException.readFail(logger, e); - } - - /**回收序列号*/ - if (depotItemList != null && depotItemList.size() > 0) { - for (DepotItem depotItem : depotItemList) { - //BasicNumber=OperNumber*ratio - serialNumberService.cancelSerialNumber(depotItem.getMaterialId(), depotItem.getHeaderId(), (depotItem.getBasicNumber() == null ? 0 : depotItem.getBasicNumber()).intValue(), userInfo); - } - } - } - //对于零售出库单据,更新会员的预收款信息 - if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) - && BusinessConstants.SUB_TYPE_RETAIL.equals(depotHead.getSubType())){ - if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())) { - if (depotHead.getOrganId() != null) { - supplierService.updateAdvanceIn(depotHead.getOrganId(), depotHead.getTotalPrice().abs()); - } - } + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List dhList = getDepotHeadListByIds(ids); + for(DepotHead depotHead: dhList){ + sb.append("[").append(depotHead.getNumber()).append("]"); + //只有未审核的单据才能被删除 + if("0".equals(depotHead.getStatus())) { + User userInfo = userService.getCurrentUser(); + //删除出库数据回收序列号 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) + && !BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + //查询单据子表列表 + List depotItemList = null; + try { + depotItemList = depotItemMapperEx.findDepotItemListBydepotheadId(depotHead.getId(), BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED); + } catch (Exception e) { + JshException.readFail(logger, e); + } + + /**回收序列号*/ + if (depotItemList != null && depotItemList.size() > 0) { + for (DepotItem depotItem : depotItemList) { + //BasicNumber=OperNumber*ratio + serialNumberService.cancelSerialNumber(depotItem.getMaterialId(), depotItem.getHeaderId(), (depotItem.getBasicNumber() == null ? 0 : depotItem.getBasicNumber()).intValue(), userInfo); } - /**删除单据子表数据*/ - depotItemMapperEx.batchDeleteDepotItemByDepotHeadIds(new Long[]{id}); - //更新当前库存 - List list = depotItemService.getListByHeaderId(id); - for (DepotItem depotItem : list) { - depotItemService.updateCurrentStock(depotItem); + } + } + //对于零售出库单据,更新会员的预收款信息 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) + && BusinessConstants.SUB_TYPE_RETAIL.equals(depotHead.getSubType())){ + if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())) { + if (depotHead.getOrganId() != null) { + supplierService.updateAdvanceIn(depotHead.getOrganId(), depotHead.getTotalPrice().abs()); } - /**删除单据主表信息*/ - batchDeleteDepotHeadByIds(id.toString()); } } + //删除单据子表数据 + depotItemMapperEx.batchDeleteDepotItemByDepotHeadIds(new Long[]{depotHead.getId()}); + //删除单据主表信息 + batchDeleteDepotHeadByIds(depotHead.getId().toString()); + //将关联的订单置为审核状态-针对采购入库和销售出库 + if(StringUtil.isNotEmpty(depotHead.getLinkNumber())){ + if((BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType())) + || (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType()))) { + DepotHead dh = new DepotHead(); + dh.setStatus(BusinessConstants.BILLS_STATUS_AUDIT); + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(depotHead.getLinkNumber()); + depotHeadMapper.updateByExampleSelective(dh, example); + } + } + //更新当前库存 + List list = depotItemService.getListByHeaderId(depotHead.getId()); + for (DepotItem depotItem : list) { + depotItemService.updateCurrentStock(depotItem); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG)); } - result = 1; - }catch(Exception e){ - JshException.writeFail(logger, e); } - return result; + logService.insertLog("单据", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + return 1; } /** @@ -361,32 +376,32 @@ public int checkIsNameExist(Long id, String name)throws Exception { @Transactional(value = "transactionManager", rollbackFor = Exception.class) public int batchSetStatus(String status, String depotHeadIDs)throws Exception { int result = 0; - try{ - List dhIds = new ArrayList<>(); - List ids = StringUtil.strToLongList(depotHeadIDs); - for(Long id: ids) { - DepotHead depotHead = getDepotHead(id); - if("0".equals(status)){ - if("1".equals(depotHead.getStatus())) { - dhIds.add(id); - } - } else if("1".equals(status)){ - if("0".equals(depotHead.getStatus())) { - dhIds.add(id); - } + List dhIds = new ArrayList<>(); + List ids = StringUtil.strToLongList(depotHeadIDs); + for(Long id: ids) { + DepotHead depotHead = getDepotHead(id); + if("0".equals(status)){ + if("1".equals(depotHead.getStatus())) { + dhIds.add(id); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG)); + } + } else if("1".equals(status)){ + if("0".equals(depotHead.getStatus())) { + dhIds.add(id); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG)); } } - if(dhIds.size()>0) { - DepotHead depotHead = new DepotHead(); - depotHead.setStatus(status); - DepotHeadExample example = new DepotHeadExample(); - example.createCriteria().andIdIn(dhIds); - result = depotHeadMapper.updateByExampleSelective(depotHead, example); - } else { - return 1; - } - }catch(Exception e){ - JshException.writeFail(logger, e); + } + if(dhIds.size()>0) { + DepotHead depotHead = new DepotHead(); + depotHead.setStatus(status); + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andIdIn(dhIds); + result = depotHeadMapper.updateByExampleSelective(depotHead, example); } return result; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java index c0c67cebdd..3776835da7 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java @@ -363,8 +363,11 @@ public void saveDetials(String rows, Long headerId, HttpServletRequest request) if (StringUtil.isExist(rowObj.get("depotId"))) { depotItem.setDepotId(rowObj.getLong("depotId")); } else { - throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_CODE, - String.format(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_MSG)); + if(!BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(depotHead.getSubType()) + && !BusinessConstants.SUB_TYPE_SALES_ORDER.equals(depotHead.getSubType())) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_MSG)); + } } if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { if (StringUtil.isExist(rowObj.get("anotherDepotId"))) { @@ -576,20 +579,22 @@ public void updateCurrentStock(DepotItem depotItem){ * @param dId */ public void updateCurrentStockFun(Long mId, Long dId) { - MaterialCurrentStockExample example = new MaterialCurrentStockExample(); - example.createCriteria().andMaterialIdEqualTo(mId).andDepotIdEqualTo(dId) - .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - List list = materialCurrentStockMapper.selectByExample(example); - MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock(); - materialCurrentStock.setMaterialId(mId); - materialCurrentStock.setDepotId(dId); - materialCurrentStock.setCurrentNumber(getStockByParam(dId,mId,null,null)); - if(list!=null && list.size()>0) { - Long mcsId = list.get(0).getId(); - materialCurrentStock.setId(mcsId); - materialCurrentStockMapper.updateByPrimaryKeySelective(materialCurrentStock); - } else { - materialCurrentStockMapper.insertSelective(materialCurrentStock); + if(mId!=null && dId!=null) { + MaterialCurrentStockExample example = new MaterialCurrentStockExample(); + example.createCriteria().andMaterialIdEqualTo(mId).andDepotIdEqualTo(dId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialCurrentStockMapper.selectByExample(example); + MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock(); + materialCurrentStock.setMaterialId(mId); + materialCurrentStock.setDepotId(dId); + materialCurrentStock.setCurrentNumber(getStockByParam(dId,mId,null,null)); + if(list!=null && list.size()>0) { + Long mcsId = list.get(0).getId(); + materialCurrentStock.setId(mcsId); + materialCurrentStockMapper.updateByPrimaryKeySelective(materialCurrentStock); + } else { + materialCurrentStockMapper.insertSelective(materialCurrentStock); + } } } } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java index 1ad8ad3d94..ba5689d795 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/user/UserService.java @@ -496,7 +496,7 @@ public UserEx registerUser(UserEx ue, Integer manageRoleId, HttpServletRequest r throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, ExceptionConstants.USER_NAME_LIMIT_USE_MSG); } else { - ue.setPassword(Tools.md5Encryp(ue.getPassword())); + ue.setPassword(ue.getPassword()); ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM); if (ue.getIsmanager() == null) { ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); diff --git a/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapper.xml b/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapper.xml index 3406798aea..9662ff0494 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapper.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapper.xml @@ -15,6 +15,7 @@ + @@ -78,7 +79,7 @@ id, type, organ_id, hands_person_id, creator, change_amount, discount_money, total_price, - account_id, bill_no, bill_time, remark, file_name, tenant_id, delete_flag + account_id, bill_no, bill_time, remark, file_name, status, tenant_id, delete_flag select group_concat(concat(jsh_material.name,' ',ifnull(jsh_material.standard,''),' ',ifnull(jsh_material.model,''))) as mName from jsh_depot_item - inner join jsh_material on jsh_depot_item.material_id = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1' + left join jsh_material on jsh_depot_item.material_id = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1' where jsh_depot_item.header_id = #{id} and ifnull(jsh_depot_item.delete_flag,'0') !='1' @@ -176,11 +176,11 @@ select dh.number,me.bar_code, m.`name` MName,m.model,m.standard,di.unit_price,di.material_unit as mUnit,di.oper_number,di.all_price,s.supplier SName,d.dName DName, date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType, concat_ws(' ',dh.remark,di.remark) as newRemark from jsh_depot_head dh - inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1' - inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1' + left join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1' + left join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1' left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1' - inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1' - inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1' + left join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1' + left join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1' where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} and dh.organ_id = #{oId} @@ -205,11 +205,11 @@ select di.material_id, m.bar_code, m.mName,m.Model,m.standard,m.categoryName,m.materialUnit, (select sum(jdi.basic_number) numSum from jsh_depot_head jdh - INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1' + left JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1' where jdi.material_id=di.material_id and jdh.type=#{type} and jdh.oper_time >=#{beginTime} and jdh.oper_time <=#{endTime} @@ -243,7 +243,7 @@ and ifnull(jdh.delete_flag,'0') !='1' ) numSum, (select sum(jdi.all_price) priceSum from jsh_depot_head jdh - INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1' + left JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1' where jdi.material_id=di.material_id and jdh.type=#{type} and jdh.oper_time >=#{beginTime} and jdh.oper_time <=#{endTime} @@ -255,13 +255,13 @@ and ifnull(jdh.delete_flag,'0') !='1' ) priceSum from jsh_depot_head dh - INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1' - INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, me.bar_code, Model, standard, + left JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1' + left JOIN (SELECT jsh_material.id,jsh_material.name mName, me.bar_code, Model, standard, jsh_material_category.`Name` categoryName, concat_ws('', jsh_material.unit, u.basic_unit) materialUnit from jsh_material left join jsh_unit u on jsh_material.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_material_extend me on me.material_id=jsh_material.id and ifnull(me.delete_Flag,'0') !='1' - LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1' + left JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1' where me.default_flag=1 and ifnull(jsh_material.delete_Flag,'0') !='1' ) m on m.Id=di.material_id where dh.type=#{type} and dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} @@ -285,11 +285,11 @@ select count(1) from jsh_depot_head dh - inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1' - inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_Flag,'0') !='1' + left join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1' + left join jsh_material m on m.id=di.material_id and ifnull(m.delete_Flag,'0') !='1' left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1' - inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1' + left join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1' where dh.oper_time >=#{beginTime} and dh.oper_time <=#{endTime} and di.depot_id = #{depotIdF} @@ -365,7 +365,7 @@ diff --git a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml index 218d115165..e1e476f3d4 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml @@ -4,6 +4,8 @@ + + @@ -120,7 +122,7 @@ select count(1) from jsh_depot_head dh - INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1' + left JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1' where ((dh.type!='其它' and dh.sub_type!='调拨') or (dh.type='其它' and dh.sub_type='组装单') or (dh.type='其它' and dh.sub_type='拆卸单') @@ -254,7 +258,7 @@ - select user.id, user.username, user.login_name, user.position, user.email, user.phonenum, - user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,user.status,org.org_abr, - rel.user_blng_orga_dspl_seq,rel.id as orgaUserRelId, + select tb.*, (select r.id from jsh_user_business ub - inner join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1' - where ub.type='UserRole' and ub.key_id=user.id limit 0,1) roleId, + left join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1' + where ub.type='UserRole' and ub.key_id=tb.id limit 0,1) roleId, (select r.name from jsh_user_business ub - inner join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1' - where ub.type='UserRole' and ub.key_id=user.id limit 0,1) roleName + left join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1' + where ub.type='UserRole' and ub.key_id=tb.id limit 0,1) roleName + from ( + select user.id, user.username, user.login_name, user.position, user.email, user.phonenum, + user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,user.status,org.org_abr, + rel.user_blng_orga_dspl_seq,rel.id as orgaUserRelId FROM jsh_user user left join jsh_orga_user_rel rel on user.id=rel.user_id and ifnull(rel.delete_flag,'0') !='1' left join jsh_organization org on rel.orga_id=org.id and ifnull(org.delete_flag,'0') !='1' @@ -36,6 +38,7 @@ limit #{offset},#{rows} + ) tb