From 20e04f503eadb251ac3fdd8ec6712bc417e7e034 Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Tue, 7 Jun 2022 15:19:21 +0800 Subject: [PATCH] =?UTF-8?q?sql=20server=20=E5=88=86=E6=9D=83=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sql/分权sql server.sql | 56 +++++++++---------- .../service/impl/TaxAgentServiceImpl.java | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/resource/sql/分权sql server.sql b/resource/sql/分权sql server.sql index 91473dee4..3ca742cae 100644 --- a/resource/sql/分权sql server.sql +++ b/resource/sql/分权sql server.sql @@ -7,7 +7,7 @@ CREATE TABLE [hrsa_tax_agent_emp] ( [create_time] datetime NULL, [update_time] datetime NULL, [creator] bigint NULL, - [delete_type] int NULL, + [delete_type] int DEFAULT 0, [tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL, [tax_agent_id] bigint NULL, [employee_id] bigint NULL, @@ -43,11 +43,11 @@ GO CREATE TABLE [hrsa_tax_agent_base] ( [id] bigint NOT NULL, - [devolution_status] int NULL, - [create_time] datetime NULL, - [update_time] datetime NULL, - [creator] bigint NULL, - [delete_type] int NULL, + [devolution_status] int DEFAULT 0, + [create_time] datetime DEFAULT getdate(), + [update_time] datetime DEFAULT getdate(), + [creator] bigint DEFAULT 0, + [delete_type] int DEFAULT 0, [tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL ) GO @@ -75,19 +75,19 @@ GO CREATE TABLE [hrsa_tax_agent_manage_range] ( [id] bigint NOT NULL, - [tax_agent_id] bigint NULL, - [employee_id] bigint NULL, - [tax_agent_sub_admin_id] bigint NULL, - [target_type] tinyint NULL, - [target_id] bigint NULL, + [tax_agent_id] bigint DEFAULT 0, + [employee_id] bigint DEFAULT 0, + [tax_agent_sub_admin_id] bigint DEFAULT 0, + [target_type] tinyint DEFAULT 1, + [target_id] bigint DEFAULT 0, [employee_status] varchar(100) COLLATE Chinese_PRC_CI_AS NULL, - [include_type] int NULL, - [creator] bigint NULL, - [create_time] datetime NULL, - [update_time] datetime NULL, - [delete_type] int NULL, + [include_type] int DEFAULT 1, + [creator] bigint DEFAULT 0, + [create_time] datetime DEFAULT getdate(), + [update_time] datetime DEFAULT getdate(), + [delete_type] int DEFAULT 0, [tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL, - [range_type] int NULL + [range_type] int DEFAULT 0 ) GO @@ -120,13 +120,13 @@ CREATE TABLE [hrsa_tax_agent_emp_change] ( [create_time] datetime NULL, [update_time] datetime NULL, [creator] bigint NULL, - [delete_type] int NULL, + [delete_type] int DEFAULT 0, [tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL, [tax_agent_id] bigint NULL, [employee_id] bigint NULL, - [change_type] int NULL, + [change_type] int DEFAULT 0, [employee_name] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, - [module_type] int NULL + [module_type] int DEFAULT 0 ) GO @@ -160,11 +160,11 @@ CREATE TABLE [hrsa_tax_agent_sub_admin_emp] ( [create_time] datetime NULL, [update_time] datetime NULL, [creator] bigint NULL, - [delete_type] int NULL, + [delete_type] int DEFAULT 0, [tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL, - [tax_agent_id] bigint NULL, - [tax_agent_sub_admin_id] bigint NULL, - [employee_id] bigint NULL, + [tax_agent_id] bigint DEFAULT 0, + [tax_agent_sub_admin_id] bigint DEFAULT 0, + [employee_id] bigint DEFAULT 0, [employee_name] varchar(255) COLLATE Chinese_PRC_CI_AS NULL ) GO @@ -289,10 +289,10 @@ CREATE TABLE [hrsa_tax_agent_admin] ( [id] bigint NOT NULL, [tax_agent_id] bigint NULL, [employee_id] bigint NULL, - [create_time] datetime NULL, - [update_time] datetime NULL, - [creator] bigint NULL, - [delete_type] int NULL, + [create_time] datetime DEFAULT getdate(), + [update_time] datetime DEFAULT getdate(), + [creator] bigint DEFAULT 0, + [delete_type] int DEFAULT 0, [tenant_key] varchar(10) COLLATE Chinese_PRC_CI_AS NULL ) GO diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index 65f15670a..98a241e74 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -290,7 +290,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { TaxAgentPO taxAgent = TaxAgentBO.convertToPO(saveParam, (long) user.getUID()); getTaxAgentMapper().insert(taxAgent); if (isOpenDevolution) { - getTaxAgentAdminService(user).batchInsert(saveParam.getId(), saveParam.getAdminUserIds()); + getTaxAgentAdminService(user).batchInsert(taxAgent.getId(), saveParam.getAdminUserIds()); } // 记录日志 // SalaryLoggerUtil.recordAddSingleLog(taxAgentLoggerTemplate,