账套薪资项目添加code

This commit is contained in:
钱涛 2023-08-23 16:20:45 +08:00
parent 0040580b51
commit 7e7615bf4a
17 changed files with 22 additions and 181 deletions

View File

@ -1,23 +0,0 @@
create table hrsa_acct_tax_agent
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_acct_record_id number,
tax_agent_id number,
salary_month date,
tax_cycle date,
income_category varchar2(100)
);
/
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle);
/

View File

@ -0,0 +1,3 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416;
/

View File

@ -1,23 +0,0 @@
create table hrsa_acct_tax_agent
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_acct_record_id number,
tax_agent_id number,
salary_month date,
tax_cycle date,
income_category varchar2(100)
);
/
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle);
/

View File

@ -0,0 +1,3 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416;
/

View File

@ -1,23 +0,0 @@
create table hrsa_acct_tax_agent
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_acct_record_id number,
tax_agent_id number,
salary_month date,
tax_cycle date,
income_category varchar2(100)
);
/
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle);
/

View File

@ -0,0 +1,3 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416;
/

View File

@ -1,22 +0,0 @@
create table hrsa_acct_tax_agent
(
id bigint primary key comment 'ID' ,
create_time datetime comment '创建时间' ,
update_time datetime comment '修改时间' ,
creator bigint comment '创建人id' ,
delete_type int default 0 comment '是否删除' ,
tenant_key varchar(10) comment '租户KEY' ,
salary_acct_record_id bigint comment '薪资核算记录的id' ,
tax_agent_id bigint comment '个税扣缴义务人的id' ,
salary_month datetime comment '薪资所属月' ,
tax_cycle datetime comment '税款所属期' ,
income_category varchar(100)
)
;
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, tax_agent_id, tax_cycle)
;

View File

@ -0,0 +1 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416;

View File

@ -1,23 +0,0 @@
create table hrsa_acct_tax_agent
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_acct_record_id number,
tax_agent_id number,
salary_month date,
tax_cycle date,
income_category varchar2(100)
)
/
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle)
/

View File

@ -0,0 +1,2 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416
/

View File

@ -1,22 +0,0 @@
create table hrsa_acct_tax_agent
(
id bigint primary key ,
create_time timestamp,
update_time timestamp,
creator bigint,
delete_type int default 0,
tenant_key varchar(10),
salary_acct_record_id bigint,
tax_agent_id bigint,
salary_month timestamp,
tax_cycle timestamp,
income_category varchar(100)
);
/
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle);
/

View File

@ -0,0 +1 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416;

View File

@ -1,22 +0,0 @@
create table hrsa_acct_tax_agent
(
id bigint primary key ,
create_time datetime,
update_time datetime,
creator bigint,
delete_type int default 0,
tenant_key nvarchar(10),
salary_acct_record_id bigint,
tax_agent_id bigint,
salary_month datetime,
tax_cycle datetime,
income_category nvarchar(100)
)
GO
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle)
GO

View File

@ -0,0 +1,2 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416
GO

View File

@ -1,23 +0,0 @@
create table hrsa_acct_tax_agent
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_acct_record_id number,
tax_agent_id number,
salary_month date,
tax_cycle date,
income_category varchar2(100)
);
/
insert into hrsa_acct_tax_agent(id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle)
select id, create_time, update_time, creator, tenant_key, salary_acct_record_id, income_category, tax_agent_id, salary_month, tax_cycle
from hrsa_salary_acct_emp
where delete_type = 0
and id in (select max(id) from hrsa_salary_acct_emp group by salary_acct_record_id, income_category, tax_agent_id, tax_cycle);
/

View File

@ -0,0 +1,3 @@
update hrsa_salary_sob_default_item set delete_type=1 where sys_salary_item_id = 700769462612156416;
/

View File

@ -398,6 +398,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder()
.salarySobId(salarySobId)
.salaryItemId(itemParam.getSalaryItemId())
.salaryItemCode(salaryItemPO.getCode())
.salarySobItemGroupId(salarySobItemGroupId)
.formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO))
.sortedIndex(itemParam.getSortedIndex())
@ -477,6 +478,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder()
.salarySobId(salarySobId)
.salaryItemId(itemParam.getSalaryItemId())
.salaryItemCode(salaryItemPO.getCode())
.salarySobItemGroupId(groupId)
.formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO))
.canDelete(itemParam.getCanDelete() == null ? NumberUtils.INTEGER_ONE : (itemParam.getCanDelete() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO))
@ -515,6 +517,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder()
.id(itemParam.getId())
.salaryItemId(itemParam.getSalaryItemId())
.salaryItemCode(salaryItemPO.getCode())
.salarySobItemGroupId(groupId)
.formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO))
.sortedIndex(itemParam.getSortedIndex())
@ -567,6 +570,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
SalarySobItemPO salarySobItemPO = SalarySobItemPO.builder()
.salarySobId(salarySobId)
.salaryItemId(itemParam.getSalaryItemId())
.salaryItemCode(salaryItemPO.getCode())
.salarySobItemGroupId(NumberUtils.LONG_ZERO)
.formulaId(Optional.ofNullable(itemParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO))
.sortedIndex(itemParam.getSortedIndex())