Pre Merge pull request !225 from reset/feature/cl
commit
5bb340c109
@ -0,0 +1,37 @@
|
||||
DROP TABLE IF EXISTS `jcl_org_item`;
|
||||
CREATE TABLE `jcl_org_item` (
|
||||
`fid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fclassid` int(11) NOT NULL,
|
||||
`fno` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`fname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`fmemo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`fdelete` int(11) NOT NULL,
|
||||
`creator` int(11) NULL DEFAULT NULL,
|
||||
`create_time` date NULL DEFAULT NULL,
|
||||
`update_time` date NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`fid`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `jcl_org_itemclass`;
|
||||
CREATE TABLE `jcl_org_itemclass` (
|
||||
`fid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fno` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`fname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`fmemo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`creator` int(11) NULL DEFAULT NULL,
|
||||
`create_time` date NULL DEFAULT NULL,
|
||||
`update_time` date NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`fid`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
|
||||
DROP TRIGGER IF EXISTS HrmCompany_ed;
|
||||
DROP TRIGGER IF EXISTS JCL_ORG_COMP_ed;
|
||||
DROP TRIGGER IF EXISTS JCL_ORG_COMP_del;
|
||||
DROP TRIGGER IF EXISTS JCL_ORG_dept_ed;
|
||||
DROP TRIGGER IF EXISTS JCL_ORG_dept_del;
|
||||
DROP TRIGGER IF EXISTS JCL_ORG_job_ed;
|
||||
DROP TRIGGER IF EXISTS JCL_ORG_job_del;
|
||||
DROP TRIGGER IF EXISTS hrmresource_ed;
|
||||
DROP TRIGGER IF EXISTS cus_fielddata_jclgw;
|
@ -0,0 +1,125 @@
|
||||
alter table JCL_ORG_STAFFS add description varchar2(200)
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_ITEMCLASS');
|
||||
END;
|
||||
/
|
||||
CREATE TABLE JCL_ORG_ITEMCLASS (
|
||||
FID NUMBER NOT NULL,
|
||||
FNO NVARCHAR2(50) NOT NULL,
|
||||
FNAME NVARCHAR2 (50) NOT NULL,
|
||||
FMEMO NVARCHAR2 (255) NULL ,
|
||||
CREATOR NUMBER NULL,
|
||||
CREATE_TIME DATE NULL,
|
||||
UPDATE_TIME DATE NULL,
|
||||
CONSTRAINT JCL_ORG_ITEMCLASS_PK PRIMARY KEY (FID)
|
||||
)
|
||||
/
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_ITEMCLASS_ID');
|
||||
END;
|
||||
/
|
||||
CREATE SEQUENCE JCL_ORG_ITEMCLASS_ID INCREMENT BY 1 START WITH 1 nomaxvalue minvalue 1 NOCYCLE
|
||||
/
|
||||
CREATE
|
||||
OR REPLACE TRIGGER JCL_ORG_ITEMCLASS_ID_TIGGER BEFORE INSERT ON JCL_ORG_ITEMCLASS FOR EACH ROW
|
||||
BEGIN
|
||||
SELECT
|
||||
JCL_ORG_ITEMCLASS_ID.nextval INTO:new.FID
|
||||
FROM
|
||||
dual;
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_ITEM');
|
||||
END;
|
||||
/
|
||||
CREATE TABLE JCL_ORG_ITEM (
|
||||
FID NUMBER NOT NULL,
|
||||
FCLASSID NUMBER NOT NULL,
|
||||
FNO NVARCHAR2(50) NOT NULL,
|
||||
FNAME NVARCHAR2 (255) NOT NULL,
|
||||
FMEMO NVARCHAR2 (255) NULL,
|
||||
FDELETE NUMBER NOT NULL,
|
||||
CREATOR NUMBER NULL,
|
||||
CREATE_TIME DATE NULL,
|
||||
UPDATE_TIME DATE NULL,
|
||||
CONSTRAINT JCL_ORG_ITEM_PK PRIMARY KEY (FID)
|
||||
)
|
||||
/
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_ITEM_ID');
|
||||
END;
|
||||
/
|
||||
CREATE SEQUENCE JCL_ORG_ITEM_ID INCREMENT BY 1 START WITH 1 nomaxvalue minvalue 1 NOCYCLE
|
||||
/
|
||||
CREATE
|
||||
OR REPLACE TRIGGER JCL_ORG_ITEM_ID_TIGGER BEFORE INSERT ON JCL_ORG_ITEM FOR EACH ROW
|
||||
BEGIN
|
||||
SELECT
|
||||
JCL_ORG_ITEM_ID.nextval INTO:new.FID
|
||||
FROM
|
||||
dual;
|
||||
END;
|
||||
/
|
||||
|
||||
declare
|
||||
V_NUM number;
|
||||
BEGIN
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'HrmCompany_ed';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER HrmCompany_ed';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'JCL_ORG_COMP_ed';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER JCL_ORG_COMP_ed';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'JCL_ORG_COMP_del';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER JCL_ORG_COMP_del';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'JCL_ORG_dept_ed';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER JCL_ORG_dept_ed';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'JCL_ORG_dept_del';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER JCL_ORG_dept_del';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'JCL_ORG_job_ed';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER JCL_ORG_job_ed';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'JCL_ORG_job_del';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER JCL_ORG_job_del';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'hrmresource_ed';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER hrmresource_ed';
|
||||
end if;
|
||||
|
||||
V_NUM := 0;
|
||||
select count(0) into V_NUM from user_triggers where trigger_name = 'cus_fielddata_jclgw';
|
||||
if V_NUM > 0 then
|
||||
execute immediate 'DROP TRIGGER cus_fielddata_jclgw';
|
||||
end if;
|
||||
END;
|
||||
/
|
@ -0,0 +1,79 @@
|
||||
alter table JCL_ORG_STAFFS add description varchar(200)
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_ITEMCLASS]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_ITEMCLASS]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[JCL_ORG_ITEMCLASS] (
|
||||
[fid] int IDENTITY(1,1) NOT NULL,
|
||||
[fno] varchar(50) NOT NULL,
|
||||
[fname] varchar(50) NOT NULL,
|
||||
[fmemo] varchar(255) NULL,
|
||||
[creator] int NULL,
|
||||
[create_time] datetime NULL,
|
||||
[update_time] datetime NULL
|
||||
)
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JCL_ORG_ITEMCLASS] SET (LOCK_ESCALATION = TABLE)
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JCL_ORG_ITEMCLASS] ADD CONSTRAINT [JCL_ORG_ITEMCLASS_PK] PRIMARY KEY CLUSTERED ([fid])
|
||||
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
ON [PRIMARY]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_ITEM]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_ITEM]
|
||||
GO
|
||||
|
||||
CREATE TABLE [dbo].[JCL_ORG_ITEM] (
|
||||
[fid] int IDENTITY(1,1) NOT NULL,
|
||||
[fclassid] int NOT NULL,
|
||||
[fno] varchar(50) NOT NULL,
|
||||
[fname] varchar(255) NOT NULL,
|
||||
[fmemo] varchar(255) NULL,
|
||||
[fdelete] int NOT NULL,
|
||||
[creator] int NULL,
|
||||
[create_time] datetime NULL,
|
||||
[update_time] datetime NULL
|
||||
)
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JCL_ORG_ITEM] SET (LOCK_ESCALATION = TABLE)
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[JCL_ORG_ITEM] ADD CONSTRAINT [JCL_ORG_ITEM_PK] PRIMARY KEY CLUSTERED ([fid])
|
||||
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
|
||||
ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[HrmCompany_ed]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[HrmCompany_ed]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_COMP_ed]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[JCL_ORG_COMP_ed]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_COMP_del]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[JCL_ORG_COMP_del]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_dept_ed]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[JCL_ORG_dept_ed]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_dept_del]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[JCL_ORG_dept_del]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_job_ed]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[JCL_ORG_job_ed]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_job_del]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[JCL_ORG_job_del]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[hrmresource_ed]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[hrmresource_ed]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[cus_fielddata_jclgw]') AND type IN ('TR'))
|
||||
DROP TRIGGER [dbo].[cus_fielddata_jclgw]
|
||||
GO
|
@ -0,0 +1,31 @@
|
||||
DROP TABLE IF EXISTS `hr_log`;
|
||||
DROP TABLE IF EXISTS `jcl_field_extendgroup`;
|
||||
DROP TABLE IF EXISTS `jcl_field_extendinfo`;
|
||||
DROP TABLE IF EXISTS `jcl_field_extendtitle`;
|
||||
DROP TABLE IF EXISTS `jcl_org_comp`;
|
||||
DROP TABLE IF EXISTS `jcl_org_compext`;
|
||||
DROP TABLE IF EXISTS `jcl_org_compext_dt1`;
|
||||
DROP TABLE IF EXISTS `jcl_org_dept`;
|
||||
DROP TABLE IF EXISTS `jcl_org_deptext`;
|
||||
DROP TABLE IF EXISTS `jcl_org_deptext_dt1`;
|
||||
DROP TABLE IF EXISTS `jcl_org_grade`;
|
||||
DROP TABLE IF EXISTS `jcl_org_hrmrelation`;
|
||||
DROP TABLE IF EXISTS `jcl_org_hrmresource`;
|
||||
DROP TABLE IF EXISTS `jcl_org_hrmresourceext`;
|
||||
DROP TABLE IF EXISTS `jcl_org_hrmresourceext_dt1`;
|
||||
DROP TABLE IF EXISTS `jcl_org_job`;
|
||||
DROP TABLE IF EXISTS `jcl_org_jobdt`;
|
||||
DROP TABLE IF EXISTS `jcl_org_jobext`;
|
||||
DROP TABLE IF EXISTS `jcl_org_jobext_dt1`;
|
||||
DROP TABLE IF EXISTS `jcl_org_level`;
|
||||
DROP TABLE IF EXISTS `jcl_org_map`;
|
||||
DROP TABLE IF EXISTS `jcl_org_post`;
|
||||
DROP TABLE IF EXISTS `jcl_org_post_info`;
|
||||
DROP TABLE IF EXISTS `jcl_org_scheme`;
|
||||
DROP TABLE IF EXISTS `jcl_org_sequence`;
|
||||
DROP TABLE IF EXISTS `jcl_org_staff`;
|
||||
DROP TABLE IF EXISTS `jcl_org_staffplan`;
|
||||
DROP TABLE IF EXISTS `jcl_org_staffs`;
|
||||
DROP TABLE IF EXISTS `jcl_import_history`;
|
||||
DROP TABLE IF EXISTS `jcl_import_history_detail`;
|
||||
DROP TABLE IF EXISTS `JCL_INFO`;
|
@ -0,0 +1,308 @@
|
||||
create or replace procedure jcl_droptable(
|
||||
p_table in varchar2
|
||||
) is
|
||||
v_count number(10);
|
||||
begin
|
||||
select count(*) into v_count from user_tables where table_name = upper(p_table);
|
||||
if v_count > 0 then
|
||||
execute immediate 'drop table ' || p_table ;
|
||||
end if;
|
||||
end jcl_droptable;
|
||||
/
|
||||
|
||||
create or replace procedure jcl_dropsequence(
|
||||
p_sequence in varchar2
|
||||
) is
|
||||
v_count number(10);
|
||||
begin
|
||||
select count(*) into v_count from user_sequences where sequence_name = upper(p_sequence);
|
||||
if v_count > 0 then
|
||||
execute immediate 'drop sequence ' || p_sequence ;
|
||||
end if;
|
||||
end jcl_dropsequence;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_SCHEME');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_LEVEL');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_GRADE');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_SEQUENCE');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_POST');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_POST_INFO');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_COMP');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_FIELD_EXTENDGROUP');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_FIELD_EXTENDTITLE');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_FIELD_EXTENDINFO');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_COMPEXT');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_COMPEXT_DT1');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_DEPT');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_DEPTEXT');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_DEPTEXT_DT1');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_JOB');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_JOBDT');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_JOBEXT');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_JOBEXT_DT1');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_HRMRESOURCE');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_HRMRESOURCEEXT');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_HRMRESOURCEEXT_DT1');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_STAFFPLAN');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_STAFF');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_STAFFS');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('HR_LOG');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_HRMRELATION');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_ORG_MAP');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_IMPORT_HISTORY');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_IMPORT_HISTORY_DETAIL');
|
||||
END;
|
||||
/
|
||||
|
||||
begin
|
||||
jcl_droptable('JCL_INFO');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_SCHEME_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_LEVEL_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_GRADE_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_SEQUENCE_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_POST_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_POST_INFO_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_COMP_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_FIELD_GROUP_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_FIELD_TITLE_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_FIELD_INFO_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_COMPEXT_DT1_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_DEPT_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_DEPTEXT_DT1_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_JOB_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_JOBDT_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_JOBEXT_DT1_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_HRM_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_HRMEXT_DT1_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_STAFFPLAN_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_STAFF_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_STAFFS_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_ORG_MAP_FID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('HR_LOG_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_IMPORT_HISTORY_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_IMPORT_DETAIL_ID');
|
||||
END;
|
||||
/
|
||||
|
||||
BEGIN
|
||||
jcl_dropsequence('JCL_INFO_ID');
|
||||
END;
|
||||
/
|
@ -0,0 +1,122 @@
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[HR_LOG]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[HR_LOG]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_FIELD_EXTENDGROUP]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_FIELD_EXTENDGROUP]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_FIELD_EXTENDINFO]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_FIELD_EXTENDINFO]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_FIELD_EXTENDTITLE]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_FIELD_EXTENDTITLE]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_COMP]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_COMP]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_COMPEXT]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_COMPEXT]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_COMPEXT_DT1]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_COMPEXT_DT1]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_DEPT]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_DEPT]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_DEPTEXT]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_DEPTEXT]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_DEPTEXT_DT1]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_DEPTEXT_DT1]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_GRADE]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_GRADE]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_HRMRELATION]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_HRMRELATION]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_HRMRESOURCE]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_HRMRESOURCE]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_HRMRESOURCEEXT]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_HRMRESOURCEEXT]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_HRMRESOURCEEXT_DT1]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_HRMRESOURCEEXT_DT1]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_JOB]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_JOB]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_JOBDT]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_JOBDT]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_JOBEXT]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_JOBEXT]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_JOBEXT_DT1]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_JOBEXT_DT1]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_LEVEL]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_LEVEL]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_POST]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_POST]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_POST_INFO]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_POST_INFO]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_SCHEME]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_SCHEME]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_SEQUENCE]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_SEQUENCE]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_STAFF]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_STAFF]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_STAFFPLAN]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_STAFFPLAN]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_STAFFS]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_STAFFS]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_MAP]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_ORG_MAP]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_IMPORT_HISTORY_DETAIL]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_IMPORT_HISTORY_DETAIL]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_IMPORT_HISTORY]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[JCL_IMPORT_HISTORY]
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[jcl_info]') AND type IN ('U'))
|
||||
DROP TABLE [dbo].[jcl_info]
|
||||
GO
|
@ -0,0 +1,12 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/nonStandard")
|
||||
public class NonStandardOptController extends com.engine.organization.web.NonStandardOptController {
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.engine.organization.entity.map;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class JclOrgMap {
|
||||
Integer id;
|
||||
Integer fType;
|
||||
Integer fObjId;
|
||||
Integer fEcId;
|
||||
String uuid;
|
||||
Integer fClass;
|
||||
String fClassName;
|
||||
String fNumber;
|
||||
String fName;
|
||||
Integer fLeader;
|
||||
String fLeaderImg;
|
||||
String fLeaderName;
|
||||
Integer fLeaderJobId;
|
||||
String fLeaderJob;
|
||||
String fLeaderLv;
|
||||
String fLeaderSt;
|
||||
Integer fParentId;
|
||||
Integer fObjParentId;
|
||||
Integer fPlan;
|
||||
Integer fOnJob;
|
||||
Integer fIsVitual;
|
||||
Date fDateBegin;
|
||||
Date fDateEnd;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.engine.organization.mapper.jclorgmap;
|
||||
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface JclOrgMapper {
|
||||
int insertMap(JclOrgMap jclOrgMap);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.jclorgmap.JclOrgMapper">
|
||||
|
||||
<insert id="insertMap">
|
||||
insert into jcl_org_map
|
||||
(id, ftype, fobjid, fecid, uuid, fclass, fclassname, fnumber, fname, fleader, fleaderimg,
|
||||
fleadername, fleaderjobid, fleaderjob, fleaderlv, fleaderst, fparentid, fobjparentid,
|
||||
fplan, fonjob, fisvitual, fdatebegin, fdateend)
|
||||
values (#{id}, #{fType}, #{fObjId}, #{fEcId}, #{uuid}, #{fClass}, #{fClassName}, #{fNumber}, #{fName},
|
||||
#{fLeader}, #{fLeaderImg},
|
||||
#{fLeaderName}, #{fLeaderJobId}, #{fLeaderJob}, #{fLeaderLv}, #{fLeaderSt}, #{fParentId},
|
||||
#{fObjParentId},
|
||||
#{fPlan}, #{fOnJob}, #{fIsVitual}, #{fDateBegin}, #{fDateEnd})
|
||||
</insert>
|
||||
</mapper>
|
@ -0,0 +1,32 @@
|
||||
package com.engine.organization.mapper.trigger;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Date 2022/8/30
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface CompTriggerMapper {
|
||||
Integer getEcCompanyIdByUuid(@Param("uuid") String uuid);
|
||||
|
||||
HrmResource getHrmResourceById(@Param("id") Integer id);
|
||||
|
||||
String getJobTitleMarkById(@Param("id") Integer id);
|
||||
|
||||
JSONObject getCusFieldDataById(@Param("id") Integer id);
|
||||
|
||||
Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("compId") Integer compId);
|
||||
|
||||
Integer countHrmResource(@Param("subcompanyid1") Integer subcompanyid1);
|
||||
|
||||
int deleteMap(@Param("ftype") Integer ftype, @Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin);
|
||||
|
||||
int updateMap(@Param("ftype") Integer ftype, @Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin, @Param("fdate") Date fdate);
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.trigger.CompTriggerMapper">
|
||||
<update id="updateMap">
|
||||
update jcl_org_map
|
||||
<set>
|
||||
fdateend=#{fdate},
|
||||
</set>
|
||||
where ftype=#{ftype} and fobjid=#{fobjid} and fdateend > #{fdatebegin}
|
||||
</update>
|
||||
<delete id="deleteMap">
|
||||
delete
|
||||
from jcl_org_map
|
||||
where ftype = #{ftype}
|
||||
and fobjid = #{fobjid}
|
||||
and fdatebegin = #{fdatebegin}
|
||||
</delete>
|
||||
|
||||
<select id="getEcCompanyIdByUuid" resultType="java.lang.Integer">
|
||||
select id
|
||||
from HrmSubCompany
|
||||
where uuid = #{uuid}
|
||||
</select>
|
||||
<select id="getHrmResourceById" resultType="weaver.hrm.passwordprotection.domain.HrmResource">
|
||||
select messagerurl, lastname, jobtitle
|
||||
from hrmresource
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getJobTitleMarkById" resultType="java.lang.String">
|
||||
select jobtitlemark
|
||||
from hrmjobtitles
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getCusFieldDataById" resultType="com.alibaba.fastjson.JSONObject">
|
||||
select field100008, field100007
|
||||
from cus_fielddata
|
||||
where scope = 'HrmCustomFieldByInfoType'
|
||||
and scopeid = 3
|
||||
and id = #{id}
|
||||
</select>
|
||||
<select id="sumStaffNum" resultType="java.lang.Integer">
|
||||
select sum(staff_num)
|
||||
from JCL_ORG_STAFF
|
||||
where plan_id in (select id
|
||||
from JCL_ORG_STAFFPLAN
|
||||
where time_start <= #{fdatebegin}
|
||||
and time_end >= #{fdatebegin})
|
||||
and comp_id = #{compId}
|
||||
</select>
|
||||
<select id="countHrmResource" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from hrmresource
|
||||
where status <= 3
|
||||
and subcompanyid1 = #{subcompanyid1}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,20 @@
|
||||
package com.engine.organization.mapper.trigger;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Date 2022/8/30
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface DepartmentTriggerMapper {
|
||||
Integer getEcDepartmentIdByUuid(@Param("uuid") String uuid);
|
||||
|
||||
Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("departmentId") Integer departmentId);
|
||||
|
||||
|
||||
Integer countHrmResource(@Param("departmentid") Integer departmentid);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.trigger.DepartmentTriggerMapper">
|
||||
<select id="getEcDepartmentIdByUuid" resultType="java.lang.Integer">
|
||||
select id
|
||||
from HrmDepartment
|
||||
where uuid = #{uuid}
|
||||
</select>
|
||||
<select id="sumStaffNum" resultType="java.lang.Integer">
|
||||
select sum(staff_num)
|
||||
from JCL_ORG_STAFF
|
||||
where plan_id in (select id
|
||||
from JCL_ORG_STAFFPLAN
|
||||
where time_start <= #{fdatebegin}
|
||||
and time_end >= #{fdatebegin})
|
||||
and dept_id = #{departmentId}
|
||||
</select>
|
||||
<select id="countHrmResource" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from hrmresource
|
||||
where status <= 3
|
||||
and departmentid = #{departmentid}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
package com.engine.organization.mapper.trigger;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Date 2022/8/30
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface GroupTriggerMapper {
|
||||
|
||||
int getInfoValue(@Param("id") Integer id);
|
||||
|
||||
Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin);
|
||||
|
||||
Integer countHrmResource();
|
||||
|
||||
int deleteMap(@Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin);
|
||||
|
||||
int updateMap(@Param("fobjid") Integer fobjid, @Param("fdatebegin") Date fdatebegin, @Param("fdate") Date fdate);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.trigger.GroupTriggerMapper">
|
||||
<update id="updateMap">
|
||||
update jcl_org_map
|
||||
set fdateend=dateadd(day,-1, #{fdate})
|
||||
where fobjid = #{fobjid}
|
||||
and fdateend > #{fdatebegin}
|
||||
</update>
|
||||
<delete id="deleteMap">
|
||||
delete
|
||||
from jcl_org_map
|
||||
where fobjid = 0
|
||||
and fdatebegin = #{fdatebegin}
|
||||
</delete>
|
||||
|
||||
<select id="getInfoValue" resultType="java.lang.Integer">
|
||||
select fvalue
|
||||
from jcl_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="sumStaffNum" resultType="java.lang.Integer">
|
||||
select sum(staff_num)
|
||||
from JCL_ORG_STAFF
|
||||
where plan_id in (select id
|
||||
from JCL_ORG_STAFFPLAN
|
||||
where time_start <= #{fdatebegin}
|
||||
and time_end >= #{fdatebegin})
|
||||
</select>
|
||||
<select id="countHrmResource" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from hrmresource
|
||||
where status <= 3
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
package com.engine.organization.mapper.trigger;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface HrmResourceTriggerMapper {
|
||||
HrmResource getHrmResource(@Param("id") Long id);
|
||||
|
||||
JSONObject getCusFieldDataById(@Param("fObjId") Integer fObjId);
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.trigger.HrmResourceTriggerMapper">
|
||||
|
||||
<select id="getHrmResource" resultType="weaver.hrm.passwordprotection.domain.HrmResource">
|
||||
select id, workcode, lastname, status, messagerurl, jobtitle
|
||||
from hrmresource
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getCusFieldDataById" resultType="com.alibaba.fastjson.JSONObject">
|
||||
select field100002, field100008, field100007
|
||||
from cus_fielddata
|
||||
where scope = 'HrmCustomFieldByInfoType'
|
||||
and scopeid = 3
|
||||
and id = #{fObjId}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
package com.engine.organization.mapper.trigger;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
/**
|
||||
* @Author dxfeng
|
||||
* @Date 2022/8/30
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface JobTriggerMapper {
|
||||
Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("jobId") Integer jobId);
|
||||
|
||||
Integer countHrmResource(@Param("parentdept") Integer parentdept, @Param("fname") String fname);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.trigger.JobTriggerMapper">
|
||||
|
||||
<select id="sumStaffNum" resultType="java.lang.Integer">
|
||||
select sum(staff_num)
|
||||
from JCL_ORG_STAFF
|
||||
where plan_id in (select id
|
||||
from JCL_ORG_STAFFPLAN
|
||||
where time_start <= #{fdatebegin}
|
||||
and time_end >= #{fdatebegin})
|
||||
and job_id = #{jobId}
|
||||
</select>
|
||||
<select id="countHrmResource" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from hrmresource
|
||||
where status <= 3
|
||||
and departmentid =
|
||||
(select id from hrmdepartment where uuid = (select uuid from JCL_ORG_DEPT where id = #{parentdept}))
|
||||
and jobtitle in (select id from hrmjobtitles where JOBTITLENAME = #{fname})
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,16 @@
|
||||
package com.engine.organization.service;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface NonStandardOptService {
|
||||
/**
|
||||
* 非标开关启用、禁用后操作
|
||||
*
|
||||
* @param method
|
||||
* @param ids
|
||||
*/
|
||||
void NonStandardOpt(String method, String ids);
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.service.NonStandardOptService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class NonStandardOptServiceImpl extends Service implements NonStandardOptService {
|
||||
private static final String NON_STANDARD_NUM = "151";
|
||||
private static final String START = "start";
|
||||
private static final String STOP = "stop";
|
||||
|
||||
@Override
|
||||
public void NonStandardOpt(String method, String ids) {
|
||||
if (StringUtils.isAnyBlank(ids, method)) {
|
||||
return;
|
||||
}
|
||||
// 判断是否包含151非标号
|
||||
boolean contains = Arrays.asList(ids.split(",")).contains(NON_STANDARD_NUM);
|
||||
if (contains) {
|
||||
switch (method.toLowerCase()) {
|
||||
case START:
|
||||
Start();
|
||||
break;
|
||||
case STOP:
|
||||
Stop();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
RecordSet rs = new RecordSet();
|
||||
// 更新人员表系统字段
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=1,allowhide=-1 where fieldname='sex'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=-1 where fieldname='departmentid'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=-1 where fieldname='jobtitle'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='jobactivity'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='joblevel'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='jobcall'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='jobGroupId'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='jobactivitydesc'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1,groupid=1,fieldorder=18 where fieldname='managerid'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1,groupid=1,fieldorder=99 where fieldname='systemlanguage'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1,groupid=1,fieldorder=21 where fieldname='assistantid'");
|
||||
|
||||
// 更新聚才林自定义字段
|
||||
rs.executeUpdate("update cus_formfield set ISMAND = 1, ISUSE = 1 where SCOPE = 'HrmCustomFieldByInfoType' and SCOPEID = -1 and FIELDID in(100001,100002,100003)");
|
||||
rs.executeUpdate("update cus_formfield set ISMAND = 0, ISUSE = 1 where scope = 'HrmCustomFieldByInfoType' and SCOPEID = 3 and FIELDID in(100005, 100006, 100007, 100008, 100009, 100010, 100004)");
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Stop() {
|
||||
RecordSet rs = new RecordSet();
|
||||
// 更新人员表系统字段
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1 where fieldname='sex'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=1,allowhide=-1 where fieldname='departmentid'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=1,allowhide=-1 where fieldname='jobtitle'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=1,allowhide=1 where fieldname='jobactivity'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1 where fieldname='joblevel'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1 where fieldname='jobcall'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1 where fieldname='jobGroupId'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1 where fieldname='jobactivitydesc'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=1,allowhide=-1,groupid=3,fieldorder=21 where fieldname='managerid'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1,groupid=1,fieldorder=12 where fieldname='systemlanguage'");
|
||||
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=1,groupid=3,fieldorder=22 where fieldname='assistantid'");
|
||||
|
||||
// 更新聚才林自定义字段
|
||||
rs.executeUpdate("update cus_formfield set ISMAND = 0, ISUSE = 0 where SCOPE = 'HrmCustomFieldByInfoType' and SCOPEID = -1 and FIELDID in(100001,100002,100003)");
|
||||
rs.executeUpdate("update cus_formfield set ISMAND = 0, ISUSE = 0 where scope = 'HrmCustomFieldByInfoType' and SCOPEID = 3 and FIELDID in(100005, 100006, 100007, 100008, 100009, 100010, 100004)");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.logview.bo.FieldBaseEquator;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.trigger.CompTriggerMapper;
|
||||
import com.engine.organization.util.OrganizationDateUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/08/30
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class CompanyTriggerRunnable implements Runnable {
|
||||
|
||||
private final CompPO oldCompany;
|
||||
private final CompPO newCompany;
|
||||
|
||||
private CompTriggerMapper getCompTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(CompTriggerMapper.class);
|
||||
}
|
||||
|
||||
public CompanyTriggerRunnable(CompPO oldCompany, CompPO newCompany) {
|
||||
this.oldCompany = oldCompany;
|
||||
this.newCompany = newCompany;
|
||||
}
|
||||
|
||||
public CompanyTriggerRunnable(Long companyId) {
|
||||
this.oldCompany = new CompPO();
|
||||
this.newCompany = MapperProxyFactory.getProxy(CompMapper.class).listById(companyId);
|
||||
}
|
||||
|
||||
public CompanyTriggerRunnable(CompPO newCompany) {
|
||||
this.oldCompany = new CompPO();
|
||||
this.newCompany = newCompany;
|
||||
this.newCompany.setDeleteType(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
FieldBaseEquator fieldBaseEquator = new FieldBaseEquator();
|
||||
List<String> diffFields = fieldBaseEquator.getDiffFieldList(oldCompany, newCompany);
|
||||
if (CollectionUtils.isEmpty(diffFields)) {
|
||||
return;
|
||||
}
|
||||
// 判断
|
||||
if (diffFields.contains("compName") || diffFields.contains("compPrincipal") || diffFields.contains("parentCompany") || diffFields.contains("forbiddenTag") || diffFields.contains("deleteType")) {
|
||||
JclOrgMap jclMap = new JclOrgMap();
|
||||
|
||||
jclMap.setFType(1);
|
||||
// 更新逻辑
|
||||
jclMap.setFObjId(newCompany.getId().intValue());
|
||||
jclMap.setId(newCompany.getId().intValue());
|
||||
jclMap.setUuid(newCompany.getUuid());
|
||||
jclMap.setFNumber(newCompany.getCompNo());
|
||||
jclMap.setFName(newCompany.getCompName());
|
||||
jclMap.setFLeader(newCompany.getCompPrincipal());
|
||||
jclMap.setFParentId(null == newCompany.getParentCompany() ? 0 : newCompany.getParentCompany().intValue());
|
||||
jclMap.setFObjParentId(null == newCompany.getParentCompany() ? 0 : newCompany.getParentCompany().intValue());
|
||||
jclMap.setFEcId(getCompTriggerMapper().getEcCompanyIdByUuid(jclMap.getUuid()));
|
||||
|
||||
|
||||
jclMap.setFClass(0);
|
||||
jclMap.setFClassName("行政维度");
|
||||
HrmResource hrmResourceById = getCompTriggerMapper().getHrmResourceById(jclMap.getFLeader());
|
||||
|
||||
|
||||
if (null != hrmResourceById) {
|
||||
jclMap.setFLeaderImg(hrmResourceById.getMessagerurl());
|
||||
jclMap.setFLeaderName(hrmResourceById.getLastname());
|
||||
jclMap.setFLeaderJobId(hrmResourceById.getJobtitle());
|
||||
}
|
||||
|
||||
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
|
||||
|
||||
JSONObject cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclMap.getFLeader());
|
||||
if (null != cusFieldDataById) {
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
}
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
|
||||
|
||||
jclMap.setFPlan(getCompTriggerMapper().sumStaffNum(jclMap.getFDateBegin(), jclMap.getFObjId()));
|
||||
jclMap.setFOnJob(getCompTriggerMapper().countHrmResource(jclMap.getFEcId()));
|
||||
jclMap.setFIsVitual(0);
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(jclMap.getFDateBegin());
|
||||
Calendar calendar = DateUtil.addDay(cal, -1);
|
||||
Date time = new Date(calendar.getTime().getTime());
|
||||
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
|
||||
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
|
||||
|
||||
|
||||
if (1 != newCompany.getDeleteType() && 1 != newCompany.getForbiddenTag()) {
|
||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.logview.bo.FieldBaseEquator;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.trigger.CompTriggerMapper;
|
||||
import com.engine.organization.mapper.trigger.DepartmentTriggerMapper;
|
||||
import com.engine.organization.util.OrganizationDateUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/08/30
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class DepartmentTriggerRunnable implements Runnable {
|
||||
|
||||
private final DepartmentPO oldDepartment;
|
||||
private final DepartmentPO newDepartment;
|
||||
|
||||
private CompTriggerMapper getCompTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(CompTriggerMapper.class);
|
||||
}
|
||||
|
||||
private DepartmentTriggerMapper getDepartmentTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(DepartmentTriggerMapper.class);
|
||||
}
|
||||
|
||||
public DepartmentTriggerRunnable(DepartmentPO oldDepartment, DepartmentPO newDepartment) {
|
||||
this.oldDepartment = oldDepartment;
|
||||
this.newDepartment = newDepartment;
|
||||
}
|
||||
|
||||
public DepartmentTriggerRunnable(Long departmentId) {
|
||||
this.oldDepartment = new DepartmentPO();
|
||||
this.newDepartment = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(departmentId);
|
||||
}
|
||||
|
||||
public DepartmentTriggerRunnable(DepartmentPO newDepartment) {
|
||||
this.oldDepartment = new DepartmentPO();
|
||||
this.newDepartment = newDepartment;
|
||||
this.newDepartment.setDeleteType(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
FieldBaseEquator fieldBaseEquator = new FieldBaseEquator();
|
||||
List<String> diffFields = fieldBaseEquator.getDiffFieldList(oldDepartment, newDepartment);
|
||||
if (CollectionUtils.isEmpty(diffFields)) {
|
||||
return;
|
||||
}
|
||||
// 判断
|
||||
if (diffFields.contains("deptName") || diffFields.contains("deptPrincipal") || diffFields.contains("parentComp") || diffFields.contains("parentDept") || diffFields.contains("forbiddenTag") || diffFields.contains("deleteType")) {
|
||||
JclOrgMap jclMap = new JclOrgMap();
|
||||
jclMap.setFType(2);
|
||||
int st = 100000000;
|
||||
// 更新逻辑
|
||||
jclMap.setFObjId(newDepartment.getId().intValue());
|
||||
jclMap.setId(newDepartment.getId().intValue() + st);
|
||||
jclMap.setUuid(newDepartment.getUuid());
|
||||
jclMap.setFNumber(newDepartment.getDeptNo());
|
||||
jclMap.setFName(newDepartment.getDeptName());
|
||||
jclMap.setFLeader(null == newDepartment.getDeptPrincipal() ? null : newDepartment.getDeptPrincipal().intValue());
|
||||
jclMap.setFParentId(null == newDepartment.getParentDept() ? newDepartment.getParentComp().intValue() : newDepartment.getParentDept().intValue() + st);
|
||||
jclMap.setFObjParentId(null == newDepartment.getParentDept() ? newDepartment.getParentComp().intValue() : newDepartment.getParentDept().intValue());
|
||||
|
||||
jclMap.setFEcId(getDepartmentTriggerMapper().getEcDepartmentIdByUuid(jclMap.getUuid()));
|
||||
|
||||
|
||||
jclMap.setFClass(0);
|
||||
jclMap.setFClassName("行政维度");
|
||||
HrmResource hrmResourceById = getCompTriggerMapper().getHrmResourceById(jclMap.getFLeader());
|
||||
|
||||
|
||||
if (null != hrmResourceById) {
|
||||
jclMap.setFLeaderImg(hrmResourceById.getMessagerurl());
|
||||
jclMap.setFLeaderName(hrmResourceById.getLastname());
|
||||
jclMap.setFLeaderJobId(hrmResourceById.getJobtitle());
|
||||
}
|
||||
|
||||
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
|
||||
|
||||
JSONObject cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclMap.getFLeader());
|
||||
if (null != cusFieldDataById) {
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
}
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
|
||||
|
||||
jclMap.setFPlan(getDepartmentTriggerMapper().sumStaffNum(jclMap.getFDateBegin(), jclMap.getFObjId()));
|
||||
jclMap.setFOnJob(getDepartmentTriggerMapper().countHrmResource(jclMap.getFEcId()));
|
||||
jclMap.setFIsVitual(0);
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(jclMap.getFDateBegin());
|
||||
Calendar calendar = DateUtil.addDay(cal, -1);
|
||||
Date time = new Date(calendar.getTime().getTime());
|
||||
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
|
||||
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
|
||||
|
||||
if (1 != newDepartment.getDeleteType() && 1 != newDepartment.getForbiddenTag()) {
|
||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.trigger.CompTriggerMapper;
|
||||
import com.engine.organization.mapper.trigger.GroupTriggerMapper;
|
||||
import com.engine.organization.util.OrganizationDateUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/08/30
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class GroupTriggerRunnable implements Runnable {
|
||||
Map<String, Object> params;
|
||||
|
||||
private CompTriggerMapper getCompTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(CompTriggerMapper.class);
|
||||
}
|
||||
|
||||
private GroupTriggerMapper getGroupTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(GroupTriggerMapper.class);
|
||||
}
|
||||
|
||||
public GroupTriggerRunnable(Map<String, Object> params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
JclOrgMap jclOrgMap = new JclOrgMap();
|
||||
//id = 0;
|
||||
jclOrgMap.setId(0);
|
||||
//ftype = 0;
|
||||
jclOrgMap.setFType(0);
|
||||
jclOrgMap.setFObjId(0);
|
||||
jclOrgMap.setFEcId(parseString2Int(params.get("id")));
|
||||
jclOrgMap.setUuid(Util.null2String(params.get("uuid")));
|
||||
jclOrgMap.setFNumber("00");
|
||||
jclOrgMap.setFName(Util.null2String(params.get("companyname")));
|
||||
jclOrgMap.setFClass(0);
|
||||
jclOrgMap.setFClassName("行政维度");
|
||||
jclOrgMap.setFLeader(getGroupTriggerMapper().getInfoValue(1));
|
||||
HrmResource hrmResourceById = getCompTriggerMapper().getHrmResourceById(jclOrgMap.getFLeader());
|
||||
if (null != hrmResourceById) {
|
||||
jclOrgMap.setFLeaderImg(hrmResourceById.getMessagerurl());
|
||||
jclOrgMap.setFLeaderName(hrmResourceById.getLastname());
|
||||
jclOrgMap.setFLeaderJobId(hrmResourceById.getJobtitle());
|
||||
}
|
||||
jclOrgMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclOrgMap.getFLeaderJobId()));
|
||||
JSONObject cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclOrgMap.getFLeader());
|
||||
if (null != cusFieldDataById) {
|
||||
jclOrgMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclOrgMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
}
|
||||
jclOrgMap.setFParentId(1);
|
||||
jclOrgMap.setFObjParentId(0);
|
||||
jclOrgMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
jclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
jclOrgMap.setFPlan(getGroupTriggerMapper().sumStaffNum(jclOrgMap.getFDateBegin()));
|
||||
jclOrgMap.setFOnJob(getGroupTriggerMapper().countHrmResource());
|
||||
jclOrgMap.setFIsVitual(0);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(jclOrgMap.getFDateBegin());
|
||||
Calendar calendar = DateUtil.addDay(cal, -1);
|
||||
Date time = new Date(calendar.getTime().getTime());
|
||||
getGroupTriggerMapper().deleteMap(0, jclOrgMap.getFDateBegin());
|
||||
getGroupTriggerMapper().updateMap(0, jclOrgMap.getFDateBegin(), time);
|
||||
|
||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclOrgMap);
|
||||
}
|
||||
|
||||
private Integer parseString2Int(Object args) {
|
||||
String s = Util.null2String(args);
|
||||
if (StringUtils.isBlank(s)) {
|
||||
return null;
|
||||
}
|
||||
return Integer.parseInt(s);
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.trigger.CompTriggerMapper;
|
||||
import com.engine.organization.mapper.trigger.HrmResourceTriggerMapper;
|
||||
import com.engine.organization.util.OrganizationDateUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.Calendar;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class HrmResourceTriggerRunnable implements Runnable {
|
||||
Long userId;
|
||||
|
||||
private CompTriggerMapper getCompTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(CompTriggerMapper.class);
|
||||
}
|
||||
|
||||
private HrmResourceTriggerMapper getHrmResourceTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmResourceTriggerMapper.class);
|
||||
}
|
||||
|
||||
public HrmResourceTriggerRunnable(Long id) {
|
||||
this.userId = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
int st = 100000000;
|
||||
int sj = 200000000;
|
||||
int sk = 300000000;
|
||||
Integer delete = null;
|
||||
JclOrgMap jclMap = new JclOrgMap();
|
||||
jclMap.setFType(4);
|
||||
// 查询当前人员信息数据
|
||||
HrmResource hrmResource = getHrmResourceTriggerMapper().getHrmResource(userId);
|
||||
if (null != hrmResource) {
|
||||
jclMap.setFObjId(hrmResource.getId());
|
||||
jclMap.setId(hrmResource.getId() + sk);
|
||||
jclMap.setFNumber(hrmResource.getWorkcode());
|
||||
jclMap.setFName(hrmResource.getLastname());
|
||||
delete = hrmResource.getStatus() <= 3 ? 0 : 1;
|
||||
jclMap.setFLeaderImg(hrmResource.getMessagerurl());
|
||||
jclMap.setFLeaderName(hrmResource.getLastname());
|
||||
jclMap.setFLeaderJobId(hrmResource.getJobtitle());
|
||||
JSONObject cusFieldDataById = getHrmResourceTriggerMapper().getCusFieldDataById(jclMap.getFObjId());
|
||||
if (null != cusFieldDataById) {
|
||||
String field100002 = cusFieldDataById.getString("field100002");
|
||||
if (StringUtils.isNotBlank(field100002)) {
|
||||
int index = field100002.indexOf('_');
|
||||
jclMap.setFObjParentId(Integer.parseInt(field100002.substring(index + 1)));
|
||||
jclMap.setFParentId(jclMap.getFObjParentId() + sj);
|
||||
}
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
}
|
||||
jclMap.setFClass(0);
|
||||
jclMap.setFClassName("行政维度");
|
||||
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
jclMap.setFIsVitual(0);
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(jclMap.getFDateBegin());
|
||||
Calendar calendar = DateUtil.addDay(cal, -1);
|
||||
Date time = new Date(calendar.getTime().getTime());
|
||||
|
||||
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
|
||||
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
|
||||
if (0 == delete) {
|
||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.engine.organization.thread;
|
||||
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.logview.bo.FieldBaseEquator;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.trigger.CompTriggerMapper;
|
||||
import com.engine.organization.mapper.trigger.JobTriggerMapper;
|
||||
import com.engine.organization.util.OrganizationDateUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.common.DateUtil;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/08/30
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JobTriggerRunnable implements Runnable {
|
||||
|
||||
private final JobPO oldJob;
|
||||
private final JobPO newJob;
|
||||
|
||||
private CompTriggerMapper getCompTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(CompTriggerMapper.class);
|
||||
}
|
||||
|
||||
private JobTriggerMapper getJobTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(JobTriggerMapper.class);
|
||||
}
|
||||
|
||||
public JobTriggerRunnable(JobPO oldJob, JobPO newJob) {
|
||||
this.oldJob = oldJob;
|
||||
this.newJob = newJob;
|
||||
}
|
||||
|
||||
public JobTriggerRunnable(Long jobId) {
|
||||
this.oldJob = new JobPO();
|
||||
this.newJob = MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId);
|
||||
}
|
||||
|
||||
public JobTriggerRunnable(JobPO newJob) {
|
||||
this.oldJob = new JobPO();
|
||||
this.newJob = newJob;
|
||||
this.newJob.setDeleteType(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
FieldBaseEquator fieldBaseEquator = new FieldBaseEquator();
|
||||
List<String> diffFields = fieldBaseEquator.getDiffFieldList(oldJob, newJob);
|
||||
if (CollectionUtils.isEmpty(diffFields)) {
|
||||
return;
|
||||
}
|
||||
// 判断
|
||||
if (diffFields.contains("jobName") || diffFields.contains("parentDept") || diffFields.contains("parentJob") || diffFields.contains("forbiddenTag") || diffFields.contains("deleteType")) {
|
||||
JclOrgMap jclMap = new JclOrgMap();
|
||||
int st = 100000000;
|
||||
int sj = 200000000;
|
||||
jclMap.setFType(3);
|
||||
// 更新逻辑
|
||||
jclMap.setFObjId(newJob.getId().intValue());
|
||||
jclMap.setId(newJob.getId().intValue() + sj);
|
||||
jclMap.setFNumber(newJob.getJobNo());
|
||||
jclMap.setFName(newJob.getJobName());
|
||||
jclMap.setFParentId(null == newJob.getParentJob() ? newJob.getParentDept().intValue() + st : newJob.getParentJob().intValue() + sj);
|
||||
jclMap.setFObjParentId(null == newJob.getParentJob() ? newJob.getParentDept().intValue() : newJob.getParentJob().intValue());
|
||||
Integer parentdept = newJob.getParentDept().intValue();
|
||||
|
||||
jclMap.setFClass(0);
|
||||
jclMap.setFClassName("行政维度");
|
||||
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
|
||||
|
||||
jclMap.setFPlan(getJobTriggerMapper().sumStaffNum(jclMap.getFDateBegin(), jclMap.getFObjId()));
|
||||
jclMap.setFOnJob(getJobTriggerMapper().countHrmResource(parentdept, jclMap.getFName()));
|
||||
jclMap.setFIsVitual(0);
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(jclMap.getFDateBegin());
|
||||
Calendar calendar = DateUtil.addDay(cal, -1);
|
||||
Date time = new Date(calendar.getTime().getTime());
|
||||
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
|
||||
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
|
||||
|
||||
|
||||
if (1 != newJob.getDeleteType() && 1 != newJob.getForbiddenTag()) {
|
||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.engine.organization.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.NonStandardOptWrapper;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class NonStandardOptController {
|
||||
public NonStandardOptWrapper getNonStandardOptWrapper(User user) {
|
||||
return ServiceUtil.getService(NonStandardOptWrapper.class, user);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/operation")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult operation(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
String method = Util.null2String(map.get("method"));
|
||||
String ids = Util.null2String(map.get("ids"));
|
||||
getNonStandardOptWrapper(user).NonStandardOpt(method, ids);
|
||||
return ReturnResult.successed();
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.service.NonStandardOptService;
|
||||
import com.engine.organization.service.impl.NonStandardOptServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class NonStandardOptWrapper extends Service {
|
||||
private NonStandardOptService getNonStandardOptService(User user) {
|
||||
return ServiceUtil.getService(NonStandardOptServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public void NonStandardOpt(String method, String ids) {
|
||||
getNonStandardOptService(user).NonStandardOpt(method, ids);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue