!124 生产合并

Merge pull request !124 from reset/develop
This commit is contained in:
reset 2022-06-27 10:52:27 +00:00 committed by Gitee
commit 11d6474e13
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
93 changed files with 2804 additions and 486 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ target/
.idea
/src/test
/src/rebel.xml
/src/META-INF
/log

View File

@ -0,0 +1,12 @@
INSERT INTO jcl_field_extendgroup
(id, extend_type, group_name, creator, delete_type, create_time, update_time, pid, is_show, show_order, is_system_default)
VALUES(1, 1, '基本信息', 1, 0, '2022-06-17', '2022-06-17', NULL, '1', 1, 0);
INSERT INTO jcl_field_extendgroup
(id, extend_type, group_name, creator, delete_type, create_time, update_time, pid, is_show, show_order, is_system_default)
VALUES(2, 2, '基本信息', 1, 0, '2022-06-17', '2022-06-17', NULL, '1', 1, 0);
INSERT INTO jcl_field_extendgroup
(id, extend_type, group_name, creator, delete_type, create_time, update_time, pid, is_show, show_order, is_system_default)
VALUES(3, 3, '基本信息', 1, 0, '2022-06-17', '2022-06-17', NULL, '1', 1, 0);
INSERT INTO jcl_field_extendgroup
(id, extend_type, group_name, creator, delete_type, create_time, update_time, pid, is_show, show_order, is_system_default)
VALUES(4, 4, '基本信息', 1, 0, '2022-06-17', '2022-06-17', NULL, '1', 1, 0);

View File

@ -0,0 +1,93 @@
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(1, 1, 'JCL_ORG_COMP', 'comp_no', '编号', 'varchar(100)', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(2, 1, 'JCL_ORG_COMP', 'comp_name', '名称', 'varchar(100)', 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(3, 1, 'JCL_ORG_COMP', 'parent_company', '上级公司', 'int', 3, 1, 1, 0, 1, 1, 1, 1, 1, 4, 1, 0, NULL, NULL, '161', '["browser",{"value":"161","valueSpan":"自定义单选","replaceDatas":[{"id":"161","name":"自定义单选"}]},{"value":"compBrowser","valueSpan":"公司分部浏览按钮","replaceDatas":[{"showname":"compBrowser","shownamespan":"compBrowser","namespan":"公司分部浏览按钮","name":"公司分部浏览按钮","showtypespan":"树形","randomFieldIdspan":"","showtype":"2","randomFieldId":"compBrowser","id":"compBrowser"}]}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(4, 1, 'JCL_ORG_COMP', 'industry', '行业', 'int', 3, 1, 1, 0, 1, 1, 1, 1, 1, 6, 1, 0, NULL, NULL, '63', NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(5, 1, 'JCL_ORG_COMP', 'comp_name_short', '简称', 'varchar(100)', 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(6, 1, 'JCL_ORG_COMP', 'org_code', '组织机构代码', 'varchar(100)', 1, 1, 1, 0, 1, 1, 1, 1, 1, 5, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(7, 1, 'JCL_ORG_COMP', 'comp_principal', '负责人', 'int', 3, 1, 1, 0, 1, 1, 1, 1, 1, 7, 1, 0, NULL, NULL, '1', NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(8, 1, 'JCL_ORG_COMP', 'description', '说明', 'text', 2, 1, 1, 0, 1, 0, 1, 0, 1, 8, 1, 0, NULL, NULL, NULL, NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(9, 1, 'JCL_ORG_COMP', 'forbidden_tag', '禁用标记', 'int', 5, 1, 1, 0, 1, 1, 0, 0, 1, 9, 1, 0, NULL, NULL, '', '["select","select",{"datas":[{"default":"","unuse":"0","id":"0","key":"0","option":"启用"},{"default":"","unuse":"0","id":"1","key":"1","option":"禁用"}],"sort":"horizontal"}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(10, 2, 'JCL_ORG_DEPT', 'dept_no', '编号', 'varchar(100)', 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(11, 2, 'JCL_ORG_DEPT', 'dept_name', '名称', 'varchar(100)', 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, NULL, NULL, '1', NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(12, 2, 'JCL_ORG_DEPT', 'dept_name_short', '简称', 'varchar(100)', 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, NULL, NULL, '1', NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(13, 2, 'JCL_ORG_DEPT', 'parent_comp', '所属分部', 'int', 3, 2, 1, 0, 1, 1, 1, 1, 1, 4, 1, 0, NULL, NULL, '161', '["browser",{"value":"161","valueSpan":"自定义单选","replaceDatas":[{"id":"161","name":"自定义单选"}]},{"value":"compBrowser","valueSpan":"公司分部浏览按钮","replaceDatas":[{"showname":"compBrowser","shownamespan":"compBrowser","namespan":"公司分部浏览按钮","name":"公司分部浏览按钮","showtypespan":"树形","randomFieldIdspan":"","showtype":"2","randomFieldId":"compBrowser","id":"compBrowser"}]}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(14, 2, 'JCL_ORG_DEPT', 'parent_dept', '上级部门', 'int', 3, 2, 1, 0, 1, 1, 1, 1, 1, 5, 1, 0, NULL, NULL, '161', '["browser",{"valueSpan":"自定义单选","replaceDatas":[{"name":"自定义单选","id":"161"}],"value":"161"},{"valueSpan":"部门浏览按钮","replaceDatas":[{"showname":"deptBrowser","shownamespan":"deptBrowser","namespan":"部门浏览按钮","name":"部门浏览按钮","showtypespan":"树形","randomFieldIdspan":"","showtype":"2","id":"deptBrowser","randomFieldId":"deptBrowser"}],"value":"deptBrowser"}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(15, 2, 'JCL_ORG_DEPT', 'dept_principal', '部门负责人', 'int', 3, 2, 1, 0, 1, 1, 1, 1, 1, 6, 1, 0, NULL, NULL, '1', NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(16, 2, 'JCL_ORG_DEPT', 'show_order', '显示顺序', 'int', 1, 2, 1, 0, 1, 1, 1, 1, 1, 7, 1, 0, NULL, NULL, '2', NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(17, 2, 'JCL_ORG_DEPT', 'description', '说明', 'text', 2, 2, 1, 0, 1, 1, 1, 0, 1, 7, 1, 0, NULL, NULL, NULL, NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(18, 2, 'JCL_ORG_DEPT', 'forbidden_tag', '禁用标记', 'int', 5, 2, 1, 0, 1, 1, 0, 0, 1, 7, 1, 0, NULL, NULL, NULL, '["select","select",{"datas":[{"default":"","unuse":"0","id":"0","key":"0","option":"启用"},{"default":"","unuse":"0","id":"1","key":"1","option":"禁用"}],"sort":"horizontal"}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(19, 3, 'JCL_ORG_JOB', 'job_no', '编号', 'varchar(100)', 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(20, 3, 'JCL_ORG_JOB', 'job_name', '名称', 'varchar(100)', 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(21, 3, 'JCL_ORG_JOB', 'parent_comp', '所属分部', 'int', 3, 3, 1, 0, 1, 1, 1, 1, 1, 3, 1, 0, NULL, NULL, '161', '["browser",{"value":"161","valueSpan":"自定义单选","replaceDatas":[{"id":"161","name":"自定义单选"}]},{"value":"compBrowser","valueSpan":"公司分部浏览按钮","replaceDatas":[{"showname":"compBrowser","shownamespan":"compBrowser","namespan":"公司分部浏览按钮","name":"公司分部浏览按钮","showtypespan":"树形","randomFieldIdspan":"","showtype":"2","randomFieldId":"compBrowser","id":"compBrowser"}]}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(22, 3, 'JCL_ORG_JOB', 'parent_dept', '所属部门', 'int', 3, 3, 1, 0, 1, 1, 1, 1, 1, 4, 1, 0, NULL, NULL, '161', '["browser",{"valueSpan":"自定义单选","replaceDatas":[{"name":"自定义单选","id":"161"}],"value":"161"},{"valueSpan":"部门浏览按钮","replaceDatas":[{"showname":"deptBrowser","shownamespan":"deptBrowser","namespan":"部门浏览按钮","name":"部门浏览按钮","showtypespan":"树形","randomFieldIdspan":"","showtype":"2","id":"deptBrowser","randomFieldId":"deptBrowser"}],"value":"deptBrowser"}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(23, 3, 'JCL_ORG_JOB', 'sequence_id', '岗位序列', 'int', 3, 3, 1, 0, 1, 1, 1, 1, 1, 5, 1, 0, NULL, NULL, '161', '["browser",{"value":"161","valueSpan":"自定义单选","replaceDatas":[{"id":"161","name":"自定义单选"}]},{"value":"sequenceBrowser","valueSpan":"岗位序列","replaceDatas":[{"showname":"sequenceBrowser","shownamespan":"sequenceBrowser","namespan":"岗位序列","name":"岗位序列","showtypespan":"列表式","randomFieldIdspan":"","showtype":"1","randomFieldId":"sequenceBrowser","id":"sequenceBrowser"}]}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(24, 3, 'JCL_ORG_JOB', 'scheme_id', '等级方案', 'int', 3, 3, 1, 0, 1, 1, 1, 1, 1, 6, 1, 0, NULL, NULL, '161', '["browser",{"value":"161","valueSpan":"自定义单选","replaceDatas":[{"id":"161","name":"自定义单选"}]},{"value":"schemeBrowser","valueSpan":"等级方案浏览按钮","replaceDatas":[{"showname":"schemeBrowser","shownamespan":"schemeBrowser","namespan":"等级方案浏览按钮","name":"等级方案浏览按钮","showtypespan":"列表式","randomFieldIdspan":"","showtype":"1","randomFieldId":"schemeBrowser","id":"schemeBrowser"}]}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(25, 3, 'JCL_ORG_JOB', 'parent_job', '上级岗位', 'int', 3, 3, 1, 0, 1, 1, 1, 1, 1, 7, 1, 0, NULL, NULL, '161', '["browser",{"value":"161","valueSpan":"自定义单选","replaceDatas":[{"id":"161","name":"自定义单选"}]},{"value":"jobBrowser","valueSpan":"岗位浏览按钮","replaceDatas":[{"showname":"jobBrowser","shownamespan":"jobBrowser","namespan":"岗位浏览按钮","name":"岗位浏览按钮","showtypespan":"树形","randomFieldIdspan":"","showtype":"2","randomFieldId":"jobBrowser","id":"jobBrowser"}]}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(26, 3, 'JCL_ORG_JOB', 'is_key', '是否关键岗', 'int', 5, 3, 1, 0, 1, 1, 1, 1, 1, 8, 1, 0, NULL, NULL, NULL, '["select","select",{"datas":[{"default":"","unuse":"0","id":"0","key":"0","option":"否"},{"default":"","unuse":"0","id":"1","key":"1","option":"是"}],"sort":"horizontal"}]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(27, 3, 'JCL_ORG_JOB', 'workplace', '工作地点', 'varchar(100)', 1, 3, 1, 0, 1, 1, 1, 0, 1, 9, 1, 0, NULL, NULL, '1', '["input","text","100"]', 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(28, 3, 'JCL_ORG_JOB', 'description', '工作概述', 'text', 2, 3, 1, 0, 1, 1, 1, 0, 1, 10, 1, 0, NULL, NULL, NULL, NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(29, 3, 'JCL_ORG_JOB', 'work_duty', '任职职责', 'text', 2, 3, 1, 0, 1, 1, 1, 0, 1, 11, 1, 0, NULL, NULL, NULL, NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(30, 3, 'JCL_ORG_JOB', 'work_authority', '工作权限', 'text', 2, 3, 1, 0, 1, 1, 1, 0, 1, 12, 1, 0, NULL, NULL, NULL, NULL, 0);
INSERT INTO jcl_field_extendinfo
(id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default)
VALUES(31, 3, 'JCL_ORG_JOB', 'forbidden_tag', '禁用标记', 'int', 5, 3, 1, 0, 1, 1, 0, 0, 1, 13, 1, 0, NULL, NULL, NULL, '["select","select",{"datas":[{"default":"","unuse":"0","id":"0","key":"0","option":"启用"},{"default":"","unuse":"0","id":"1","key":"1","option":"禁用"}],"sort":"horizontal"}]', 0);

View File

@ -0,0 +1,12 @@
INSERT INTO jcl_field_extendtitle
(id, group_id, title, creator, delete_type, create_time, update_time, show_order, is_show, is_system_default)
VALUES(1, 1, '基本信息', 1, 0, '2022-06-17', '2022-06-17', 1, 1, 0);
INSERT INTO jcl_field_extendtitle
(id, group_id, title, creator, delete_type, create_time, update_time, show_order, is_show, is_system_default)
VALUES(2, 2, '基本信息', 1, 0, '2022-06-17', '2022-06-17', 1, 1, 0);
INSERT INTO jcl_field_extendtitle
(id, group_id, title, creator, delete_type, create_time, update_time, show_order, is_show, is_system_default)
VALUES(3, 3, '基本信息', 1, 0, '2022-06-17', '2022-06-17', 1, 1, 0);
INSERT INTO jcl_field_extendtitle
(id, group_id, title, creator, delete_type, create_time, update_time, show_order, is_show, is_system_default)
VALUES(4, 4, '基本信息', 1, 0, '2022-06-17', '2022-06-17', 1, 1, 0);

View File

@ -105,6 +105,7 @@ CREATE TABLE JCL_ORG_COMP (
comp_principal int null,
description text NULL,
forbidden_tag int NULL,
show_order int NULL,
is_used int null,
creator int null,
delete_type int null,
@ -120,6 +121,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
extend_type int null,
group_name varchar(100) NULL,
show_order int null,
is_show varchar(100) NULL,
is_system_default int null,
creator int null,
delete_type int null,
create_time date null,
@ -134,6 +137,7 @@ create table JCL_FIELD_EXTENDTITLE (
title varchar(100) null,
show_order int null,
is_show int null,
is_system_default int null,
creator int null,
delete_type int null,
create_time date null,
@ -161,6 +165,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
add_show int null,
browser_show int null,
show_order int null,
is_system_default int null,
creator int null,
delete_type int null,
create_time date null,
@ -290,6 +295,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCE
CREATE TABLE JCL_ORG_HRMRESOURCE (
id int auto_increment NOT NULL,
work_code varchar(60) null,
login_id varchar(60) null,
last_name varchar(60) null,
sex int null,
account_type int null,
belong_to int null,
company_id int null,
department_id int null,
job_activity int null,
job_title int null,
job_call int null,
job_level int null,
job_group_id int null,
job_activity_desc varchar(200) null,
status int null,
system_language int null,
resource_image_id varchar(1000) null,
messager_url varchar(1000) null,
location_id int null,
manager_id int null,
assistant_id int null,
mobile varchar(60) null,
telephone varchar(60) null,
mobile_call varchar(60) null,
fax varchar(60) null,
email varchar(60) null,
workroom varchar(60) null,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCEEXT
CREATE TABLE JCL_ORG_HRMRESOURCEEXT (
id int NOT NULL,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCEEXT_DT1
CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 (
id int auto_increment NOT NULL,
mainid int NULL,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (id)
);
-- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN (
@ -345,4 +408,36 @@ CREATE TABLE JCL_ORG_STAFFS (
create_time date null,
update_time date null,
CONSTRAINT JCL_ORG_STAFFS_PK PRIMARY KEY (id)
);
-- JCL_ORG_MAP
CREATE TABLE JCL_ORG_MAP (
id int auto_increment NOT NULL,
ftype int NULL,
fobjid int NULL,
fecid int NULL,
Uuid varchar(100) NULL,
fclass int NULL,
fclassname varchar(100) NULL,
fnumber varchar(100) NULL,
fname varchar(255) NULL,
fleader int NULL,
fleaderimg int NULL,
fleadername varchar(100) NULL,
fleaderjobid int NULL,
fleaderjob varchar(255) NULL,
fleaderlv varchar(100) NULL,
fleaderst varchar(100) NULL,
fparentid int null,
fobjparentid int null,
fplan int null,
fonjob int null,
fisvitual int null,
fdatebegin date null,
fdateend date null,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
CONSTRAINT JCL_ORG_MAP PRIMARY KEY (id)
);

View File

@ -107,6 +107,7 @@ CREATE TABLE JCL_ORG_COMP (
COMP_PRINCIPAL NUMBER NULL,
DESCRIPTION NVARCHAR2(1000) NULL,
FORBIDDEN_TAG NUMBER NULL,
SHOW_ORDER NUMBER NULL,
IS_USED NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
@ -122,6 +123,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
EXTEND_TYPE NUMBER NULL,
GROUP_NAME NVARCHAR2(100) NULL,
SHOW_ORDER NUMBER null,
IS_SHOW NVARCHAR2(100) NULL,
IS_SYSTEM_DEFAULT NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
@ -136,6 +139,7 @@ CREATE TABLE JCL_FIELD_EXTENDTITLE (
TITLE VARCHAR(100) NULL,
SHOW_ORDER NUMBER NULL,
IS_SHOW NUMBER NULL,
IS_SYSTEM_DEFAULT NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
@ -163,6 +167,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
ADD_SHOW NUMBER NULL,
BROWSER_SHOW NUMBER NULL,
SHOW_ORDER NUMBER NULL,
IS_SYSTEM_DEFAULT NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
@ -292,6 +297,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (ID)
);
-- JCL_ORG_HRMRESOURCE
CREATE TABLE JCL_ORG_HRMRESOURCE (
ID NUMBER NOT NULL,
WORK_CODE NVARCHAR2(60) NULL,
LOGIN_ID NVARCHAR2(60) NULL,
LAST_NAME NVARCHAR2(60) NULL,
SEX NUMBER NULL,
ACCOUNT_TYPE NUMBER NULL,
BELONG_TO NUMBER NULL,
COMPANY_ID NUMBER NULL,
DEPARTMENT_ID NUMBER NULL,
JOB_ACTIVITY NUMBER NULL,
JOB_TITLE NUMBER NULL,
JOB_CALL NUMBER NULL,
JOB_LEVEL NUMBER NULL,
JOB_GROUP_ID NUMBER NULL,
JOB_ACTIVITY_DESC NVARCHAR2(200) NULL,
STATUS NUMBER NULL,
SYSTEM_LANGUAGE NUMBER NULL,
RESOURCE_IMAGE_ID NVARCHAR2(1000) NULL,
MESSAGER_URL NVARCHAR2(1000) NULL,
LOCATION_ID NUMBER NULL,
MANAGER_ID NUMBER NULL,
ASSISTANT_ID NUMBER NULL,
MOBILE NVARCHAR2(60) NULL,
TELEPHONE NVARCHAR2(60) NULL,
MOBILE_CALL NVARCHAR2(60) NULL,
FAX NVARCHAR2(60) NULL,
EMAIL NVARCHAR2(60) NULL,
WORKROOM NVARCHAR2(60) NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL,
CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (ID)
);
-- JCL_ORG_HRMRESOURCEEXT
CREATE TABLE JCL_ORG_HRMRESOURCEEXT (
ID NUMBER NOT NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (ID)
);
-- JCL_ORG_HRMRESOURCEEXT_DT1
CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 (
ID NUMBER NOT NULL,
MAINID NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (ID)
);
-- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN (
ID NUMBER NOT NULL,

View File

@ -105,6 +105,7 @@ CREATE TABLE JCL_ORG_COMP (
comp_principal int null,
description text COLLATE Chinese_PRC_CI_AS NULL,
forbidden_tag int NULL,
show_order int null,
is_used int null,
creator int null,
delete_type int null,
@ -120,6 +121,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
extend_type int null,
group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
show_order int null,
is_show varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
is_system_default int null,
creator int null,
delete_type int null,
create_time datetime null,
@ -134,10 +137,11 @@ create table JCL_FIELD_EXTENDTITLE (
title varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
show_order int null,
is_show int null,
is_system_default int null,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
create_time datetime null,
update_time datetime null,
CONSTRAINT JCL_FIELD_EXTENDTITLE_PK PRIMARY KEY (id)
);
@ -161,6 +165,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
add_show int null,
browser_show int null,
show_order int null,
is_system_default int null,
creator int null,
delete_type int null,
create_time datetime null,
@ -290,6 +295,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCE
CREATE TABLE JCL_ORG_HRMRESOURCE (
id int IDENTITY(1,1) NOT NULL,
work_code varchar(60) null,
login_id varchar(60) null,
last_name varchar(60) null,
sex int null,
account_type int null,
belong_to int null,
company_id int null,
department_id int null,
job_activity int null,
job_title int null,
job_call int null,
job_level int null,
job_group_id int null,
job_activity_desc varchar(200) null,
status int null,
system_language int null,
resource_image_id varchar(1000) null,
messager_url varchar(1000) null,
location_id int null,
manager_id int null,
assistant_id int null,
mobile varchar(60) null,
telephone varchar(60) null,
mobile_call varchar(60) null,
fax varchar(60) null,
email varchar(60) null,
workroom varchar(60) null,
creator int null,
delete_type int null,
create_time datetime null,
update_time datetime null,
CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCEEXT
CREATE TABLE JCL_ORG_HRMRESOURCEEXT (
id int IDENTITY(1,1) NOT NULL,
creator int null,
delete_type int null,
create_time datetime null,
update_time datetime null,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCEEXT_DT1
CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 (
id int IDENTITY(1,1) NOT NULL,
mainid int NULL,
creator int null,
delete_type int null,
create_time datetime null,
update_time datetime null,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (id)
);
-- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN (

View File

@ -0,0 +1,12 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2022/06/21
* @version: 1.0
*/
@Path("/bs/hrmorganization/hrmresource")
public class HrmResourceController extends com.engine.organization.web.HrmResourceController{
}

View File

@ -4,12 +4,7 @@ import com.engine.organization.enums.OperateTypeEnum;
import java.lang.annotation.*;
/**
* @Author dxfeng
* @Description:
* @Date 2022/5/9
* @Version V1.0
**/
@Target({ElementType.PARAMETER, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented

View File

@ -55,6 +55,13 @@ public @interface OrganizationTable {
*/
boolean distinct() default false;
/**
* 排序方式
* @return
*/
String sortway() default "desc";
/**
* 操作按钮
*/

View File

@ -11,4 +11,6 @@ public @interface TableTitle {
String dataIndex();
String key();
boolean display() default true;
String width() default "";
boolean sorter() default false;
}

View File

@ -19,4 +19,9 @@ public class BaseQueryParam {
//每页数据条数
private Integer pageSize = 10;
/**
* 排序
*/
private String sortParams;
}

View File

@ -38,6 +38,10 @@ public class OrganizationWeaTable<T> extends WeaTable {
if (StringUtils.isNotBlank(orderby)) {
super.setSqlorderby(orderby);
}
String sortway = table.sortway();
if (StringUtils.isNotBlank(sortway)) {
super.setSqlsortway(sortway);
}
String groupby = table.groupby();
if (StringUtils.isNotBlank(groupby)) {
super.setSqlgroupby(groupby);

View File

@ -38,6 +38,7 @@ public class CompBO {
.orgCode(e.getOrgCode())
.industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + ""))
.compPrincipal(getUserNameById(e.getCompPrincipal() + ""))
.showOrder(e.getShowOrder())
.forbiddenTag(e.getForbiddenTag())
.build()).collect(Collectors.toList());
Map<Long, List<CompListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany));

View File

@ -1,7 +1,6 @@
package com.engine.organization.entity.company.dto;
import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableOperate;
import com.engine.organization.annotation.TableTitle;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -20,12 +19,7 @@ import java.util.List;
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508",
operates = {
@OrganizationTableOperate(text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除"),
@OrganizationTableOperate(index = "2", text = "查看部门")
})
@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508")
public class CompListDTO {
/**
* 主键id
@ -56,7 +50,7 @@ public class CompListDTO {
/**
* 上级公司
*/
@TableTitle(title = "上级公司", dataIndex = "parentCompName", key = "parentCompName")
@TableTitle(title = "上级分部", dataIndex = "parentCompName", key = "parentCompName")
private String parentCompName;
private Long parentCompany;
@ -79,10 +73,13 @@ public class CompListDTO {
@TableTitle(title = "负责人", dataIndex = "compPrincipal", key = "compPrincipal")
private String compPrincipal;
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
private Integer showOrder;
/**
* 禁用标记
*/
@TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag")
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
private int forbiddenTag;
/**

View File

@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CompSearchParam extends BaseQueryParam {
public class CompSearchParam extends BaseQueryParam {
/**
* 主键

View File

@ -69,6 +69,11 @@ public class CompPO {
*/
private Integer forbiddenTag;
/**
* 显示顺序
*/
private Integer showOrder;
private Long creator;
private int deleteType;
private Date createTime;

View File

@ -39,7 +39,7 @@ public class DepartmentBO {
.deptPrincipal(getEmployeeNameById(e.getDeptPrincipal()))
.showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder())
.forbiddenTag(e.getForbiddenTag())
.build() ).collect(Collectors.toList());
.build()).collect(Collectors.toList());
Map<Long, List<DepartmentListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentDept() && 0 != item.getParentDept()).collect(Collectors.groupingBy(DepartmentListDTO::getParentDept));
// 处理被引用数据
List<String> usedIds = MapperProxyFactory.getProxy(DepartmentMapper.class).listUsedId();
@ -109,7 +109,7 @@ public class DepartmentBO {
.deptName(e.getDeptName())
.parentComp(e.getParentComp())
.parentDept(e.getParentDept())
.parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept().intValue()))
.parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept()))
.deptPrincipalName(getEmployeeNameById(e.getDeptPrincipal()))
.build()).collect(Collectors.toList());
//获取非一级部门
@ -118,13 +118,17 @@ public class DepartmentBO {
return singleDeptTreeVOS.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> parentComp.equals(item.getParentComp())).collect(Collectors.toList());
}
public static List<SearchTree> buildSetToSearchTree(Set<DepartmentPO> departmentPOS) {
return buildSetToSearchTree(departmentPOS, true);
}
public static List<SearchTree> buildSetToSearchTree(Set<DepartmentPO> departmentPOS, boolean isLeaf) {
return departmentPOS.stream().map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(false);
tree.setIcon("icon-coms-Branch");
tree.setIcon(isLeaf ? "icon-coms-Branch" : "icon-coms-LargeArea");
tree.setId(item.getId().toString());
tree.setIsParent(false);
tree.setIsVirtual("0");
@ -138,7 +142,7 @@ public class DepartmentBO {
}
public static String getDeptNameById(Integer id) {
public static String getDeptNameById(Long id) {
return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id);
}

View File

@ -2,7 +2,6 @@ package com.engine.organization.entity.department.dto;
import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableOperate;
import com.engine.organization.annotation.TableTitle;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -22,15 +21,7 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "96f2bb0d-da73-11ec-a0da-00ffcbed7508",
tableType = WeaTableType.NONE,
operates = {
@OrganizationTableOperate(text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除"),
@OrganizationTableOperate(index = "2", text = "合并"),
@OrganizationTableOperate(index = "3", text = "转移"),
@OrganizationTableOperate(index = "4", text = "联查岗位"),
@OrganizationTableOperate(index = "4", text = "联查人员")
})
tableType = WeaTableType.NONE)
public class DepartmentListDTO {
private Long id;
@ -38,11 +29,6 @@ public class DepartmentListDTO {
* 是否被引用
*/
private Integer isUsed;
/**
* 编号
*/
@TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo")
private String deptNo;
/**
* 名称
@ -50,6 +36,12 @@ public class DepartmentListDTO {
@TableTitle(title = "名称", dataIndex = "deptName", key = "deptName")
private String deptName;
/**
* 编号
*/
@TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo")
private String deptNo;
/**
* 简称
*/
@ -79,7 +71,7 @@ public class DepartmentListDTO {
/**
* 显示顺序
*/
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder")
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder",sorter = true)
private int showOrder;
///**
@ -91,7 +83,7 @@ public class DepartmentListDTO {
/**
* 禁用标记
*/
@TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag")
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
private int forbiddenTag;
/**
* 操作列

View File

@ -31,6 +31,7 @@ public class ExtendGroupBO {
TypeTreeVO.builder()
.canClick(true)
.addChild(e.getPid() == null)
.isSelected(isSelect(e.getId()))
.domid(String.valueOf(e.getId()))
.childs(Lists.newArrayList())
.hasGroup(isHasGroup(e.getId()))
@ -74,6 +75,9 @@ public class ExtendGroupBO {
case 3:
tableName = "JCL_ORG_JOB";
break;
case 4:
tableName = "JCL_ORG_HRMRESOURCE";
break;
default:
break;
}
@ -87,4 +91,13 @@ public class ExtendGroupBO {
}
return tableName;
}
private static boolean isSelect(Long id) {
if (id == 1 || id == 2 || id == 3 || id ==4) {
return true;
}else {
return false;
}
}
}

View File

@ -1,5 +1,7 @@
package com.engine.organization.entity.extend.bo;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.BrowserValueInfo;
import com.api.browser.bean.SearchConditionItem;
@ -106,7 +108,7 @@ public class ExtendInfoBO {
.editShow("0".equals(infoFieldParam.getIsModify()) ? 0 : 1)
.addShow(1)
.browserShow(1)
.customValue(infoFieldParam.getFieldType().toString())
.customValue(convertSelectCustom(controlType, infoFieldParam.getFieldType().toString()))
.showOrder(showOrder)
// 非系统初始化字段
.isSystemDefault(1)
@ -116,6 +118,31 @@ public class ExtendInfoBO {
.build();
}
private static String convertSelectCustom(String controlType, String fieldType) {
if (!"5".equals(controlType)) {
return fieldType;
}
JSONArray objects = JSONObject.parseArray(fieldType);
if (objects.size() < 3) {
return objects.toString();
}
JSONObject o = (JSONObject) objects.get(2);
JSONArray datas = o.getJSONArray("datas");
if (!datas.isEmpty()) {
int size = datas.size();
for (int i = 0; i < size; i++) {
JSONObject jsonObject = (JSONObject) datas.get(i);
if (StringUtils.isBlank(jsonObject.getString("id"))) {
jsonObject.put("id", i + "");
}
if (StringUtils.isBlank(jsonObject.getString("key"))) {
jsonObject.put("key", i + "");
}
}
}
return objects.toString();
}
/**
* 当前自定义字段是否已使用
*
@ -174,7 +201,7 @@ public class ExtendInfoBO {
// 必填
if (1 == extendInfoPO.getIsrequired()) {
fieldItem.setViewAttr(3);
fieldItem.setRules("required|string");
fieldItem.setRules("required");
} else {
fieldItem.setViewAttr(2);
}

View File

@ -7,7 +7,6 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;
import weaver.general.Util;
/**
@ -110,21 +109,4 @@ public class ExtendInfoFieldParam {
}
return fp.getFielddbtype();
}
public static String toDbc(String input) {
if (StringUtils.isBlank(input)) {
return "";
}
char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == 12288) {
c[i] = (char) 32;
continue;
}
if (c[i] > 65280 && c[i] < 65375) {
c[i] = (char) (c[i] - 65248);
}
}
return new String(c);
}
}

View File

@ -0,0 +1,37 @@
package com.engine.organization.entity.extend.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2022/06/23
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ExtendInfoParams {
/**
* 操作表对应主键
*/
private Long id;
/**
* 操作表对应的字段
*/
private String fields;
/**
* 操作的表明
*/
private String tableName;
/**
* 参数信息
*/
private Map<String, Object> params;
}

View File

@ -69,4 +69,7 @@ public class TypeTreeVO {
//父节点id
private Long pid;
public boolean getIsSelected() {
return isSelected;
}
}

View File

@ -0,0 +1,57 @@
package com.engine.organization.entity.hrmresource.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2022/06/21
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class HrmResourceSearchParam {
/**
* 姓名
*/
private String lastName;
/**
* 直接上级
*/
private Long managerId;
/**
* 分部
*/
private Long companyId;
/**
* 部门
*/
private Long departmentId;
/**
* 移动电话
*/
private String mobile;
/**
* 办公电话
*/
private String telephone;
/**
* 其他电话
*/
private String mobileCall;
/**
* 岗位
*/
private Long jobTitle;
}

View File

@ -0,0 +1,164 @@
package com.engine.organization.entity.hrmresource.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author:dxfeng
* @createTime: 2022/06/21
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class HrmResourcePO {
/**
* id
*/
private Long id;
/**
* 编号
*/
private String workCode;
/**
* 登录名
*/
private String loginId;
/**
* 姓名
*/
private String lastName;
/**
* 性别
*/
private Integer sex;
/**
* 账号类型
*/
private Integer accountType;
/**
* 主账号
*/
private Long belongTo;
/**
* 部门
*/
private Long departmentId;
/**
* 分部
*/
private Long companyId;
/**
* 职务
*/
private Long jobActivity;
/**
* 岗位
*/
private Long jobTitle;
/**
* 职称
*/
private Long jobCall;
/**
* 职级
*/
private Long jobLevel;
/**
* 职务类别
*/
private Long jobGroupId;
/**
* 职责描述
*/
private String jobActivityDesc;
/**
* 状态
*/
private Integer status;
/**
* 系统语言
*/
private Integer systemLanguage;
/**
* 照片
*/
private String resourceImageId;
/**
* 头像
*/
private String messagerUrl;
/**
* 办公地点
*/
private Integer locationId;
/**
* 直接上级
*/
private Long managerId;
/**
* 助理
*/
private Long assistantId;
/**
* 移动电话
*/
private String mobile;
/**
* 办公室电话
*/
private String telephone;
/**
* 其他电话
*/
private String mobileCall;
/**
* 传真
*/
private String fax;
/**
* 电子邮件
*/
private String email;
/**
* 办公室
*/
private String workroom;
private Long creator;
private int deleteType;
private Date createTime;
private Date updateTime;
}

View File

@ -0,0 +1,78 @@
package com.engine.organization.entity.hrmresource.vo;
import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.organization.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2022/06/21
* @version: 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "c0583f20-f10c-11ec-9947-00e04c680716",
fields = "t.id," +
"t.last_name," +
"t.department_id," +
"t.company_id," +
"t.mobile," +
"t.telephone," +
"t.manager_id ",
fromSql = "FROM jcl_org_hrmresource t ",
orderby = " id ",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "发消息"),
@OrganizationTableOperate(index = "1", text = "发送邮件"),
@OrganizationTableOperate(index = "1", text = "发送短信"),
@OrganizationTableOperate(index = "1", text = "新建日程"),
@OrganizationTableOperate(index = "1", text = "系统信息"),
},
tableType = WeaTableType.CHECKBOX
)
public class HrmResourceVO {
/**
* 主键
*/
@OrganizationTableColumn(column = "id", display = false)
private Long id;
/**
* 姓名
*/
@OrganizationTableColumn(text = "姓名", width = "25%", column = "last_name")
private String lastName;
/**
* 部门
*/
@OrganizationTableColumn(text = "部门", width = "25%", column = "department_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getDepartmentName")
private String departmentName;
/**
* 分部
*/
@OrganizationTableColumn(text = "分部", width = "25%", column = "company_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getCompanyName")
private String companyName;
/**
* 移动电话
*/
@OrganizationTableColumn(text = "移动电话", width = "25%", column = "mobile")
private String mobile;
/**
* 办公室电话
*/
@OrganizationTableColumn(text = "办公室电话", width = "25%", column = "telephone")
private String telephone;
/**
* 直接上级
*/
@OrganizationTableColumn(text = "直接上级", width = "25%", column = "manager_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getManagerName")
private String managerName;
}

View File

@ -4,6 +4,7 @@ import com.engine.organization.entity.job.dto.JobListDTO;
import com.engine.organization.entity.job.param.JobSearchParam;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.transmethod.JobTransMethod;
import com.engine.organization.util.db.MapperProxyFactory;
@ -39,6 +40,7 @@ public class JobBO {
.description(param.getDescription())
.workDuty(param.getWorkDuty())
.workAuthority(param.getWorkAuthority())
.showOrder(param.getShowOrder())
.forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1)
.deleteType(0)
.createTime(new Date())
@ -87,6 +89,7 @@ public class JobBO {
.parentJob(e.getParentJob())
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
.isKey(JobTransMethod.getIsKeySpan(e.getIsKey()))
.showOrder(e.getShowOrder())
.forbiddenTag(e.getForbiddenTag())
.build()).collect(Collectors.toList());
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
@ -142,4 +145,22 @@ public class JobBO {
}
}
public static List<SearchTree> buildSetToSearchTree(Set<JobPO> builderJobs) {
return builderJobs.stream().map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(false);
tree.setIcon("icon-coms-Branch");
tree.setId(item.getId().toString());
tree.setIsParent(false);
tree.setIsVirtual("0");
tree.setName(item.getJobName());
tree.setPid(null == item.getParentJob() ? "0" : item.getParentJob().toString());
tree.setSelected(false);
tree.setType("3");
tree.setParentComp(null == item.getParentDept() ? "0" : item.getParentDept().toString());
return tree;
}).collect(Collectors.toList());
}
}

View File

@ -2,7 +2,6 @@ package com.engine.organization.entity.job.dto;
import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableOperate;
import com.engine.organization.annotation.TableTitle;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -22,15 +21,7 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "0efea835-dfc5-11ec-a09e-00e04c680716",
tableType = WeaTableType.NONE,
operates = {
@OrganizationTableOperate(text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除"),
@OrganizationTableOperate(index = "2", text = "合并"),
@OrganizationTableOperate(index = "3", text = "转移"),
@OrganizationTableOperate(index = "4", text = "联查岗位"),
@OrganizationTableOperate(index = "4", text = "联查人员")
})
tableType = WeaTableType.NONE)
public class JobListDTO {
/**
* 主键
@ -82,10 +73,16 @@ public class JobListDTO {
@TableTitle(title = "是否关键岗", dataIndex = "isKey", key = "isKey")
private String isKey;
/**
* 显示顺序
*/
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
private Integer showOrder;
/**
* 禁用标记
*/
@TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag")
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
private Integer forbiddenTag;
/**

View File

@ -0,0 +1,31 @@
package com.engine.organization.entity.job.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/06/02
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class JobMergeParam {
/**
* 所选分部
*/
private Long id;
/**
* 合并分部
*/
private Long targetJob;
/**
* 合并后名称
*/
private String mergeName;
}

View File

@ -74,6 +74,11 @@ public class JobSearchParam extends BaseQueryParam {
*/
private Boolean forbiddenTag;
/**
* 显示顺序
*/
private Integer showOrder;
private Long subcompanyid1;
private Long departmentid;

View File

@ -74,6 +74,10 @@ public class JobPO {
* 禁用标记
*/
private Integer forbiddenTag;
/**
* 显示顺序
*/
private Integer showOrder;
private Long creator;

View File

@ -17,7 +17,6 @@ public class PostDTO {
}
return PostPO.builder()
.id(postPO.getId() == null ? 0 : postPO.getId())
.postNo(postPO.getPostNo() == null ? null : postPO.getPostNo())
.postName(postPO.getPostName() == null ? null : postPO.getPostName())
.description(postPO.getDescription() == null ? null : postPO.getDescription())
.deleteType(0)

View File

@ -22,10 +22,6 @@ public class PostPO {
* 主键
*/
private Long id;
/**
* 编号
*/
private String postNo;
/**
* 名称
*/

View File

@ -29,7 +29,8 @@ import lombok.NoArgsConstructor;
" t.description," +
" t.forbidden_tag",
fromSql = " from jcl_org_post_info t inner join jcl_org_post a on t.post_id = a.id ",
orderby = "id desc",
orderby = "post_info_no",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "编辑"),
@ -45,7 +46,7 @@ public class PostInfoTableVO {
/**
* 编号
*/
@OrganizationTableColumn(text = "编号", width = "20%", column = "post_info_no")
@OrganizationTableColumn(text = "编号", width = "20%", column = "post_info_no", orderkey = "post_info_no")
private String postInfoNo;
/**
* 名称
@ -81,6 +82,6 @@ public class PostInfoTableVO {
/**
* 禁用标记
*/
@OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag")
@OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag")
private Integer forbiddenTag;
}

View File

@ -27,7 +27,8 @@ import lombok.NoArgsConstructor;
" t.forbidden_tag," +
"t.is_used",
fromSql = "from jcl_org_grade t inner join jcl_org_scheme a on t.scheme_id = a.id ",
orderby = "id desc",
orderby = "grade_no",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(text = "编辑"),
@ -52,7 +53,7 @@ public class GradeTableVO {
/**
* 编号
*/
@OrganizationTableColumn(text = "编号", width = "20%", column = "grade_no")
@OrganizationTableColumn(text = "编号", width = "20%", column = "grade_no", orderkey = "grade_no")
private String gradeNo;
/**
* 名称
@ -82,6 +83,6 @@ public class GradeTableVO {
/**
* 禁用标记
*/
@OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag")
@OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag")
private int forbiddenTag;
}

View File

@ -26,7 +26,8 @@ import lombok.NoArgsConstructor;
"t.create_time," +
"t.update_time",
fromSql = "FROM jcl_org_level t inner join jcl_org_scheme s on t.scheme_id = s.id ",
orderby = "id desc",
orderby = "level_no",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(text = "编辑"),
@ -50,7 +51,7 @@ public class LevelTableVO {
/**
* 编号
*/
@OrganizationTableColumn(text = "编号", width = "20%", column = "level_no")
@OrganizationTableColumn(text = "编号", width = "20%", column = "level_no", orderkey = "level_no")
private String levelNo;
/**
* 名称
@ -73,6 +74,6 @@ public class LevelTableVO {
/**
* 禁用标记
*/
@OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag")
@OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag")
private Integer forbiddenTag;
}

View File

@ -24,7 +24,8 @@ import lombok.NoArgsConstructor;
"t.create_time," +
"t.update_time",
fromSql = "FROM jcl_org_scheme t ",
orderby = "id desc",
orderby = "scheme_no",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "编辑"),
@ -49,7 +50,7 @@ public class SchemeTableVO {
/**
* 方案编号
*/
@OrganizationTableColumn(text = "编号", width = "25%", column = "scheme_no")
@OrganizationTableColumn(text = "编号", width = "25%", column = "scheme_no", orderkey = "scheme_no")
private String schemeNo;
/**
* 方案名称
@ -66,6 +67,6 @@ public class SchemeTableVO {
/**
* 禁用标识
*/
@OrganizationTableColumn(text = "禁用标记", width = "25%", column = "forbidden_tag")
@OrganizationTableColumn(text = "是否启用", width = "25%", column = "forbidden_tag")
private Integer forbiddenTag;
}

View File

@ -30,7 +30,8 @@ import lombok.NoArgsConstructor;
"t.create_time," +
"t.update_time",
fromSql = "FROM jcl_org_sequence t inner join jcl_org_scheme s on t.scheme_id = s.id ",
orderby = "id desc",
orderby = "sequence_no",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(text = "编辑"),
@ -43,42 +44,42 @@ import lombok.NoArgsConstructor;
)
public class SequenceTableVO {
/**
* 主键
*/
@OrganizationTableColumn(column = "id", display = false)
private Long id;
/**
* 是否被引用
*/
@OrganizationTableColumn(column = "isUsed", display = false)
private Integer isUsed;
/**
* 编号
*/
@OrganizationTableColumn(text = "编号", width = "20%", column = "sequence_no")
private String sequenceNo;
/**
* 名称
*/
@OrganizationTableColumn(text = "名称", width = "20%", column = "sequence_name")
private String sequenceName;
/**
* 主键
*/
@OrganizationTableColumn(column = "id", display = false)
private Long id;
/**
* 是否被引用
*/
@OrganizationTableColumn(column = "isUsed", display = false)
private Integer isUsed;
/**
* 编号
*/
@OrganizationTableColumn(text = "编号", width = "20%", column = "sequence_no", orderkey = "sequence_no")
private String sequenceNo;
/**
* 名称
*/
@OrganizationTableColumn(text = "名称", width = "20%", column = "sequence_name")
private String sequenceName;
/**
* 描述说明
*/
@OrganizationTableColumn(text = "描述说明", width = "20%", column = "description")
private String description;
/**
* 描述说明
*/
@OrganizationTableColumn(text = "描述说明", width = "20%", column = "description")
private String description;
/**
* 等级方案
*/
@OrganizationTableColumn(text = "等级方案", width = "20%", column = "scheme_name")
private String schemeName;
/**
* 等级方案
*/
@OrganizationTableColumn(text = "等级方案", width = "20%", column = "scheme_name")
private String schemeName;
/**
* 禁用标记
*/
@OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag")
private Integer forbiddenTag;
/**
* 禁用标记
*/
@OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag")
private Integer forbiddenTag;
}

View File

@ -75,4 +75,9 @@ public class StaffSearchParam {
* 调整数量
*/
private Integer changeNum;
/**
* 调整说明
*/
private String changeDescription;
}

View File

@ -43,6 +43,11 @@ public class StaffsPO {
*/
private Integer requestId;
/**
* 调整说明
*/
private String description;
private Long creator;
private int deleteType;
private Date createTime;

View File

@ -20,7 +20,8 @@ import lombok.NoArgsConstructor;
@OrganizationTable(pageId = "e04abd72-dbd6-11ec-b69e-00ffcbed7508",
fields = "t.id,t.is_used, t.plan_no, t.plan_name, t.plan_year, t.time_start, t.time_end, t.forbidden_tag",
fromSql = "FROM jcl_org_staffplan t ",
orderby = "id desc",
orderby = "plan_no",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(text = "编辑"),
@ -46,7 +47,7 @@ public class StaffPlanTableVO {
/**
* 编号
*/
@OrganizationTableColumn(text = "编号", width = "16%", column = "plan_no")
@OrganizationTableColumn(text = "编号", width = "16%", column = "plan_no", orderkey = "plan_no")
private String planNo;
/**
* 名称
@ -71,7 +72,7 @@ public class StaffPlanTableVO {
/**
* 状态
*/
@OrganizationTableColumn(text = "状态", width = "16%", column = "forbidden_tag")
@OrganizationTableColumn(text = "是否启用", width = "16%", column = "forbidden_tag")
private Integer forbiddenTag;
}

View File

@ -19,7 +19,7 @@ public interface CompMapper {
*
* @return
*/
List<CompPO> list();
List<CompPO> list(@Param("orderSql") String orderSql);
/**
* 查询所有被引用的ID
@ -33,7 +33,7 @@ public interface CompMapper {
*
* @return
*/
List<CompPO> listByFilter(CompPO compPO);
List<CompPO> listByFilter(@Param("compPO") CompPO compPO, @Param("orderSql") String orderSql);
/**
* 获取顶级数据
@ -95,13 +95,13 @@ public interface CompMapper {
/**
* 根据ID批量查询数据
*
* @param ids
* @return
*/
List<CompPO> getCompsByIds(@Param("ids") Collection<Long> ids);
/**
* 保存公司/分部基础信息
*
@ -133,4 +133,11 @@ public interface CompMapper {
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
/**
* 获取最大排序
*
* @return
*/
int getMaxShowOrder();
}

View File

@ -12,6 +12,7 @@
<result column="comp_principal" property="compPrincipal"/>
<result column="description" property="description"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="show_order" property="showOrder"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
@ -32,6 +33,7 @@
, t.comp_principal
, t.description
, t.forbidden_tag
, t.show_order
, t.creator
, t.delete_type
, t.create_time
@ -91,6 +93,9 @@
description,
</if>
forbidden_tag,
<if test="showOrder != null ">
show_order,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
@ -130,6 +135,7 @@
#{description},
</if>
0,
#{showOrder},
</trim>
</insert>
@ -138,7 +144,7 @@
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
WHERE t.delete_type = 0 order by ${orderSql}
</select>
<select id="listParent" resultMap="BaseResultMap">
@ -176,26 +182,26 @@
<include refid="baseColumns"/>
from jcl_org_comp t where comp_no = #{compNo} AND delete_type = 0
</select>
<select id="listByFilter" parameterType="com.engine.organization.entity.company.po.CompPO"
resultMap="BaseResultMap">
<select id="listByFilter" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
<include refid="likeSQL"/>
<if test=" parentCompany != null ">
and t.parent_company = #{parentCompany}
<if test=" compPO.parentCompany != null ">
and t.parent_company = #{compPO.parentCompany}
</if>
<if test=" industry != null ">
and t.industry = #{industry}
<if test=" compPO.industry != null ">
and t.industry = #{compPO.industry}
</if>
<if test=" compPrincipal != null ">
and t.comp_principal = #{compPrincipal}
<if test=" compPO.compPrincipal != null ">
and t.comp_principal = #{compPO.compPrincipal}
</if>
<if test=" forbiddenTag != null ">
and t.forbidden_tag = #{forbiddenTag}
<if test=" compPO.forbiddenTag != null ">
and t.forbidden_tag = #{compPO.forbiddenTag}
</if>
order by ${orderSql}
</select>
<select id="listCompsByIds" resultType="java.util.Map">
@ -251,6 +257,10 @@
from JCL_ORG_STAFF
where delete_type = 0
</select>
<select id="getMaxShowOrder" resultType="java.lang.Integer">
select max(show_order)
from jcl_org_comp
</select>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
update jcl_org_comp
@ -282,52 +292,53 @@
industry=#{industry},
comp_principal=#{compPrincipal},
description=#{description},
show_order=#{showOrder},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<sql id="likeSQL">
<if test=" compNo != null and compNo != '' ">
and t.comp_no like CONCAT('%',#{compNo},'%')
<if test=" compPO.compNo != null and compPO.compNo != '' ">
and t.comp_no like CONCAT('%',#{compPO.compNo},'%')
</if>
<if test=" compName != null and compName != '' ">
and t.comp_name like CONCAT('%',#{compName},'%')
<if test=" compPO.compName != null and compPO.compName != '' ">
and t.comp_name like CONCAT('%',#{compPO.compName},'%')
</if>
<if test=" compNameShort != null and compNameShort != '' ">
and t.comp_name_short like CONCAT('%',#{compNameShort},'%')
<if test=" compPO.compNameShort != null and compPO.compNameShort != '' ">
and t.comp_name_short like CONCAT('%',#{compPO.compNameShort},'%')
</if>
<if test=" orgCode != null and orgCode != '' ">
and t.org_code like CONCAT('%',#{orgCode},'%')
<if test=" compPO.orgCode != null and compPO.orgCode != '' ">
and t.org_code like CONCAT('%',#{compPO.orgCode},'%')
</if>
</sql>
<sql id="likeSQL" databaseId="oracle">
<if test=" compNo != null and compNo != '' ">
and t.comp_no like '%'||#{compNo}||'%'
<if test=" compPO.compNo != null and compPO.compNo != '' ">
and t.comp_no like '%'||#{compPO.compNo}||'%'
</if>
<if test=" compName != null and compName != '' ">
and t.comp_name like '%'||#{compName}||'%'
<if test=" compPO.compName != null and compPO.compName != '' ">
and t.comp_name like '%'||#{compPO.compName}||'%'
</if>
<if test=" compNameShort != null and compNameShort != '' ">
and t.comp_name_short like '%'||#{compNameShort}||'%'
<if test=" compPO.compNameShort != null and compPO.compNameShort != '' ">
and t.comp_name_short like '%'||#{compPO.compNameShort}||'%'
</if>
<if test=" orgCode != null and orgCode != '' ">
and t.org_code like '%'||#{orgCode}||'%'
<if test=" compPO.orgCode != null and compPO.orgCode != '' ">
and t.org_code like '%'||#{compPO.orgCode}||'%'
</if>
</sql>
<sql id="likeSQL" databaseId="sqlserver">
<if test=" compNo != null and compNo != '' ">
and t.comp_no like '%'+#{compNo}+'%'
<if test=" compPO.compNo != null and compPO.compNo != '' ">
and t.comp_no like '%'+#{compPO.compNo}+'%'
</if>
<if test=" compName != null and compName != '' ">
and t.comp_name like '%'+#{compName}+'%'
<if test=" compPO.compName != null and compPO.compName != '' ">
and t.comp_name like '%'+#{compPO.compName}+'%'
</if>
<if test=" compNameShort != null and compNameShort != '' ">
and t.comp_name_short like '%'+#{compNameShort}+'%'
<if test=" compPO.compNameShort != null and compPO.compNameShort != '' ">
and t.comp_name_short like '%'+#{compPO.compNameShort}+'%'
</if>
<if test=" orgCode != null and orgCode != '' ">
and t.org_code like '%'+#{orgCode}+'%'
<if test=" compPO.orgCode != null and compPO.orgCode != '' ">
and t.org_code like '%'+#{compPO.orgCode}+'%'
</if>
</sql>

View File

@ -27,7 +27,7 @@ public interface DepartmentMapper {
*
* @return
*/
List<DepartmentPO> list();
List<DepartmentPO> list(@Param("orderSql") String orderSql);
/**
* 根据No查询数据
@ -42,7 +42,7 @@ public interface DepartmentMapper {
*
* @return
*/
List<DepartmentPO> listByFilter(DepartmentPO departmentPO);
List<DepartmentPO> listByFilter(@Param("departmentPO") DepartmentPO departmentPO, @Param("orderSql") String orderSql);
/**
* 浏览按钮展示数据用
@ -52,6 +52,8 @@ public interface DepartmentMapper {
*/
List<Map<String, Object>> listDeptsByIds(@Param("ids") Collection<Long> ids);
List<DepartmentPO> getDeptsByIds(@Param("ids") Collection<Long> ids);
/**
* 根据ID查询数据
*
@ -66,7 +68,7 @@ public interface DepartmentMapper {
* @param id
* @return
*/
String getDeptNameById(@Param("id") int id);
String getDeptNameById(@Param("id") Long id);
/**
* 添加数据
@ -92,14 +94,6 @@ public interface DepartmentMapper {
*/
int updateForbiddenTagById(DepartmentPO departmentPO);
/**
* 批量禁用部门
*
* @param ids
* @return
*/
int forbiddenDepartmentByIds(@Param("ids") Collection<Long> ids);
/**
* 批量删除
*
@ -113,4 +107,11 @@ public interface DepartmentMapper {
* @return
*/
List<String> listUsedId();
/**
* 获取最大排序
*
* @return
*/
int getMaxShowOrder();
}

View File

@ -62,21 +62,22 @@
from jcl_org_dept t
where delete_type = 0
<include refid="likeSQL"/>
<if test=" parentComp != null ">
and t.parent_comp = #{parentComp}
<if test=" departmentPO.parentComp != null ">
and t.parent_comp = #{departmentPO.parentComp}
</if>
<if test=" parentDept != null ">
and t.parent_dept = #{parentDept}
<if test=" departmentPO.parentDept != null ">
and t.parent_dept = #{departmentPO.parentDept}
</if>
<if test=" deptPrincipal != null ">
and t.dept_principal = #{deptPrincipal}
<if test=" departmentPO.deptPrincipal != null ">
and t.dept_principal = #{departmentPO.deptPrincipal}
</if>
<if test=" showOrder != null ">
and t.show_order = #{showOrder}
<if test=" departmentPO.showOrder != null ">
and t.show_order = #{departmentPO.showOrder}
</if>
<if test=" forbiddenTag != null ">
and t.forbidden_tag = #{forbiddenTag}
<if test=" departmentPO.forbiddenTag != null ">
and t.forbidden_tag = #{departmentPO.forbiddenTag}
</if>
order by ${orderSql}
</select>
<select id="getDeptById" resultType="com.engine.organization.entity.department.po.DepartmentPO">
@ -103,7 +104,7 @@
SELECT
<include refid="baseColumns"/>
FROM jcl_org_dept t
WHERE t.delete_type = 0
WHERE t.delete_type = 0 order by ${orderSql}
</select>
<select id="listByNo" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select
@ -125,6 +126,20 @@
from JCL_ORG_STAFF
where delete_type = 0
</select>
<select id="getDeptsByIds" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="getMaxShowOrder" resultType="java.lang.Integer">
select max(show_order)
from jcl_org_dept
</select>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.department.po.DepartmentPO"
keyProperty="id"
@ -223,6 +238,9 @@
dept_principal=#{deptPrincipal},
show_order=#{showOrder},
description=#{description},
<if test="forbiddenTag !=null">
forbidden_tag=#{forbiddenTag},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -244,48 +262,41 @@
#{id}
</foreach>
</update>
<update id="forbiddenDepartmentByIds">
update jcl_org_dept set forbidden_tag = 1 WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<sql id="likeSQL">
<if test=" deptNo != null and deptNo != '' ">
and t.dept_no like CONCAT('%',#{deptNo},'%')
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' ">
and t.dept_no like CONCAT('%',#{departmentPO.deptNo},'%')
</if>
<if test=" deptName != null and deptName != '' ">
and t.dept_name like CONCAT('%',#{deptName},'%')
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' ">
and t.dept_name like CONCAT('%',#{departmentPO.deptName},'%')
</if>
<if test=" deptNameShort != null and deptNameShort != '' ">
and t.dept_name_short like CONCAT('%',#{deptNameShort},'%')
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' ">
and t.dept_name_short like CONCAT('%',#{departmentPO.deptNameShort},'%')
</if>
</sql>
<sql id="likeSQL" databaseId="oracle">
<if test=" deptNo != null and deptNo != '' ">
and t.dept_no like '%'||#{deptNo}||'%'
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' ">
and t.dept_no like '%'||#{departmentPO.deptNo}||'%'
</if>
<if test=" deptName != null and deptName != '' ">
and t.dept_name like '%'||#{deptName}||'%'
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' ">
and t.dept_name like '%'||#{departmentPO.deptName}||'%'
</if>
<if test=" deptNameShort != null and deptNameShort != '' ">
and t.dept_name_short like '%'||#{deptNameShort}||'%'
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' ">
and t.dept_name_short like '%'||#{departmentPO.deptNameShort}||'%'
</if>
</sql>
<sql id="likeSQL" databaseId="sqlserver">
<if test=" deptNo != null and deptNo != '' ">
and t.dept_no like '%'+#{deptNo}+'%'
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' ">
and t.dept_no like '%'+#{departmentPO.deptNo}+'%'
</if>
<if test=" deptName != null and deptName != '' ">
and t.dept_name like '%'+#{deptName}+'%'
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' ">
and t.dept_name like '%'+#{departmentPO.deptName}+'%'
</if>
<if test=" deptNameShort != null and deptNameShort != '' ">
and t.dept_name_short like '%'+#{deptNameShort}+'%'
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' ">
and t.dept_name_short like '%'+#{departmentPO.deptNameShort}+'%'
</if>
</sql>

View File

@ -1,6 +1,6 @@
package com.engine.organization.mapper.extend;
import org.apache.ibatis.annotations.Param;
import com.engine.organization.entity.extend.param.ExtendInfoParams;
import java.util.Map;
@ -15,34 +15,32 @@ public interface ExtMapper {
/**
* 根据主表id,查询主表拓展表数据
*
* @param tableName
* @param id
* @param params
* @return
*/
Map<String, Object> listExt(@Param("tableName") String tableName, @Param("fields") String fields, @Param("id") long id);
Map<String, Object> listExt(ExtendInfoParams params);
/**
* 判断当前数据是否存在
*
* @param tableName
* @param id
* @param params
* @return
*/
int countExtById(@Param("tableName") String tableName, @Param("id") long id);
int countExtById(ExtendInfoParams params);
/**
* 插入主表拓展表
*
* @param map
* @param params
* @return
*/
int insertExt(@Param("tableName") String tableName, @Param("map") Map<String, Object> map);
int insertExt(ExtendInfoParams params);
/**
* 更新主表拓展表
*
* @param map
* @param params
* @return
*/
int updateExt(@Param("tableName") String tableName, @Param("id") long id, @Param("map") Map<String, Object> map);
int updateExt(ExtendInfoParams params);
}

View File

@ -2,36 +2,38 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.extend.ExtMapper">
<insert id="insertExt" parameterType="java.util.Map">
<insert id="insertExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams"
keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
insert into ${tableName} (
<foreach collection="map" item="value" index="key" separator=",">
<foreach collection="params" item="value" index="key" separator=",">
${key}
</foreach>
)
values (
<foreach collection="map" item="value" index="key" separator=",">
<foreach collection="params" item="value" index="key" separator=",">
#{value}
</foreach>
)
</insert>
<update id="updateExt" parameterType="java.util.Map">
<update id="updateExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams">
update ${tableName} set
<foreach collection="map" item="value" index="key" separator=",">
<foreach collection="params" item="value" index="key" separator=",">
${key} = #{value}
</foreach>
where id = #{id}
</update>
<select id="listExt" resultType="map">
<select id="listExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams" resultType="map">
select ${fields}
from ${tableName}
where delete_type = 0
and id = #{id}
</select>
<select id="countExtById" resultType="java.lang.Integer">
<select id="countExtById" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams"
resultType="java.lang.Integer">
select count(1)
from ${tableName}
where delete_type = 0

View File

@ -269,7 +269,6 @@
<select id="getMaxId" resultType="java.lang.Long">
select max(id)
from jcl_field_extendinfo
order by id desc
</select>
<select id="listFieldsByTableName" resultType="java.lang.Object">
select ${fieldName}

View File

@ -21,14 +21,22 @@ public interface JobMapper {
*
* @return
*/
List<JobListDTO> listByFilter(JobPO jobPO);
List<JobListDTO> listByFilter(@Param("jobPO") JobPO jobPO, @Param("orderSql") String orderSql);
/**
* 展示所有列表数据
*
* @return
*/
List<JobListDTO> listNoFilter();
List<JobListDTO> listNoFilter(@Param("orderSql") String orderSql);
/**
* 根据搜索条件查询数据
*
* @param jobPO
* @return
*/
List<JobPO> listPOsByFilter(@Param("jobPO") JobPO jobPO);
/**
* 查询所有数据
@ -116,4 +124,11 @@ public interface JobMapper {
* @return
*/
List<String> listUsedId();
/**
* 获取最大排序
*
* @return
*/
int getMaxShowOrder();
}

View File

@ -15,6 +15,7 @@
<result column="work_duty" property="workDuty"/>
<result column="work_authority" property="workAuthority"/>
<result column="description" property="description"/>
<result column="show_order" property="showOrder"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
@ -40,6 +41,7 @@
t.description,
t.work_duty,
t.work_authority,
t.show_order,
t.forbidden_tag
</sql>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.job.po.JobPO"
@ -96,6 +98,9 @@
<if test="workAuthority != null ">
work_authority,
</if>
<if test="showOrder != null ">
show_order,
</if>
forbidden_tag,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
@ -148,6 +153,9 @@
<if test="workAuthority != null ">
#{workAuthority},
</if>
<if test="showOrder != null ">
#{showOrder},
</if>
0,
</trim>
</insert>
@ -167,6 +175,10 @@
description=#{description},
work_duty=#{workDuty},
work_authority=#{workAuthority},
show_order=#{showOrder},
<if test="forbiddenTag != null">
forbidden_tag=#{forbiddenTag},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -207,24 +219,25 @@
t.scheme_id = d.id
WHERE t.delete_type = 0
<include refid="likeSQL"/>
<if test=" parentComp != null ">
and t.parent_comp = #{parentComp}
<if test=" jobPO.parentComp != null ">
and t.parent_comp = #{jobPO.parentComp}
</if>
<if test=" parentDept != null ">
and t.parent_dept = #{parentDept}
<if test=" jobPO.parentDept != null ">
and t.parent_dept = #{jobPO.parentDept}
</if>
<if test=" sequenceId != null ">
and t.sequence_id = #{sequenceId}
<if test=" jobPO.sequenceId != null ">
and t.sequence_id = #{jobPO.sequenceId}
</if>
<if test=" schemeId != null ">
and t.scheme_id = #{schemeId}
<if test=" jobPO.schemeId != null ">
and t.scheme_id = #{jobPO.schemeId}
</if>
<if test=" isKey != null ">
and t.is_key = #{isKey}
<if test=" jobPO.isKey != null ">
and t.is_key = #{jobPO.isKey}
</if>
<if test=" forbiddenTag != null ">
and t.forbidden_tag = #{forbiddenTag}
<if test=" jobPO.forbiddenTag != null ">
and t.forbidden_tag = #{jobPO.forbiddenTag}
</if>
order by ${orderSql}
</select>
<select id="listNoFilter" resultType="com.engine.organization.entity.job.dto.JobListDTO">
@ -243,7 +256,7 @@
t.sequence_id = c.id
left join jcl_org_scheme d on
t.scheme_id = d.id
WHERE t.delete_type = 0
WHERE t.delete_type = 0 order by ${orderSql}
</select>
<select id="getJobById" resultMap="BaseResultMap">
@ -295,68 +308,97 @@
from jcl_org_job t
where delete_type = 0
</select>
<select id="listPOsByFilter" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
FROM jcl_org_job t
WHERE t.delete_type = 0
<include refid="likeSQL"/>
<if test=" jobPO.parentComp != null ">
and t.parent_comp = #{jobPO.parentComp}
</if>
<if test=" jobPO.parentDept != null ">
and t.parent_dept = #{jobPO.parentDept}
</if>
<if test=" jobPO.sequenceId != null ">
and t.sequence_id = #{jobPO.sequenceId}
</if>
<if test=" jobPO.schemeId != null ">
and t.scheme_id = #{jobPO.schemeId}
</if>
<if test=" jobPO.isKey != null ">
and t.is_key = #{jobPO.isKey}
</if>
<if test=" jobPO.forbiddenTag != null ">
and t.forbidden_tag = #{jobPO.forbiddenTag}
</if>
</select>
<select id="getMaxShowOrder" resultType="java.lang.Integer">
select max(show_order)
from jcl_org_job
</select>
<sql id="likeSQL">
<if test=" jobNo != null and jobNo != '' ">
and t.job_no like CONCAT('%',#{jobNo},'%')
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
and t.job_no like CONCAT('%',#{jobPO.jobNo},'%')
</if>
<if test=" jobName != null and jobName != '' ">
and t.job_name like CONCAT('%',#{jobName},'%')
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
and t.job_name like CONCAT('%',#{jobPO.jobName},'%')
</if>
<if test=" workplace != null and workplace != '' ">
and t.workplace like CONCAT('%',#{workplace},'%')
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
and t.workplace like CONCAT('%',#{jobPO.workplace},'%')
</if>
<if test=" description != null and description != '' ">
and t.description like CONCAT('%',#{description},'%')
<if test=" jobPO.description != null and jobPO.description != '' ">
and t.description like CONCAT('%',#{jobPO.description},'%')
</if>
<if test=" workDuty != null and workDuty != '' ">
and t.work_duty like CONCAT('%',#{workDuty},'%')
<if test=" jobPO.workDuty != null and jobPO.workDuty != '' ">
and t.work_duty like CONCAT('%',#{jobPO.workDuty},'%')
</if>
<if test=" workAuthority != null and workAuthority != '' ">
and t.work_authority like CONCAT('%',#{workAuthority},'%')
<if test=" jobPO.workAuthority != null and jobPO.workAuthority != '' ">
and t.work_authority like CONCAT('%',#{jobPO.workAuthority},'%')
</if>
</sql>
<sql id="likeSQL" databaseId="oracle">
<if test=" jobNo != null and jobNo != '' ">
and t.job_no like '%'||#{jobNo}||'%'
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
and t.job_no like '%'||#{jobPO.jobNo}||'%'
</if>
<if test=" jobName != null and jobName != '' ">
and t.job_name like '%'||#{jobName}||'%'
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
and t.job_name like '%'||#{jobPO.jobName}||'%'
</if>
<if test=" workplace != null and workplace != '' ">
and t.workplace like '%'||#{workplace}||'%'
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
and t.workplace like '%'||#{jobPO.workplace}||'%'
</if>
<if test=" description != null and description != '' ">
and t.description like '%'||#{description}||'%'
<if test=" jobPO.description != null and jobPO.description != '' ">
and t.description like '%'||#{jobPO.description}||'%'
</if>
<if test=" workDuty != null and workDuty != '' ">
and t.work_duty like '%'||#{workDuty}||'%'
<if test=" jobPO.workDuty != null and jobPO.workDuty != '' ">
and t.work_duty like '%'||#{jobPO.workDuty}||'%'
</if>
<if test=" workAuthority != null and workAuthority != '' ">
and t.work_authority like '%'||#{workAuthority}||'%'
<if test=" jobPO.workAuthority != null and jobPO.workAuthority != '' ">
and t.work_authority like '%'||#{jobPO.workAuthority}||'%'
</if>
</sql>
<sql id="likeSQL" databaseId="sqlserver">
<if test=" jobNo != null and jobNo != '' ">
and t.job_no like '%'+#{jobNo}+'%'
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
and t.job_no like '%'+#{jobPO.jobNo}+'%'
</if>
<if test=" jobName != null and jobName != '' ">
and t.job_name like '%'+#{jobName}+'%'
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
and t.job_name like '%'+#{jobPO.jobName}+'%'
</if>
<if test=" workplace != null and workplace != '' ">
and t.workplace like '%'+#{workplace}+'%'
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
and t.workplace like '%'+#{jobPO.workplace}+'%'
</if>
<if test=" description != null and description != '' ">
and t.description like '%'+#{description}+'%'
<if test=" jobPO.description != null and jobPO.description != '' ">
and t.description like '%'+#{jobPO.description}+'%'
</if>
<if test=" workDuty != null and workDuty != '' ">
and t.work_duty like '%'+#{workDuty}+'%'
<if test=" jobPO.workDuty != null and jobPO.workDuty != '' ">
and t.work_duty like '%'+#{jobPO.workDuty}+'%'
</if>
<if test=" workAuthority != null and workAuthority != '' ">
and t.work_authority like '%'+#{workAuthority}+'%'
<if test=" jobPO.workAuthority != null and jobPO.workAuthority != '' ">
and t.work_authority like '%'+#{jobPO.workAuthority}+'%'
</if>
</sql>
</mapper>

View File

@ -18,15 +18,6 @@ import java.util.Map;
* @Version V1.0
**/
public interface PostMapper {
/**
* 根据No查询职务分类
*
* @param postNo
* @return
*/
List<PostPO> listByNo(@Param("postNo") String postNo);
/**
* 获取职务分类根据ID
*

View File

@ -3,7 +3,6 @@
<mapper namespace="com.engine.organization.mapper.post.PostMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.postion.po.PostPO">
<result column="id" property="id"/>
<result column="post_no" property="postNo"/>
<result column="post_name" property="postName"/>
<result column="description" property="description"/>
<result column="creator" property="creator"/>
@ -22,7 +21,6 @@
t
.
id
, t.post_no
, t.post_name
, t.description
, t.creator
@ -37,13 +35,6 @@
from jcl_org_post t where id = #{id} AND delete_type = 0
</select>
<select id="listByNo" parameterType="com.engine.organization.entity.postion.po.PostPO" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_post t where post_no = #{postNo} AND delete_type = 0
</select>
<!-- 浏览按钮赋值、展示用 -->
<select id="listPostsByIds" resultType="java.util.Map">
select
@ -66,7 +57,6 @@
<set>
creator=#{creator},
update_time=#{updateTime},
post_no=#{postNo},
post_name=#{postName},
description=#{description},
</set>
@ -89,9 +79,6 @@
<if test="updateTime != null">
update_time,
</if>
<if test="postNo != null ">
post_no,
</if>
<if test="postName != null ">
post_name,
</if>
@ -112,9 +99,6 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="postNo != null ">
#{postNo},
</if>
<if test="postName != null ">
#{postName},
</if>

View File

@ -1,10 +1,12 @@
package com.engine.organization.mapper.scheme;
import com.engine.organization.entity.TreeData;
import com.engine.organization.entity.scheme.po.LevelPO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@ -34,6 +36,7 @@ public interface LevelMapper {
/**
* 获取职等根据ID
*
* @param id
* @return
*/
@ -46,10 +49,11 @@ public interface LevelMapper {
* @return
*/
@MapKey("id")
List<Map<String,Object>> listLevelsByIds(@Param("ids") Collection<Long> ids);
List<Map<String, Object>> listLevelsByIds(@Param("ids") Collection<Long> ids);
/**
* 插入职等
*
* @param levelPO
* @return
*/
@ -80,8 +84,16 @@ public interface LevelMapper {
/**
* 根据禁用标记统计
*
* @param tag
* @return
*/
int getCountByTag(@Param("tag") int tag);
/**
* 获取左侧树
*
* @return
*/
ArrayList<TreeData> getTreeData();
}

View File

@ -14,6 +14,11 @@
<result column="update_time" property="updateTime"/>
</resultMap>
<resultMap id="TreeResultMap" type="com.engine.organization.entity.TreeData">
<result column="id" property="key"/>
<result column="level_name" property="title"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
@ -29,6 +34,8 @@
, t.create_time
, t.update_time
</sql>
<select id="getLevelByID" parameterType="com.engine.organization.entity.scheme.po.LevelPO"
resultMap="BaseResultMap">
select
@ -68,6 +75,11 @@
from JCL_ORG_JOBDT
where delete_type = 0
</select>
<select id="getTreeData" resultMap="TreeResultMap">
select id, level_name
from jcl_org_level
where delete_type = '0'
</select>
<update id="updateLevel" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
update jcl_org_level

View File

@ -1,10 +1,12 @@
package com.engine.organization.mapper.scheme;
import com.engine.organization.entity.TreeData;
import com.engine.organization.entity.scheme.po.SchemePO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@ -79,4 +81,10 @@ public interface SchemeMapper {
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
/**
* 获取左侧树
* @return
*/
ArrayList<TreeData> getTreeData();
}

View File

@ -13,6 +13,11 @@
<result column="update_time" property="updateTime"/>
</resultMap>
<resultMap id="TreeResultMap" type="com.engine.organization.entity.TreeData">
<result column="id" property="key"/>
<result column="scheme_name" property="title"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t
@ -68,6 +73,11 @@
from JCL_ORG_JOB
where delete_type = 0
</select>
<select id="getTreeData" resultMap="TreeResultMap">
select id, scheme_name
from jcl_org_scheme
where delete_type = '0'
</select>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.SchemePO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">

View File

@ -59,6 +59,9 @@
<if test="requestId != null ">
requestid,
</if>
<if test="description != null ">
description,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
@ -89,6 +92,9 @@
<if test="requestId != null ">
#{requestId},
</if>
<if test="description != null ">
#{description},
</if>
</trim>
</insert>

View File

@ -1,8 +1,11 @@
package com.engine.organization.service;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
@ -27,7 +30,7 @@ public interface CompService {
* @param params
* @return
*/
int saveBaseComp(Map<String, Object> params);
Long saveBaseComp(Map<String, Object> params);
/**
* 更新禁用标记
@ -43,7 +46,7 @@ public interface CompService {
* @param params
* @return
*/
int updateComp(Map<String, Object> params);
Long updateComp(Map<String, Object> params);
/**
@ -83,4 +86,19 @@ public interface CompService {
*/
Map<String, Object> getCompSaveForm();
/**
* 转移分部表单
*
* @return
*/
List<SearchConditionGroup> getMoveForm();
/**
* 转移到指定分部或部门
*
* @param moveParam
* @return
*/
int moveCompany(DepartmentMoveParam moveParam);
}

View File

@ -58,7 +58,7 @@ public interface DepartmentService {
* @param params
* @return
*/
int saveBaseForm(Map<String, Object> params);
Long saveBaseForm(Map<String, Object> params);
/**
* 更新禁用标记
@ -74,7 +74,7 @@ public interface DepartmentService {
* @param params
* @return
*/
int updateForm(Map<String, Object> params);
Long updateForm(Map<String, Object> params);
/**

View File

@ -73,7 +73,7 @@ public interface ExtService {
* @param id
* @return
*/
int updateExtForm(User user, String extendType, String tableName, Map<String, Object> params, String groupId, Long id);
Long updateExtForm(User user, String extendType, String tableName, Map<String, Object> params, String groupId, Long id);
/**
* 更新明细表

View File

@ -0,0 +1,76 @@
package com.engine.organization.service;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2022/06/20
* @version: 1.0
*/
public interface HrmResourceService {
/**
* 列表左侧树
*
* @param params
* @return
*/
Map<String, Object> getSearchTree(SearchTreeParams params);
/**
* 人员列表
*
* @param params
* @return
*/
Map<String, Object> listPage(HrmResourceSearchParam params);
/**
* 获取新增表单
*
* @return
*/
Map<String, Object> getSaveForm();
/**
* 新增
*
* @param params
* @return
*/
Long saveBaseForm(Map<String, Object> params);
/**
* 获取基本信息表单
*
* @param params
* @return
*/
Map<String, Object> getBaseForm(Map<String, Object> params);
/**
* 更新
*
* @param params
* @return
*/
int updateForm(Map<String, Object> params);
/**
* 获取搜索条件
*
* @param params
* @return
*/
Map<String, Object> getSearchCondition(Map<String, Object> params);
/**
* 获取列表页面按钮信息
*
* @return
*/
Map<String, Object> getHasRight();
}

View File

@ -1,9 +1,12 @@
package com.engine.organization.service;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.organization.entity.job.param.JobMergeParam;
import com.engine.organization.entity.job.param.JobSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
@ -63,7 +66,7 @@ public interface JobService {
* @param params
* @return
*/
int saveBaseForm(Map<String, Object> params);
Long saveBaseForm(Map<String, Object> params);
/**
* 更新主表拓展表明细表
@ -71,7 +74,7 @@ public interface JobService {
* @param params
* @return
*/
int updateForm(Map<String, Object> params);
Long updateForm(Map<String, Object> params);
/**
* 复制岗位到指定部门
@ -98,4 +101,19 @@ public interface JobService {
int deleteByIds(Collection<Long> ids);
Map<String, Object> getHrmListByJobId(Long jobId);
/**
* 合并表单
*
* @return
*/
List<SearchConditionGroup> getMergeForm();
/**
* 合并岗位
*
* @param mergeParam
* @return
*/
int mergeJob(JobMergeParam mergeParam);
}

View File

@ -1,5 +1,6 @@
package com.engine.organization.service;
import com.engine.organization.entity.TreeData;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import java.util.Collection;
@ -78,4 +79,11 @@ public interface LevelService {
*/
Map<String, Object> getTabInfo();
/**
* 获取左侧树
*
* @return
*/
TreeData getTreeData();
}

View File

@ -1,8 +1,10 @@
package com.engine.organization.service;
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
import com.engine.organization.entity.scheme.param.SchemeSearchParam;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
@ -70,8 +72,16 @@ public interface SchemeService {
/**
* 获取列表页面按钮信息
*
* @return
*/
Map<String, Object> getTableBtn();
/**
* 获取左侧树
*
* @return
*/
List<TypeTreeVO> getTreeData();
}

View File

@ -11,25 +11,27 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrm.entity.RuleCodeType;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.dto.CompListDTO;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.service.CompService;
import com.engine.organization.service.ExtService;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.*;
import com.engine.organization.util.coderule.CodeRuleUtil;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.page.Column;
import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.hrm.User;
@ -95,11 +97,12 @@ public class CompServiceImpl extends Service implements CompService {
CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID());
boolean filter = isFilter(compPO);
PageInfo<CompListDTO> pageInfos;
List<CompPO> alltList = getCompMapper().list();
String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams());
List<CompPO> alltList = getCompMapper().list(orderSql);
// 通过子级遍历父级元素
if (filter) {
// 根据条件获取元素
List<CompPO> filterCompPOs = getCompMapper().listByFilter(compPO);
List<CompPO> filterCompPOs = getCompMapper().listByFilter(compPO, orderSql);
// 添加父级元素
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(alltList, filterCompPOs);
List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
@ -132,14 +135,16 @@ public class CompServiceImpl extends Service implements CompService {
}
@Override
public int saveBaseComp(Map<String, Object> params) {
public Long saveBaseComp(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
String compNo = (String) params.get("comp_no");
compNo = CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, compNo);
List<CompPO> list = getCompMapper().listByNo(Util.null2String(compNo));
OrganizationAssert.isEmpty(list, "编号不允许重复");
// 判断是否开启自动编号
compNo = repeatDetermine(compNo);
params.put("comp_no", compNo);
if (StringUtils.isBlank(params.get("show_order").toString())) {
int maxShowOrder = getCompMapper().getMaxShowOrder();
params.put("show_order", maxShowOrder + 1);
}
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", null);
}
@ -151,22 +156,27 @@ public class CompServiceImpl extends Service implements CompService {
}
@Override
public int updateComp(Map<String, Object> params) {
public Long updateComp(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
String groupId = (String) params.get("viewCondition");
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
int updateCount = 0;
String oldCompNo = getCompMapper().listById(searchParam.getId()).getCompNo();
String compNo = searchParam.getCompNo();
if (!oldCompNo.equals(compNo)) {
compNo = repeatDetermine(compNo);
params.put("comp_no", compNo);
}
// 更新主表数据
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId());
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId());
// 更新主表拓展表
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, searchParam.getId());
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, searchParam.getId());
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, searchParam.getId());
return updateCount;
return searchParam.getId();
}
@Override
@ -243,7 +253,10 @@ public class CompServiceImpl extends Service implements CompService {
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_COMP : JCL_ORG_COMPEXT, viewAttr, id, extendTitle.getId() + "", "comp_no")));
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_COMP : JCL_ORG_COMPEXT, viewAttr, id, extendTitle.getId() + "", "");
if (CollectionUtils.isNotEmpty(items)) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
}
}
}
@ -271,7 +284,10 @@ public class CompServiceImpl extends Service implements CompService {
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendTitle.getId() + "", "comp_no", RuleCodeType.SUBCOMPANY.getValue())));
List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendTitle.getId() + "", "comp_no", RuleCodeType.SUBCOMPANY.getValue());
if (CollectionUtils.isNotEmpty(items)) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
}
}
}
apiDatas.put("condition", addGroups);
@ -279,6 +295,34 @@ public class CompServiceImpl extends Service implements CompService {
}
@Override
public List<SearchConditionGroup> getMoveForm() {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> condition = new ArrayList<>();
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "转移到", "161", "company", "compBrowser");
condition.add(compBrowserItem);
addGroups.add(new SearchConditionGroup("", true, condition));
return addGroups;
}
@Override
public int moveCompany(DepartmentMoveParam moveParam) {
Long targetCompanyId = moveParam.getCompany();
OrganizationAssert.notNull(targetCompanyId, "请选择要转移到的分部");
Long companyId = moveParam.getId();
// 判断目标分部是否为它本身以及子元素
Set<Long> disableIds = new HashSet<>();
disableIds.add(companyId);
List<CompPO> compPOS = getCompMapper().listChild(DeleteParam.builder().ids(companyId.toString()).build().getIds());
if (CollectionUtils.isNotEmpty(compPOS)) {
addDisableIds(disableIds, compPOS);
}
OrganizationAssert.isFalse(disableIds.contains(targetCompanyId), "请勿选择当前分部本身及其子分部");
CompPO compPO = getCompMapper().listById(companyId);
compPO.setParentCompany(targetCompanyId);
return getCompMapper().updateBaseComp(compPO);
}
/**
* 是否为搜索查询
@ -297,4 +341,52 @@ public class CompServiceImpl extends Service implements CompService {
&& null == compPO.getForbiddenTag());
}
/**
* 判断编号是否重复
*
* @return
*/
private String repeatDetermine(String compNo) {
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.SUBCOMPANY.getValue());
if (StringUtils.isNotBlank(compNo)) {
compNo = CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, compNo);
List<CompPO> list = getCompMapper().listByNo(Util.null2String(compNo));
OrganizationAssert.isEmpty(list, "编号不允许重复");
} else {
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
compNo = autoCreateCompanyNo();
}
}
return compNo;
}
/**
* 自动编号处理
*
* @return
*/
private String autoCreateCompanyNo() {
String generateCode = CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, "");
List<CompPO> list = getCompMapper().listByNo(Util.null2String(generateCode));
if (CollectionUtils.isNotEmpty(list)) {
generateCode = autoCreateCompanyNo();
}
return generateCode;
}
/**
* 添加子元素ID
*
* @param disableIds
* @param compPOS
*/
private void addDisableIds(Set<Long> disableIds, List<CompPO> compPOS) {
for (CompPO compPO : compPOS) {
disableIds.add(compPO.getId());
List<CompPO> childCompPOS = getCompMapper().listChild(DeleteParam.builder().ids(compPO.getId().toString()).build().getIds());
addDisableIds(disableIds, childCompPOS);
}
}
}

View File

@ -10,6 +10,7 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrm.entity.RuleCodeType;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.bo.DepartmentBO;
@ -23,16 +24,14 @@ import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.service.DepartmentService;
import com.engine.organization.service.ExtService;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.*;
import com.engine.organization.util.coderule.CodeRuleUtil;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.page.Column;
@ -40,6 +39,7 @@ import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
import com.engine.organization.util.tree.SearchTreeUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.hrm.User;
@ -104,7 +104,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
public PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param) {
//1.查询分部下所有部门
//PageUtil.start(param.getCurrent(), param.getPageSize());
List<DepartmentPO> departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).list();
List<DepartmentPO> departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).list("show_order");
PageInfo<DepartmentPO> pageInfo = new PageInfo<>(departmentPOS);
List<SingleDeptTreeVO> singleDeptTreeVOS = DepartmentBO.buildSingleDeptTreeVOS(departmentPOS, param.getParentComp());
PageInfo<SingleDeptTreeVO> pageInfos = new PageInfo<>(singleDeptTreeVOS, SingleDeptTreeVO.class);
@ -148,11 +148,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(param, user.getUID());
boolean filter = isFilter(departmentPO);
PageInfo<DepartmentListDTO> pageInfos;
List<DepartmentPO> allList = getDepartmentMapper().list();
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
List<DepartmentPO> allList = getDepartmentMapper().list(orderSql);
// 通过子级遍历父级元素
if (filter) {
// 根据条件获取元素
List<DepartmentPO> filterDeptPOs = getDepartmentMapper().listByFilter(departmentPO);
List<DepartmentPO> filterDeptPOs = getDepartmentMapper().listByFilter(departmentPO, orderSql);
// 添加父级元素
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList, filterDeptPOs);
List<DepartmentListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS);
@ -185,13 +186,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
}
@Override
public int saveBaseForm(Map<String, Object> params) {
public Long saveBaseForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
String deptNo = (String) params.get("dept_no");
deptNo = CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptNo);
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(deptNo));
OrganizationAssert.isEmpty(list, "编号不允许重复");
// 判断是否开启自动编号
deptNo = repeatDetermine(deptNo);
params.put("dept_no", deptNo);
if (StringUtils.isBlank((String) params.get("show_order"))) {
int maxShowOrder = getDepartmentMapper().getMaxShowOrder();
params.put("show_order", maxShowOrder + 1);
}
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", null);
}
@ -204,22 +208,28 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
}
@Override
public int updateForm(Map<String, Object> params) {
public Long updateForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class);
String groupId = (String) params.get("viewCondition");
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
int updateCount = 0;
String oldDeptNo = getDepartmentMapper().getDeptById(searchParam.getId()).getDeptNo();
String deptNo = searchParam.getDeptNo();
if (!oldDeptNo.equals(deptNo)) {
deptNo = repeatDetermine(deptNo);
params.put("dept_no", deptNo);
}
// 更新主表数据
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId());
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId());
// 更新主表拓展表
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId());
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId());
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
return updateCount;
return searchParam.getId();
}
@Override
@ -296,7 +306,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_DEPT : JCL_ORG_DEPTEXT, viewAttr, id, extendTitle.getId().toString(), "dept_no")));
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_DEPT : JCL_ORG_DEPTEXT, viewAttr, id, extendTitle.getId().toString(), "");
if (CollectionUtils.isNotEmpty(items)) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
}
}
}
@ -324,7 +338,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendTitle.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue())));
List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendTitle.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue());
if (CollectionUtils.isNotEmpty(items)) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
}
}
}
apiDatas.put("condition", addGroups);
@ -365,23 +382,19 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
OrganizationAssert.notBlank(copyParam.getCompany(), "请指定需要复制的公司/分部");
int insertCount = 0;
List<Long> idList = Arrays.stream(copyParam.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
for (Long id : idList) {
DepartmentPO deptById = getDepartmentMapper().getDeptById(id);
int maxShowOrder = getDepartmentMapper().getMaxShowOrder();
for (int i = 0; i < idList.size(); i++) {
DepartmentPO deptById = getDepartmentMapper().getDeptById(idList.get(i));
// 处理自动编号
deptById.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptById.getDeptNo(), true));
deptById.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptById.getDeptNo(), false));
deptById.setParentComp(Long.parseLong(copyParam.getCompany()));
// 显示顺序字段
deptById.setShowOrder(maxShowOrder + i + 1);
insertCount += getDepartmentMapper().insertIgnoreNull(deptById);
if ("1".equals(copyParam.getCopyJob())) {
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listJobsByDepartmentId(id);
for (JobPO jobPO : jobPOS) {
// 处理自动编号
jobPO.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobPO.getJobNo(), true));
jobPO.setParentDept(deptById.getId());
jobPO.setCreator((long) user.getUID());
jobPO.setCreateTime(new Date());
jobPO.setParentComp(deptById.getParentComp());
insertCount += MapperProxyFactory.getProxy(JobMapper.class).insertIgnoreNull(jobPO);
}
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listJobsByDepartmentId(idList.get(i));
int maxJobOrder = MapperProxyFactory.getProxy(JobMapper.class).getMaxShowOrder();
recursionCopyJob((long) user.getUID(), jobPOS, deptById.getParentComp(), deptById.getId(), maxJobOrder);
}
}
return insertCount;
@ -395,7 +408,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
deptBrowserItem.setRules("required|string");
SearchConditionItem mergeNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "合并后名称", "mergeName");
mergeNameItem.setRules("required|string");
String departmentName = getDepartmentMapper().getDeptNameById(id.intValue());
String departmentName = getDepartmentMapper().getDeptNameById(id);
mergeNameItem.setValue(departmentName);
condition.add(deptBrowserItem);
@ -411,18 +424,22 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
OrganizationAssert.isFalse(mergeParam.getId().equals(mergeParam.getDepartment()), "所选部门与待合并部门一致,无需操作");
OrganizationAssert.notNull(mergeParam.getDepartment(), "请选择需要合并的部门");
OrganizationAssert.notBlank(mergeParam.getMergeName(), "请输入合并后的名称");
// 合并到的部门
DepartmentPO targetDepartment = getDepartmentMapper().getDeptById(mergeParam.getDepartment());
Long parentComp = targetDepartment.getParentComp();
// 所选部门
DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
mergeDepartment.setDeptName(mergeParam.getMergeName());
mergeDepartment.setDeptNameShort(mergeParam.getMergeName());
mergeDepartment.setParentDept(mergeParam.getDepartment());
mergeDepartment.setParentComp(parentComp);
// 禁用
mergeDepartment.setForbiddenTag(1);
updateCount += getDepartmentMapper().updateBaseDept(mergeDepartment);
// 合并后部门及子部门禁用
Set<Long> ids = new HashSet<>();
ids.add(mergeParam.getId());
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
forbiddenChildTag(deptList, ids);
updateCount += getDepartmentMapper().forbiddenDepartmentByIds(ids);
forbiddenChildTag(parentComp, deptList);
return updateCount;
}
@ -430,12 +447,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
public List<SearchConditionGroup> getMoveForm() {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> condition = new ArrayList<>();
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择公司/分部", "161", "company", "compBrowser");
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择部门", "161", "department", "deptBrowser");
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择分部", "161", "company", "compBrowser");
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择部门", "161", "department", "deptBrowser");
List<SearchConditionOption> selectOptions = new ArrayList<>();
SearchConditionOption compOption = new SearchConditionOption("0", "公司/分部");
SearchConditionOption compOption = new SearchConditionOption("0", "分部");
SearchConditionOption deptOption = new SearchConditionOption("1", "部门");
selectOptions.add(compOption);
selectOptions.add(deptOption);
@ -458,7 +475,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 0公司/分部 1部门
if ("0".equals(moveParam.getMoveType())) {
Long company = moveParam.getCompany();
OrganizationAssert.notNull(company, "请选择要转移到的公司/分部");
OrganizationAssert.notNull(company, "请选择要转移到的分部");
deptById.setParentComp(company);
deptById.setParentDept(null);
} else if ("1".equals(moveParam.getMoveType())) {
@ -473,15 +490,17 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
/**
* 获取所有子部门id
*
* @param parentComp
* @param deptList
* @param ids
*/
void forbiddenChildTag(List<DepartmentPO> deptList, Set<Long> ids) {
void forbiddenChildTag(Long parentComp, List<DepartmentPO> deptList) {
if (CollectionUtils.isNotEmpty(deptList)) {
for (DepartmentPO departmentPO : deptList) {
ids.add(departmentPO.getId());
departmentPO.setParentComp(parentComp);
departmentPO.setForbiddenTag(1);
getDepartmentMapper().updateBaseDept(departmentPO);
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(departmentPO.getId());
forbiddenChildTag(childList, ids);
forbiddenChildTag(parentComp, childList);
}
}
}
@ -508,7 +527,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 查询部门信息
Long parentCompId = StringUtil.isEmpty(id) ? null : Long.parseLong(id);
CompPO compBuild = CompPO.builder().compName(keyword).parentCompany(parentCompId).build();
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild);
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
Set<CompPO> builderComps = new HashSet<>();
for (CompPO compPO : filterComps) {
@ -535,4 +554,65 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
}
}
/**
* 判断编号是否重复
*
* @return
*/
private String repeatDetermine(String deptNo) {
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.DEPARTMENT.getValue());
if (StringUtils.isNotBlank(deptNo)) {
deptNo = CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptNo);
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(deptNo));
OrganizationAssert.isEmpty(list, "编号不允许重复");
} else {
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
deptNo = autoCreateCompanyNo();
}
}
return deptNo;
}
/**
* 自动编号处理
*
* @return
*/
private String autoCreateCompanyNo() {
String generateCode = CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, "");
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(generateCode));
if (CollectionUtils.isNotEmpty(list)) {
generateCode = autoCreateCompanyNo();
}
return generateCode;
}
/**
* 递归复制岗位信息
*
* @param creator
* @param jobPOS
* @param parentCompId
* @param parentDeptId
* @param orderNum
*/
private void recursionCopyJob(Long creator, List<JobPO> jobPOS, Long parentCompId, Long parentDeptId, int orderNum) {
for (JobPO jobPO : jobPOS) {
orderNum++;
// 处理自动编号
jobPO.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobPO.getJobNo(), false));
jobPO.setParentDept(parentDeptId);
jobPO.setCreator(creator);
jobPO.setCreateTime(new Date());
jobPO.setParentComp(parentCompId);
jobPO.setShowOrder(orderNum);
MapperProxyFactory.getProxy(JobMapper.class).insertIgnoreNull(jobPO);
// 处理子级元素
List<JobPO> jobsByPid = MapperProxyFactory.getProxy(JobMapper.class).getJobsByPid(jobPO.getId());
if (CollectionUtils.isNotEmpty(jobsByPid)) {
recursionCopyJob(creator, jobsByPid, parentCompId, parentDeptId, orderNum);
}
}
}
}

View File

@ -6,9 +6,11 @@ import com.engine.organization.entity.TopTab;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.extend.ExtendInfoOperateType;
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
import com.engine.organization.entity.extend.param.ExtendInfoParams;
import com.engine.organization.entity.extend.po.ExtendGroupPO;
import com.engine.organization.entity.extend.po.ExtendInfoPO;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.extend.*;
import com.engine.organization.service.ExtService;
@ -31,13 +33,6 @@ import java.util.stream.Collectors;
public class ExtServiceImpl extends Service implements ExtService {
private static final Integer BROWSER_TYPE = 3;
/**
* 分组类型
* 1分部
* 2部门
* 3岗位
*/
private static final String TYPE_JOB = "3";
private ExtendInfoMapper getExtendInfoMapper() {
return MapperProxyFactory.getProxy(ExtendInfoMapper.class);
@ -71,7 +66,8 @@ public class ExtServiceImpl extends Service implements ExtService {
if (StringUtils.isEmpty(fields)) {
return conditionItems;
}
Map<String, Object> compExtMap = getExtMapper().listExt(tableName, fields, id);
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(tableName).fields(fields).params(null).id(id).build();
Map<String, Object> compExtMap = getExtMapper().listExt(infoParams);
List<String> readOnlyFieldList = Arrays.asList(readOnlyFields);
// 组装拓展页内容
for (ExtendInfoPO extendInfoPO : infoPOList) {
@ -82,9 +78,13 @@ public class ExtServiceImpl extends Service implements ExtService {
item.setViewAttr(1);
} else if (1 == extendInfoPO.getIsrequired()) {
item.setViewAttr(3);
item.setRules("required|string");
item.setRules("required");
}
}
// 分部上级部门添加提示信息
if (1 != viewAttr && ModuleTypeEnum.departmentfielddefined.getValue().toString().equals(groupId) && "parent_dept".equalsIgnoreCase(extendInfoPO.getFieldName())) {
item.setHelpfulTip("请先选择所属分部再选择" + extendInfoPO.getFieldNameDesc());
}
conditionItems.add(item);
}
return conditionItems;
@ -103,9 +103,9 @@ public class ExtServiceImpl extends Service implements ExtService {
item.setFieldcol(16);
if (1 == extendInfoPO.getIsrequired()) {
item.setViewAttr(3);
item.setRules("required|string");
item.setRules("required");
}
if (extendInfoPO.getFieldName().equals(autoNoField)) {
if (StringUtils.isNotBlank(autoNoField) && extendInfoPO.getFieldName().equals(autoNoField)) {
// 判断是否开启自动编号
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(serialType);
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
@ -114,6 +114,10 @@ public class ExtServiceImpl extends Service implements ExtService {
item.setRules("");
}
}
// 分部上级部门添加提示信息
if (ModuleTypeEnum.departmentfielddefined.getValue().toString().equals(groupId) && "parent_dept".equalsIgnoreCase(extendInfoPO.getFieldName())) {
item.setHelpfulTip("请先选择所属分部再选择" + extendInfoPO.getFieldNameDesc());
}
conditionItems.add(item);
}
return conditionItems;
@ -184,41 +188,56 @@ public class ExtServiceImpl extends Service implements ExtService {
}
@Override
public int updateExtForm(User user, String extendType, String tableName, Map<String, Object> params, String groupId, Long id) {
int updateBaseComp;
List<ExtendInfoPO> extInfoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ExtendInfoOperateType.EDIT.getValue());
public Long updateExtForm(User user, String extendType, String tableName, Map<String, Object> params, String groupId, Long id) {
List<ExtendInfoPO> extInfoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, "");
Map<String, Object> map = new HashMap<>();
for (ExtendInfoPO extendInfoPO : extInfoPOList) {
String key = extendInfoPO.getFieldName();
Object value = params.get(extendInfoPO.getFieldName());
if ("int".equals(extendInfoPO.getFieldType()) && StringUtils.isEmpty((String) value)) {
value = null;
// 遍历Map
Map<String, ExtendInfoPO> collect = extInfoPOList.stream().collect(Collectors.toMap(ExtendInfoPO::getFieldName, item -> item));
for (Map.Entry<String, Object> entry : params.entrySet()) {
String key = entry.getKey();
if (collect.containsKey(key)) {
Object value = entry.getValue();
if (null != value && StringUtils.isBlank(value.toString())) {
value = null;
}
if (null == value) {
if ("int".equals(collect.get(key).getFieldType())) {
value = null;
}
// 兼容sqlServer数据库text字段类型
if ("text".equals(collect.get(key).getFieldType())) {
value = "";
}
}
map.put(key, value);
}
map.put(key, value);
}
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(tableName).params(map).id(id).build();
if (null != id) {
// 判断更新还是插入
int count = getExtMapper().countExtById(tableName, id);
int count = getExtMapper().countExtById(infoParams);
if (count > 0) {
map.put("update_time", new Date());
updateBaseComp = getExtMapper().updateExt(tableName, id, map);
getExtMapper().updateExt(infoParams);
} else {
map.put("creator", user.getUID());
map.put("delete_type", 0);
map.put("create_time", new Date());
map.put("update_time", new Date());
map.put("id", id);
updateBaseComp = getExtMapper().insertExt(tableName, map);
getExtMapper().insertExt(infoParams);
}
} else {
map.put("forbidden_tag", 0);
if (!tableName.equals("JCL_ORG_HRMRESOURCE")) {
map.put("forbidden_tag", 0);
}
map.put("creator", user.getUID());
map.put("delete_type", 0);
map.put("create_time", new Date());
map.put("update_time", new Date());
updateBaseComp = getExtMapper().insertExt(tableName, map);
getExtMapper().insertExt(infoParams);
}
return updateBaseComp;
return infoParams.getId();
}
@Override

View File

@ -83,6 +83,11 @@ public class GradeServiceImpl extends Service implements GradeService {
public int updateGrade(GradeSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
GradePO gradePO = GradeDTO.convertParamToPO(param, (long) user.getUID());
String oldGradeNo = getGradeMapper().getGradeByID(gradePO.getId()).getGradeNo();
if (!oldGradeNo.equals(gradePO.getGradeNo())) {
List<GradePO> list = getGradeMapper().listByNo(Util.null2String(param.getGradeNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
}
return getGradeMapper().updateGrade(gradePO);
}
@ -155,7 +160,7 @@ public class GradeServiceImpl extends Service implements GradeService {
levelBrowserItem.setBrowserConditionParam(levelBrowserBean);
// 编辑状态下,编号只读
gradeNoCondition.setViewAttr(1);
// gradeNoCondition.setViewAttr(1);
}
selectItems.add(gradeNoCondition);
@ -205,7 +210,7 @@ public class GradeServiceImpl extends Service implements GradeService {
sqlWhere += " AND t.grade_name " + dbType.like(gradeName);
}
String schemeId = (String) params.get("schemeId");
if (StringUtils.isNotBlank(schemeId)) {
if (StringUtils.isNotBlank(schemeId) && !"-1".equals(schemeId)) {
sqlWhere += " AND t.scheme_id = '" + schemeId + "'";
}
String viewCondition = (String) params.get("viewCondition");

View File

@ -0,0 +1,438 @@
package com.engine.organization.service.impl;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.bo.DepartmentBO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
import com.engine.organization.entity.job.bo.JobBO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.service.ExtService;
import com.engine.organization.service.HrmResourceService;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.tree.SearchTreeUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.hrm.User;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2022/06/20
* @version: 1.0
*/
public class HrmResourceServiceImpl extends Service implements HrmResourceService {
/**
* 左侧树 类型表示
* <p>
* 0集团
* 1分部
* 2部门
* 3岗位
*/
private static final String TYPE_COMP = "1";
private static final String TYPE_DEPT = "2";
private static final String TYPE_JOB = "3";
private static final Long GROUP_ID = 4L;
/**
* 分组类型
* 1分部
* 2部门
* 3岗位
* 4人员
*/
private static final String EXTEND_TYPE = "4";
/**
* 主表表名
*/
private static final String JCL_ORG_HRM = "JCL_ORG_HRMRESOURCE";
/**
* 主表拓展表
*/
private static final String JCL_ORG_HRMEXT = "JCL_ORG_HRMRESOURCEEXT";
/**
* 明细表拓展表
*/
private static final String JCL_ORG_HRMEXT_DT1 = "JCL_ORG_HRMRESOURCEEXT_DT1";
private DepartmentMapper getDepartmentMapper() {
return MapperProxyFactory.getProxy(DepartmentMapper.class);
}
private CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
private JobMapper getJobMapper() {
return MapperProxyFactory.getProxy(JobMapper.class);
}
private ExtendTitleMapper getExtendTitleMapper() {
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
}
private ExtService getExtService(User user) {
return ServiceUtil.getService(ExtServiceImpl.class, user);
}
@Override
public Map<String, Object> getSearchTree(SearchTreeParams params) {
String keyword = params.getKeyword();
String id = params.getId();
String type = Util.null2String(params.getType());
List<SearchTree> treeList = getFilterCompany(id, type, keyword);
return SearchTreeUtil.getSearchTree(type, treeList);
}
@Override
public Map<String, Object> listPage(HrmResourceSearchParam params) {
Map<String, Object> resultMap = new HashMap<>();
OrganizationWeaTable<HrmResourceVO> table = new OrganizationWeaTable<>(user, HrmResourceVO.class);
String sqlWhere = buildSqlWhere(params);
table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
resultMap.putAll(result.getResultMap());
return resultMap;
}
@Override
public Map<String, Object> getSaveForm() {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_HRM, 2, extendTitle.getId() + "", null, null)));
}
}
apiDatas.put("condition", addGroups);
return apiDatas;
}
@Override
public Long saveBaseForm(Map<String, Object> params) {
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null);
}
@Override
public Map<String, Object> getBaseForm(Map<String, Object> params) {
OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
// 2编辑 1查看
int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
long id = Long.parseLong((String) params.get("id"));
String groupId = (String) params.get("viewCondition");
HashMap<String, Object> buttonsMap = new HashMap<>();
buttonsMap.put("hasEdit", true);
buttonsMap.put("hasSave", true);
List<SearchConditionGroup> addGroups = new ArrayList<>();
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_HRM : JCL_ORG_HRMEXT, viewAttr, id, extendTitle.getId() + "", "")));
}
}
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("buttons", buttonsMap);
resultMap.put("conditions", addGroups);
resultMap.put("id", id);
// 拓展页面分组
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_HRMEXT));
// 处理明细表
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_HRMEXT_DT1, id, viewAttr, false));
Map<String, Object> apiDatas = new HashMap<>();
apiDatas.put("result", resultMap);
return apiDatas;
}
@Override
public int updateForm(Map<String, Object> params) {
Long id = Long.parseLong((String) params.get("id"));
String groupId = (String) params.get("viewCondition");
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
int updateCount = 0;
// 更新主表数据
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", id);
// 更新主表拓展表
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, groupId, id);
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_HRMEXT_DT1, params, id);
return updateCount;
}
@Override
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = new ArrayList<>();
SearchConditionItem lastNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "姓名", "lastName");
SearchConditionItem managerIdItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "直接上级", "managerId");
SearchConditionItem companyIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "companyId", "compBrowser");
SearchConditionItem departmentIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "161", "departmentId", "deptBrowser");
SearchConditionItem telephoneItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "办公电话", "telephone");
SearchConditionItem mobileItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "移动电话", "mobile");
SearchConditionItem mobileCallItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "其他电话", "mobileCall");
SearchConditionItem jobTitleItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "161", "jobTitle", "jobBrowser");
conditionItems.add(lastNameItem);
conditionItems.add(managerIdItem);
conditionItems.add(companyIdItem);
conditionItems.add(departmentIdItem);
conditionItems.add(telephoneItem);
conditionItems.add(mobileItem);
conditionItems.add(mobileCallItem);
conditionItems.add(jobTitleItem);
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
apiDatas.put("conditions", addGroups);
return apiDatas;
}
@Override
public Map<String, Object> getHasRight() {
Map<String, Object> btnDatas = new HashMap<>();
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建人员").type("BTN_Addnew").build());
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("import").menuIcon("icon-coms-leading-in").menuName("导入人员").type("BTN_Import").build());
btnDatas.put("topMenu", topMenuList);
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新建人员").type("BTN_Addnew").build());
rightMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("import").menuIcon("icon-coms-leading-in").menuName("导入人员").type("BTN_Import").build());
btnDatas.put("rightMenu", rightMenuList);
return btnDatas;
}
/**
* 查询条件
*
* @param params
* @return
*/
private String buildSqlWhere(HrmResourceSearchParam params) {
DBType dbType = DBType.get(new RecordSet().getDBType());
String sqlWhere = " where t.delete_type ='0' ";
String lastName = params.getLastName();
if (StringUtils.isNotBlank(lastName)) {
sqlWhere += " AND t.last_name " + dbType.like(lastName);
}
Long managerId = params.getManagerId();
if (null != managerId) {
sqlWhere += " AND t.manager_id = '" + managerId + "'";
}
Long companyId = params.getCompanyId();
if (null != companyId) {
sqlWhere += " AND t.company_id = '" + companyId + "'";
}
Long departmentId = params.getDepartmentId();
if (null != departmentId) {
sqlWhere += " AND t.department_id = '" + departmentId + "'";
}
String telephone = params.getTelephone();
if (StringUtils.isNotBlank(telephone)) {
sqlWhere += " AND t.telephone " + dbType.like(telephone);
}
String mobile = params.getMobile();
if (StringUtils.isNotBlank(mobile)) {
sqlWhere += " AND t.mobile " + dbType.like(mobile);
}
String mobileCall = params.getMobileCall();
if (StringUtils.isNotBlank(mobileCall)) {
sqlWhere += " AND t.mobile_call " + dbType.like(mobileCall);
}
Long jobTitle = params.getJobTitle();
if (null != jobTitle) {
sqlWhere += " AND t.job_title = '" + jobTitle + "'";
}
return sqlWhere;
}
public List<SearchTree> getFilterCompany(String id, String type, String keyword) {
List<SearchTree> searchTree = new ArrayList<>();
// 通过分部公司 组装数据
if (StringUtil.isEmpty(id) || TYPE_COMP.equals(type)) {
Long parentCompId = StringUtil.isEmpty(id) ? null : Long.parseLong(id);
DepartmentPO departmentBuild = DepartmentPO.builder().deptName(keyword).parentComp(parentCompId).build();
CompPO compBuild = CompPO.builder().compName(keyword).parentCompany(parentCompId).build();
// 所属分部下的岗位
JobPO jobBuild = JobPO.builder().jobName(keyword).parentComp(parentCompId).build();
searchTree = buildTreeByCompAndDept(departmentBuild, compBuild, jobBuild);
} else if (TYPE_DEPT.equals(type)) {
Long parentDeptId = Long.parseLong(id);
DepartmentPO departmentBuild = DepartmentPO.builder().deptName(keyword).parentDept(parentDeptId).build();
// 所属分部下的岗位
JobPO jobBuild = JobPO.builder().jobName(keyword).parentDept(parentDeptId).build();
searchTree = buildTreeByDeptAndJob(departmentBuild, jobBuild);
} else if (TYPE_JOB.equals(type)) {
// 查询部门信息
List<JobPO> filterDeparts = getJobMapper().listPOsByFilter(JobPO.builder().jobName(keyword).parentJob(Long.parseLong(id)).build());
Set<JobPO> builderJobs = new HashSet<>();
for (JobPO departmentPO : filterDeparts) {
buildParentJobs(departmentPO, builderJobs);
}
searchTree = SearchTreeUtil.builderTreeMode(JobBO.buildSetToSearchTree(builderJobs));
}
return searchTree;
}
/**
* 分部部门 组装左侧树
*
* @param departmentBuild
* @param compBuild
* @param jobBuild
* @return
*/
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild, JobPO jobBuild) {
List<JobPO> jobPOS = getJobMapper().listPOsByFilter(jobBuild);
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
// 添加父级岗位
Set<JobPO> builderJobs = new HashSet<>();
for (JobPO jobPO : jobPOS) {
buildParentJobs(jobPO, builderJobs);
}
// 添加岗位的上级部门或分部
List<SearchTree> jobTrees = SearchTreeUtil.builderTreeMode(JobBO.buildSetToSearchTree(builderJobs));
String parentDeptS = jobTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
if (!StringUtil.isEmpty(parentDeptS)) {
List<DepartmentPO> compsByIds = getDepartmentMapper().getDeptsByIds(DeleteParam.builder().ids(parentDeptS).build().getIds());
if (CollectionUtils.isNotEmpty(compsByIds)) {
filterDeparts.addAll(compsByIds);
}
}
// 查询分部信息
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts);
}
List<SearchTree> deptTrees = SearchTreeUtil.builderTreeMode(DepartmentBO.buildSetToSearchTree(builderDeparts, false));
// 添加部门的上级分部
String parentCompS = deptTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
if (!StringUtil.isEmpty(parentCompS)) {
List<CompPO> compsByIds = getCompMapper().getCompsByIds(DeleteParam.builder().ids(parentCompS).build().getIds());
if (CollectionUtils.isNotEmpty(compsByIds)) {
filterComps.addAll(compsByIds);
}
}
Set<CompPO> builderComps = new HashSet<>();
for (CompPO compPO : filterComps) {
buildParentComps(compPO, builderComps);
}
List<SearchTree> searchTrees = SearchTreeUtil.builderTreeMode(deptTrees, jobTrees);
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), searchTrees);
}
private List<SearchTree> buildTreeByDeptAndJob(DepartmentPO departmentBuild, JobPO jobBuild) {
List<JobPO> jobPOS = getJobMapper().listPOsByFilter(jobBuild);
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
// 添加父级岗位
Set<JobPO> builderJobs = new HashSet<>();
for (JobPO jobPO : jobPOS) {
buildParentJobs(jobPO, builderJobs);
}
// 添加岗位的上级部门或分部
List<SearchTree> jobTrees = SearchTreeUtil.builderTreeMode(JobBO.buildSetToSearchTree(builderJobs));
String parentDeptS = jobTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
if (!StringUtil.isEmpty(parentDeptS)) {
List<DepartmentPO> compsByIds = getDepartmentMapper().getDeptsByIds(DeleteParam.builder().ids(parentDeptS).build().getIds());
if (CollectionUtils.isNotEmpty(compsByIds)) {
filterDeparts.addAll(compsByIds);
}
}
// 查询分部信息
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts);
}
return SearchTreeUtil.builderTreeMode(DepartmentBO.buildSetToSearchTree(builderDeparts, false), jobTrees);
}
private void buildParentJobs(JobPO jobPO, Set<JobPO> builderJobs) {
builderJobs.add(jobPO);
if (SearchTreeUtil.isTop(jobPO.getParentJob())) {
return;
}
JobPO parentJob = getJobMapper().getJobById(jobPO.getParentJob());
if (null != parentJob) {
buildParentJobs(parentJob, builderJobs);
}
}
/**
* 添加查询元素的父级元素
*
* @param departmentPO
* @param builderDeparts
*/
private void buildParentDepts(DepartmentPO departmentPO, Set<DepartmentPO> builderDeparts) {
builderDeparts.add(departmentPO);
if (SearchTreeUtil.isTop(departmentPO.getParentDept())) {
return;
}
DepartmentPO parentDept = getDepartmentMapper().getDeptById(departmentPO.getParentDept());
if (null != parentDept) {
buildParentDepts(parentDept, builderDeparts);
}
}
/**
* 添加查询元素的父级元素
*
* @param compPO
* @param builderComps
*/
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps) {
builderComps.add(compPO);
if (SearchTreeUtil.isTop(compPO.getParentCompany())) {
return;
}
CompPO parentComp = getCompMapper().listById(compPO.getParentCompany());
if (null != parentComp) {
buildParentComps(parentComp, builderComps);
}
}
}

View File

@ -11,6 +11,7 @@ import com.engine.core.impl.Service;
import com.engine.hrm.entity.RuleCodeType;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.bo.DepartmentBO;
@ -21,12 +22,14 @@ import com.engine.organization.entity.extend.po.ExtendInfoPO;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.entity.job.bo.JobBO;
import com.engine.organization.entity.job.dto.JobListDTO;
import com.engine.organization.entity.job.param.JobMergeParam;
import com.engine.organization.entity.job.param.JobSearchParam;
import com.engine.organization.entity.job.po.JobDTPO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.scheme.po.GradePO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
@ -36,10 +39,7 @@ import com.engine.organization.mapper.scheme.GradeMapper;
import com.engine.organization.mapper.scheme.LevelMapper;
import com.engine.organization.service.ExtService;
import com.engine.organization.service.JobService;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.*;
import com.engine.organization.util.coderule.CodeRuleUtil;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.page.Column;
@ -47,6 +47,7 @@ import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
import com.engine.organization.util.tree.SearchTreeUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.hrm.User;
@ -144,11 +145,12 @@ public class JobServiceImpl extends Service implements JobService {
JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID());
boolean filter = isFilter(jobPO);
PageInfo<JobListDTO> pageInfos;
List<JobListDTO> allList = getJobMapper().listNoFilter();
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
// 通过子级遍历父级元素
if (filter) {
// 根据条件获取元素
List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO);
List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO, orderSql);
// 添加父级元素
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
@ -254,7 +256,10 @@ public class JobServiceImpl extends Service implements JobService {
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendTitle.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue())));
List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendTitle.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue());
if (CollectionUtils.isNotEmpty(items)) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
}
}
}
apiDatas.put("condition", addGroups);
@ -281,7 +286,10 @@ public class JobServiceImpl extends Service implements JobService {
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_JOB : JCL_ORG_JOBEXT, viewAttr, id, extendTitle.getId().toString(), "job_no")));
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_JOB : JCL_ORG_JOBEXT, viewAttr, id, extendTitle.getId().toString(), "");
if (CollectionUtils.isNotEmpty(items)) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
}
}
}
HashMap<String, Object> resultMap = new HashMap<>();
@ -291,7 +299,7 @@ public class JobServiceImpl extends Service implements JobService {
// 拓展页面分组
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_JOBEXT));
// 处理明细表
List<Map<String, Object>> extendTables = getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId),JCL_ORG_JOBEXT_DT1, id, viewAttr, false);
List<Map<String, Object>> extendTables = getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_JOBEXT_DT1, id, viewAttr, false);
Map<String, Object> tableMap = new HashMap<>();
tableMap.put("hide", false);
@ -320,36 +328,38 @@ public class JobServiceImpl extends Service implements JobService {
}
@Override
public int saveBaseForm(Map<String, Object> params) {
public Long saveBaseForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
String jobNo = (String) params.get("job_no");
// 判断是否开启自动编号
jobNo = repeatDetermine(jobNo);
params.put("job_no", jobNo);
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
// 处理自动编号
searchParam.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, searchParam.getJobNo()));
List<JobPO> list = getJobMapper().listByNo(Util.null2String(searchParam.getJobNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
JobPO jobPO = JobBO.convertParamsToPO(searchParam, user.getUID());
jobPO.setIsKey(null == jobPO.getIsKey() ? 0 : jobPO.getIsKey());
int insertCount = getJobMapper().insertIgnoreNull(jobPO);
params.put("job_no", jobPO.getJobNo());
params.put("is_key", jobPO.getIsKey());
params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(searchParam.getParentDept());
params.put("parent_comp", departmentPO.getParentComp());
if (StringUtils.isBlank(params.get("show_order").toString())) {
int maxShowOrder = getJobMapper().getMaxShowOrder();
params.put("show_order", maxShowOrder + 1);
}
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", jobPO.getId());
if (null != jobPO.getSchemeId()) {
Long jobId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
if (null != searchParam.getSchemeId()) {
// 插入明细表信息
// 根据等级方案查询职等职级
List<GradePO> gradePOS = MapperProxyFactory.getProxy(GradeMapper.class).listGradesBySchemeId(jobPO.getSchemeId());
List<GradePO> gradePOS = MapperProxyFactory.getProxy(GradeMapper.class).listGradesBySchemeId(searchParam.getSchemeId());
for (GradePO gradePO : gradePOS) {
List<Map<String, Object>> maps = MapperProxyFactory.getProxy(LevelMapper.class).listLevelsByIds(DeleteParam.builder().ids(gradePO.getLevelId()).build().getIds());
String levelNames = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
insertCount += getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(gradePO.getLevelId()).gradeId(gradePO.getId() + "").levelIdspan(levelNames).gradeIdspan(gradePO.getGradeName()).mainId(jobPO.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build());
getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(gradePO.getLevelId()).gradeId(gradePO.getId() + "").levelIdspan(levelNames).gradeIdspan(gradePO.getGradeName()).mainId(jobId).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build());
}
}
return insertCount;
return jobId;
}
@Override
public int updateForm(Map<String, Object> params) {
public Long updateForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
String groupId = (String) params.get("viewCondition");
@ -357,13 +367,21 @@ public class JobServiceImpl extends Service implements JobService {
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
int updateCount = 0;
String oldJobNo = getJobMapper().getJobById(searchParam.getId()).getJobNo();
String jobNo = searchParam.getJobNo();
if (!oldJobNo.equals(jobNo)) {
jobNo = repeatDetermine(jobNo);
params.put("job_no", jobNo);
}
// 更新主表数据
params.put("is_key", searchParam.getIsKey());
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(searchParam.getParentDept());
params.put("parent_comp", departmentPO.getParentComp());
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
// 更新主表拓展表
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
// 更新明细表
getJobDTMapper().deleteByIds(searchParam.getId());
int rowNum = Util.getIntValue((String) params.get("rownum"));
@ -375,7 +393,7 @@ public class JobServiceImpl extends Service implements JobService {
getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(levelId).gradeId(gradeId).levelIdspan(levelIdspan).gradeIdspan(gradeIdspan).mainId(searchParam.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build());
}
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, searchParam.getId());
return updateCount;
return searchParam.getId();
}
@Override
@ -384,11 +402,14 @@ public class JobServiceImpl extends Service implements JobService {
OrganizationAssert.notBlank(department, "请指定需要复制的部门");
int insertCount = 0;
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
int orderNum = getJobMapper().getMaxShowOrder();
for (Long id : idList) {
orderNum++;
JobPO jobById = getJobMapper().getJobById(id);
// 处理自动编号
jobById.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobById.getJobNo(), true));
jobById.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobById.getJobNo(), false));
jobById.setParentDept(Long.parseLong(department));
jobById.setShowOrder(orderNum);
insertCount += getJobMapper().insertIgnoreNull(jobById);
}
@ -406,10 +427,7 @@ public class JobServiceImpl extends Service implements JobService {
public int deleteByIds(Collection<Long> ids) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
Collection<Long> deleteIds = new ArrayList<>();
// 递归删除子节点
getChildIds(ids, deleteIds);
return getJobMapper().deleteByIds(deleteIds);
return getJobMapper().deleteByIds(ids);
}
@Override
@ -421,6 +439,48 @@ public class JobServiceImpl extends Service implements JobService {
return result.getResultMap();
}
@Override
public List<SearchConditionGroup> getMergeForm() {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> condition = new ArrayList<>();
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到岗位", "161", "targetJob", "jobBrowser");
deptBrowserItem.setRules("required");
condition.add(deptBrowserItem);
addGroups.add(new SearchConditionGroup("", true, condition));
return addGroups;
}
@Override
public int mergeJob(JobMergeParam mergeParam) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
int updateCount = 0;
OrganizationAssert.notNull(mergeParam.getTargetJob(), "请选择需要合并的部门");
Set<Long> disableIds = new HashSet<>();
disableIds.add(mergeParam.getId());
List<JobPO> jobs = getJobMapper().getJobsByPid(mergeParam.getId());
if (CollectionUtils.isNotEmpty(jobs)) {
addDisableIds(disableIds, jobs);
}
OrganizationAssert.isFalse(disableIds.contains(mergeParam.getTargetJob()), "请勿选择当前岗位本身及其子岗位");
// 合并到的岗位
JobPO targetJob = getJobMapper().getJobById(mergeParam.getTargetJob());
Long parentDept = targetJob.getParentDept();
Long parentComp = targetJob.getParentComp();
// 原岗位禁用
JobPO mergeJob = getJobMapper().getJobById(mergeParam.getId());
mergeJob.setForbiddenTag(1);
updateCount += getJobMapper().updateBaseJob(mergeJob);
//TODO 合并该刚岗位下的人员
// 合并后岗位及子岗位禁用
List<JobPO> jobList = getJobMapper().getJobsByPid(mergeParam.getId());
forbiddenChildTag(parentComp, parentDept, targetJob.getId(), jobList);
return updateCount;
}
/**
* 添加查询元素的父级元素
*
@ -474,7 +534,7 @@ public class JobServiceImpl extends Service implements JobService {
} else if (TYPE_DEPT.equals(type)) {
//
// 查询部门信息
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(DepartmentPO.builder().deptName(keyword).parentDept(Long.parseLong(id)).build());
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(DepartmentPO.builder().deptName(keyword).parentDept(Long.parseLong(id)).build(), "show_order");
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts);
@ -493,9 +553,9 @@ public class JobServiceImpl extends Service implements JobService {
* @return
*/
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) {
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild);
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
// 查询分部信息
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild);
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts);
@ -539,16 +599,70 @@ public class JobServiceImpl extends Service implements JobService {
}
/**
* 获取待删除数据的子级元素
* 判断编号是否重复
*
* @param ids
* @param deleteIds
* @return
*/
private void getChildIds(Collection<Long> ids, Collection<Long> deleteIds) {
for (Long id : ids) {
deleteIds.add(id);
Collection<Long> childIds = getJobMapper().getJobsByPid(id).stream().map(JobPO::getId).collect(Collectors.toList());
getChildIds(childIds, deleteIds);
private String repeatDetermine(String jobNo) {
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.JOBTITLES.getValue());
if (StringUtils.isNotBlank(jobNo)) {
jobNo = CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobNo);
List<JobPO> list = getJobMapper().listByNo(Util.null2String(jobNo));
OrganizationAssert.isEmpty(list, "编号不允许重复");
} else {
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
jobNo = autoCreateCompanyNo();
}
}
return jobNo;
}
/**
* 自动编号处理
*
* @return
*/
private String autoCreateCompanyNo() {
String generateCode = CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, "");
List<JobPO> list = getJobMapper().listByNo(Util.null2String(generateCode));
if (CollectionUtils.isNotEmpty(list)) {
generateCode = autoCreateCompanyNo();
}
return generateCode;
}
/**
* 获取所有子部门id
*
* @param parentComp
* @param parentDept
* @param jobList
*/
void forbiddenChildTag(Long parentComp, Long parentDept, Long parentJob, List<JobPO> jobList) {
if (CollectionUtils.isNotEmpty(jobList)) {
for (JobPO job : jobList) {
job.setParentComp(parentComp);
job.setParentDept(parentDept);
job.setParentJob(parentJob);
job.setForbiddenTag(1);
getJobMapper().updateBaseJob(job);
List<JobPO> childJobs = getJobMapper().getJobsByPid(job.getId());
forbiddenChildTag(parentComp, parentDept, job.getId(), childJobs);
}
}
}
/**
* 添加子元素ID
*
* @param disableIds
* @param jobPOS
*/
private void addDisableIds(Set<Long> disableIds, List<JobPO> jobPOS) {
for (JobPO jobPO : jobPOS) {
disableIds.add(jobPO.getId());
List<JobPO> jobsByPid = getJobMapper().getJobsByPid(jobPO.getId());
addDisableIds(disableIds, jobsByPid);
}
}

View File

@ -8,6 +8,7 @@ import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.TopTab;
import com.engine.organization.entity.TreeData;
import com.engine.organization.entity.scheme.dto.LevelDTO;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.entity.scheme.po.LevelPO;
@ -78,6 +79,12 @@ public class LevelServiceImpl extends Service implements LevelService {
public int updateLevel(LevelSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
LevelPO levelPO = LevelDTO.convertParamToPO(param, (long) user.getUID());
// 更新前先查询下旧编号
String oldLevelNo = getLevelMapper().getLevelByID(levelPO.getId()).getLevelNo();
if (!oldLevelNo.equals(levelPO.getLevelNo())) {
List<LevelPO> list = getLevelMapper().listByNo(Util.null2String(levelPO.getLevelNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
}
return getLevelMapper().updateLevel(levelPO);
}
@ -142,7 +149,7 @@ public class LevelServiceImpl extends Service implements LevelService {
browserBean.setReplaceDatas(maps);
browserItem.setBrowserConditionParam(browserBean);
// 编辑状态下,编号只读
levelNoCondition.setViewAttr(1);
// levelNoCondition.setViewAttr(1);
}
selectItems.add(levelNoCondition);
@ -177,6 +184,12 @@ public class LevelServiceImpl extends Service implements LevelService {
return apiDatas;
}
@Override
public TreeData getTreeData() {
ArrayList<TreeData> treeDataList = getLevelMapper().getTreeData();
return TreeData.builder().children(treeDataList).title("职等").key("-1").build();
}
/**
* 查询条件
*
@ -191,7 +204,7 @@ public class LevelServiceImpl extends Service implements LevelService {
sqlWhere += " AND t.level_name " + dbType.like(levelName);
}
String schemeId = (String) params.get("schemeId");
if (StringUtils.isNotBlank(schemeId)) {
if (StringUtils.isNotBlank(schemeId) && !"-1".equals(schemeId)) {
sqlWhere += " AND t.scheme_id = '" + schemeId + "'";
}
String viewCondition = (String) params.get("viewCondition");

View File

@ -78,6 +78,11 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
public int updatePostInfo(PostInfoSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
PostInfoPO postInfoPO = PostInfoDTO.convertParamToPO(param, (long) user.getUID());
String oldPostInfoNo = getPostInfoMapper().getPostInfoByID(postInfoPO.getId()).getPostInfoNo();
if (!oldPostInfoNo.equals(postInfoPO.getPostInfoNo())) {
List<PostInfoPO> list = getPostInfoMapper().listByNo(Util.null2String(postInfoPO.getPostInfoNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
}
return getPostInfoMapper().updatePostInfo(postInfoPO);
}
@ -125,11 +130,11 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
SearchConditionItem nameItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "postInfoName");
nameItem.setRules("required|string");
// 权限
SearchConditionItem authorityItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 2, 50, "权限", "postInfoAuthority");
SearchConditionItem authorityItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "权限", "postInfoAuthority");
// 责任
SearchConditionItem dutyItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 2, 50, "责任", "postInfoDuty");
SearchConditionItem dutyItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "责任", "postInfoDuty");
// 资格
SearchConditionItem qualificationItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 2, 50, "资格", "postInfoQualification");
SearchConditionItem qualificationItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "资格", "postInfoQualification");
// 职务分类
SearchConditionItem postIdBrowser = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "职务分类", "161", "postId", "postBrowser");
postIdBrowser.setRules("required|string");
@ -155,7 +160,7 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
browserBean.setReplaceDatas(maps);
postIdBrowser.setBrowserConditionParam(browserBean);
// 编辑状态下,编号只读
noItem.setViewAttr(1);
// noItem.setViewAttr(1);
}
selectItems.add(noItem);
@ -172,7 +177,25 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
@Override
public Map<String, Object> getHasRight() {
return MenuBtn.getCommonBtnDatas();
Map<String, Object> btnDatas = new HashMap<>();
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
// 新增
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("addPlan").menuIcon("icon-coms-New-Flow").menuName("新增职务分类").type("BTN_AddPlan").build());
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("editPlan").menuIcon("icon-coms-edit").menuName("修改职务分类").type("BTN_EditPlan").build());
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("delPlan").menuIcon("icon-coms-Delete").menuName("删除职务分类").type("BTN_DelPlan").build());
topMenuList.add(MenuBtn.topMenu_addNew());
// 批量删除
topMenuList.add(MenuBtn.topMenu_batchDelete());
btnDatas.put("topMenu", topMenuList);
// 新增
rightMenuList.add(MenuBtn.rightMenu_addNew());
// 日志
rightMenuList.add(MenuBtn.rightMenu_btnLog());
// 显示列定制
rightMenuList.add(MenuBtn.rightMenu_btnColumn());
btnDatas.put("rightMenu", rightMenuList);
return btnDatas;
}

View File

@ -34,8 +34,8 @@ public class PostServiceImpl extends Service implements PostService {
@Override
public int savePost(PostPO postPO) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
List<PostPO> list = getPostMapper().listByNo(Util.null2String(postPO.getPostNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
// List<PostPO> list = getPostMapper().listByNo(Util.null2String(postPO.getPostNo()));
// OrganizationAssert.isEmpty(list, "编号不允许重复");
return getPostMapper().insertIgnoreNull(PostDTO.convertPO(postPO, user.getUID()));
}
@ -60,8 +60,6 @@ public class PostServiceImpl extends Service implements PostService {
List<SearchConditionGroup> addGroups = new ArrayList<>();
SearchConditionItem postNameItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "postName");
postNameItem.setRules("required|string");
SearchConditionItem postNoItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "postNo");
postNoItem.setRules("required|string");
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description");
// 编辑状态下赋值操作
@ -71,12 +69,10 @@ public class PostServiceImpl extends Service implements PostService {
OrganizationAssert.notNull(postPO, "选择的数据不存在,或数据已删除");
postNameItem.setValue(postPO.getPostName());
postNoItem.setValue(postPO.getPostNo());
descriptionItem.setValue(postPO.getDescription());
}
selectItems.add(postNoItem);
selectItems.add(postNameItem);
selectItems.add(descriptionItem);
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
@ -87,7 +83,7 @@ public class PostServiceImpl extends Service implements PostService {
@Override
public TreeData getTreeData() {
ArrayList<TreeData> treeDataList = getPostMapper().getTreeData();
return TreeData.builder().children(treeDataList).title("全部类型").key("-1").build();
return TreeData.builder().children(treeDataList).title("职务分类").key("-1").build();
}

View File

@ -5,6 +5,8 @@ import com.api.browser.bean.SearchConditionItem;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.TreeData;
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
import com.engine.organization.entity.scheme.dto.SchemeDTO;
import com.engine.organization.entity.scheme.param.SchemeSearchParam;
import com.engine.organization.entity.scheme.po.SchemePO;
@ -20,6 +22,7 @@ import weaver.general.StringUtil;
import weaver.general.Util;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author dxfeng
@ -72,6 +75,12 @@ public class SchemeServiceImpl extends Service implements SchemeService {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
Map<String, Object> apidatas = new HashMap<>();
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID());
// 更新前先查询下旧编号
String oldSchemeNo = getSchemeMapper().getSchemeByID(schemePO.getId()).getSchemeNo();
if (!oldSchemeNo.equals(schemePO.getSchemeNo())) {
List<SchemePO> list = getSchemeMapper().listByNo(Util.null2String(schemePO.getSchemeNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
}
getSchemeMapper().updateScheme(schemePO);
return apidatas;
}
@ -129,7 +138,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
textareaItem.setValue(schemePO.getSchemeDescription());
// 编辑状态下,编号只读
schemeNoCondition.setViewAttr(1);
// schemeNoCondition.setViewAttr(1);
}
selectItems.add(schemeNoCondition);
@ -145,6 +154,26 @@ public class SchemeServiceImpl extends Service implements SchemeService {
return MenuBtn.getCommonBtnDatas();
}
@Override
public List<TypeTreeVO> getTreeData() {
ArrayList<TreeData> treeDataList = getSchemeMapper().getTreeData();
TypeTreeVO build = TypeTreeVO.builder()
.childs(treeDataList.stream().map(e ->
TypeTreeVO.builder()
.domid(e.getKey())
.key(Long.parseLong(e.getKey()))
.name(e.getTitle())
.build()).collect(Collectors.toList()))
.haschild(true)
.domid("-1")
.key(-1L)
.name("全部方案").build();
List<TypeTreeVO> typeTreeVOS = new ArrayList<>();
typeTreeVOS.add(build);
return typeTreeVOS;
}
/**
* 查询条件
*

View File

@ -78,6 +78,11 @@ public class SequenceServiceImpl extends Service implements SequenceService {
public int updateSequence(SequenceSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
SequencePO sequencePO = SequenceDTO.convertParamToPO(param, (long) user.getUID());
String oldSequenceNo = getSequenceMapper().getSequenceByID(sequencePO.getId()).getSequenceNo();
if (!oldSequenceNo.equals(sequencePO.getSequenceNo())) {
List<SequencePO> list = getSequenceMapper().listByNo(Util.null2String(sequencePO.getSequenceNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
}
return getSequenceMapper().updateSequence(sequencePO);
}
@ -142,7 +147,7 @@ public class SequenceServiceImpl extends Service implements SequenceService {
browserBean.setReplaceDatas(maps);
browserItem.setBrowserConditionParam(browserBean);
// 编辑状态下,编号只读
sequenceNoCondition.setViewAttr(1);
// sequenceNoCondition.setViewAttr(1);
}
selectItems.add(sequenceNoCondition);

View File

@ -78,6 +78,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
public int updateStaffPlan(StaffPlanSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
// 更新前先查询下旧编号
String oldPlanNo = getStaffPlanMapper().getStaffPlanByID(staffPlanPO.getId()).getPlanNo();
if (!oldPlanNo.equals(staffPlanPO.getPlanNo())) {
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(staffPlanPO.getPlanNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
}
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
}
@ -173,8 +179,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
planNoItem.setValue(staffPlanPO.getPlanNo());
planNameItem.setValue(staffPlanPO.getPlanName());
planYearItem.setValue(staffPlanPO.getPlanYear() + "");
timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(),"yyyy-MM-dd"));
timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(),"yyyy-MM-dd"));
timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(), "yyyy-MM-dd"));
timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(), "yyyy-MM-dd"));
BrowserBean browserBean = companyIdtItem.getBrowserConditionParam();
List<Map<String, Object>> maps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPlanPO.getCompanyId()).build().getIds());
@ -184,7 +190,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
descriptionItem.setValue(staffPlanPO.getDescription());
// 编辑状态下,编号只读
planNoItem.setViewAttr(1);
// planNoItem.setViewAttr(1);
}
selectItems.add(planNoItem);
@ -250,4 +256,5 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
return sqlWhere;
}
}

View File

@ -102,7 +102,7 @@ public class StaffServiceImpl extends Service implements StaffService {
} else {
// 插入明细表数据
StaffsPO staffsPO = StaffsPO.builder().staffId(staffPO.getId()).businessType(2).changeNum(changeNum).businessSource(1).build();
StaffsPO staffsPO = StaffsPO.builder().staffId(staffPO.getId()).businessType(2).changeNum(changeNum).businessSource(1).description(param.getChangeDescription()).build();
MapperProxyFactory.getProxy(StaffsMapper.class).insertIgnoreNull(staffsPO);
// 更新编制表
staffPO.setStaffNum(staffPO.getStaffNum() + changeNum);
@ -127,8 +127,10 @@ public class StaffServiceImpl extends Service implements StaffService {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = new ArrayList<>();
// 方案
SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "方案", "161", "planId", "staffPlanBrowser");
//// 方案
//SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "方案11", "161", "planId", "staffPlanBrowser");
//planIdItem.setHide(true);
//planIdItem.setDisplay("none");
// 分部
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "compId", "compBrowser");
// 部门
@ -155,7 +157,7 @@ public class StaffServiceImpl extends Service implements StaffService {
// 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
conditionItems.add(planIdItem);
//conditionItems.add(planIdItem);
conditionItems.add(compIdItem);
conditionItems.add(deptIdItem);
conditionItems.add(jobIdItem);
@ -252,6 +254,9 @@ public class StaffServiceImpl extends Service implements StaffService {
SearchConditionItem changeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 3, "调整数量", "changeNum");
staffNumItem.setRules("required");
selectItems.add(changeNumItem);
SearchConditionItem changeDescriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, false, 2, 50, "变更说明", "changeDescription");
selectItems.add(changeDescriptionItem);
}
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
@ -261,7 +266,18 @@ public class StaffServiceImpl extends Service implements StaffService {
@Override
public Map<String, Object> getHasRight() {
return MenuBtn.getCommonBtnDatas();
Map<String, Object> datas = MenuBtn.getCommonBtnDatas();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> selectItems = new ArrayList<>();
// 方案
SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 4, 3, 2, false, "编制方案", "161", "planId", "staffPlanBrowser");
planIdItem.setRules("required|string");
planIdItem.setHelpfulTip("请选择编制方案后查看数据");
planIdItem.setLabelcol(2);
selectItems.add(planIdItem);
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
datas.put("condition", addGroups);
return datas;
}
/**
@ -277,6 +293,8 @@ public class StaffServiceImpl extends Service implements StaffService {
Long planId = param.getPlanId();
if (null != planId) {
sqlWhere += " AND t.plan_id = '" + planId + "'";
} else {
sqlWhere = " 1=2 ";
}
Long compId = param.getCompId();
if (null != compId) {

View File

@ -0,0 +1,26 @@
package com.engine.organization.transmethod;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.util.db.MapperProxyFactory;
/**
* @author:dxfeng
* @createTime: 2022/06/21
* @version: 1.0
*/
public class HrmResourceTransMethod {
public static String getDepartmentName(String departmentId) {
return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(Long.parseLong(departmentId));
}
public static String getCompanyName(String companyId) {
return MapperProxyFactory.getProxy(CompMapper.class).listById(Long.parseLong(companyId)).getCompName();
}
public static String getManagerName(String managerId) {
return MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(Long.parseLong(managerId));
}
}

View File

@ -0,0 +1,57 @@
package com.engine.organization.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.CollectionUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author:dxfeng
* @createTime: 2022/06/23
* @version: 1.0
*/
public class PageInfoSortUtil {
/**
* 获取排序SQL规则
*
* @param sortParams
* @return
*/
public static String getSortSql(String sortParams) {
JSONArray jsonArray = JSONObject.parseArray(sortParams);
if (CollectionUtils.isNotEmpty(jsonArray)) {
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
String orderKey = upperCharToUnderLine(jsonObject.getString("orderkey"));
String sortOrder = jsonObject.getString("sortOrder").replace("end", "");
return "t." + orderKey + " " + sortOrder;
}
return " show_order ";
}
/**
* 驼峰转下划线
*
* @param param
* @return
*/
private static String upperCharToUnderLine(String param) {
Pattern p = Pattern.compile("[A-Z]");
if (param == null || param.equals("")) {
return "";
}
StringBuilder builder = new StringBuilder(param);
Matcher mc = p.matcher(param);
int i = 0;
while (mc.find()) {
builder.replace(mc.start() + i, mc.end() + i, "_" + mc.group().toLowerCase());
i++;
}
if ('_' == builder.charAt(0)) {
builder.deleteCharAt(0);
}
return builder.toString();
}
}

View File

@ -14,10 +14,13 @@ public class Column {
String dataIndex;
String key;
boolean display;
String width;
boolean sorter;
public Column(String title, String dataIndex, String key) {
public Column(String title, String dataIndex, String key, String width) {
this.title = title;
this.dataIndex = dataIndex;
this.key = key;
this.width = width;
}
}

View File

@ -40,7 +40,7 @@ public class PageInfo<T> extends com.github.pagehelper.PageInfo<T> {
public List<Column> buildColumns() {
if(clazz==null){
if (clazz == null) {
return this.columns;
}
Field[] fields = clazz.getDeclaredFields();
@ -52,7 +52,9 @@ public class PageInfo<T> extends com.github.pagehelper.PageInfo<T> {
String dataIndex = annotation.dataIndex();
String key = annotation.key();
boolean display = annotation.display();
Column column = Column.builder().title(title).dataIndex(dataIndex).key(key).display(display).build();
String width = annotation.width();
boolean sorter = annotation.sorter();
Column column = Column.builder().sorter(sorter).width(width).title(title).dataIndex(dataIndex).key(key).display(display).build();
columns.add(column);
}
}

View File

@ -4,6 +4,7 @@ import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.CompWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -62,7 +63,7 @@ public class CompController {
@POST
@Path("/saveBaseComp")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody Map<String,Object> params) {
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String, Object> params) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).saveBaseComp(params));
@ -211,4 +212,29 @@ public class CompController {
}
}
@GET
@Path("/getMoveForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getMoveForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).getMoveForm());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
@POST
@Path("/moveCompany")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult moveCompany(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DepartmentMoveParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).moveCompany(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

View File

@ -0,0 +1,190 @@
package com.engine.organization.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.HrmResourceWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
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/06/21
* @version: 1.0
*/
public class HrmResourceController {
public HrmResourceWrapper getHrmResourceWrapper(User user) {
return ServiceUtil.getService(HrmResourceWrapper.class, user);
}
/**
* 左侧树接口
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getSearchTree")
@Produces(MediaType.APPLICATION_JSON)
public Map<String, Object> getSearchTree(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
SearchTreeParams params = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), SearchTreeParams.class);
return getHrmResourceWrapper(user).getSearchTree(params);
}
/**
* 获取list列表
*
* @param request
* @param response
* @return
*/
@GET
@Path("/listPage")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult listPage(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
HrmResourceSearchParam param = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), HrmResourceSearchParam.class);
return ReturnResult.successed(getHrmResourceWrapper(user).listPage(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* 获取新增表单
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getSaveForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getSaveForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getHrmResourceWrapper(user).getSaveForm());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* 新增保存
*
* @param request
* @param response
* @return
*/
@POST
@Path("/saveBaseForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult saveBaseForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String, Object> params) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getHrmResourceWrapper(user).saveBaseForm(params));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* 获取基础表单
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getBaseForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getBaseForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getHrmResourceWrapper(user).getBaseForm(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* 更新表单
*
* @param request
* @param response
* @return
*/
@POST
@Path("/updateForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getHrmResourceWrapper(user).updateForm(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* 高级搜索条件
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getSearchCondition")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getHrmResourceWrapper(user).getSearchCondition(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
/**
* 列表页顶部按钮
*
* @param request
* @param response
* @return
*/
@GET
@Path("/getHasRight")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getHrmResourceWrapper(user).getHasRight());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

View File

@ -6,6 +6,7 @@ import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.job.param.JobCopyParam;
import com.engine.organization.entity.job.param.JobMergeParam;
import com.engine.organization.entity.job.param.JobSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.util.response.ReturnResult;
@ -274,5 +275,28 @@ public class JobController {
}
}
@GET
@Path("/getMergeForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getMergeForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getJobWrapper(user).getMergeForm());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
@POST
@Path("/mergeJob")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult mergeJob(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody JobMergeParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getJobWrapper(user).mergeJob(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

View File

@ -202,4 +202,16 @@ public class LevelController {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
@GET
@Path("/getTreeData")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getTreeData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getLevelWrapper(user).getTreeData());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

View File

@ -177,5 +177,17 @@ public class SchemeController {
}
}
@GET
@Path("/getTreeData")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getTreeData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getSchemeWrapper(user).getTreeData());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
}

View File

@ -1,13 +1,16 @@
package com.engine.organization.wrapper;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.service.CompService;
import com.engine.organization.service.impl.CompServiceImpl;
import weaver.hrm.User;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
@ -38,7 +41,7 @@ public class CompWrapper extends Service {
* @param params
* @return
*/
public int saveBaseComp(Map<String, Object> params) {
public Long saveBaseComp(Map<String, Object> params) {
return getCompService(user).saveBaseComp(params);
}
@ -57,7 +60,7 @@ public class CompWrapper extends Service {
* @param params
* @return
*/
public int updateComp(Map<String, Object> params) {
public Long updateComp(Map<String, Object> params) {
return getCompService(user).updateComp(params);
}
@ -108,4 +111,18 @@ public class CompWrapper extends Service {
return getCompService(user).getCompSaveForm();
}
/**
* 转移分部
*
* @param moveParam
* @return
*/
public int moveCompany(DepartmentMoveParam moveParam) {
return getCompService(user).moveCompany(moveParam);
}
public List<SearchConditionGroup> getMoveForm() {
return getCompService(user).getMoveForm();
}
}

View File

@ -79,7 +79,7 @@ public class DepartmentWrapper extends Service {
* @param params
* @return
*/
public int saveBaseForm(Map<String, Object> params) {
public Long saveBaseForm(Map<String, Object> params) {
return getDepartmentService(user).saveBaseForm(params);
}
@ -99,7 +99,7 @@ public class DepartmentWrapper extends Service {
* @param params
* @return
*/
public int updateForm(Map<String, Object> params) {
public Long updateForm(Map<String, Object> params) {
return getDepartmentService(user).updateForm(params);
}

View File

@ -0,0 +1,55 @@
package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.service.HrmResourceService;
import com.engine.organization.service.impl.HrmResourceServiceImpl;
import weaver.hrm.User;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2022/06/21
* @version: 1.0
*/
public class HrmResourceWrapper extends Service {
private HrmResourceService getHrmResourceService(User user) {
return ServiceUtil.getService(HrmResourceServiceImpl.class, user);
}
public Map<String, Object> getSearchTree(SearchTreeParams params) {
return getHrmResourceService(user).getSearchTree(params);
}
public Map<String, Object> listPage(HrmResourceSearchParam params) {
return getHrmResourceService(user).listPage(params);
}
public Map<String, Object> getSaveForm() {
return getHrmResourceService(user).getSaveForm();
}
public Long saveBaseForm(Map<String, Object> params) {
return getHrmResourceService(user).saveBaseForm(params);
}
public Map<String, Object> getBaseForm(Map<String, Object> params) {
return getHrmResourceService(user).getBaseForm(params);
}
public int updateForm(Map<String, Object> params) {
return getHrmResourceService(user).updateForm(params);
}
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
return getHrmResourceService(user).getSearchCondition(params);
}
public Map<String, Object> getHasRight() {
return getHrmResourceService(user).getHasRight();
}
}

View File

@ -4,6 +4,7 @@ import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.job.param.JobMergeParam;
import com.engine.organization.entity.job.param.JobSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.service.JobService;
@ -89,7 +90,7 @@ public class JobWrapper extends Service {
* @param params
* @return
*/
public int saveBaseForm(Map<String, Object> params) {
public Long saveBaseForm(Map<String, Object> params) {
return getJobService(user).saveBaseForm(params);
}
@ -99,7 +100,7 @@ public class JobWrapper extends Service {
* @param params
* @return
*/
public int updateForm(Map<String, Object> params) {
public Long updateForm(Map<String, Object> params) {
return getJobService(user).updateForm(params);
}
@ -158,4 +159,12 @@ public class JobWrapper extends Service {
Map<String, Object> hrmListByJobId = getJobService(user).getHrmListByJobId(jobId);
return ReturnResult.successed(hrmListByJobId);
}
public List<SearchConditionGroup> getMergeForm() {
return getJobService(user).getMergeForm();
}
public int mergeJob(JobMergeParam mergeParam) {
return getJobService(user).mergeJob(mergeParam);
}
}

View File

@ -2,6 +2,7 @@ package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.TreeData;
import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.service.LevelService;
import com.engine.organization.service.impl.LevelServiceImpl;
@ -108,4 +109,8 @@ public class LevelWrapper extends Service {
public Map<String, Object> getTabInfo() {
return getLevelService(user).getTabInfo();
}
public TreeData getTreeData() {
return getLevelService(user).getTreeData();
}
}

View File

@ -2,6 +2,7 @@ package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
import com.engine.organization.entity.scheme.param.SchemeSearchParam;
import com.engine.organization.service.SchemeService;
import com.engine.organization.service.impl.SchemeServiceImpl;
@ -9,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
import weaver.hrm.User;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
@ -74,6 +76,7 @@ public class SchemeWrapper extends Service {
/**
* 获取搜索条件
*
* @param params
* @return
*/
@ -84,6 +87,7 @@ public class SchemeWrapper extends Service {
/**
* 获取新增表单
*
* @param params
* @return
*/
@ -93,9 +97,14 @@ public class SchemeWrapper extends Service {
/**
* 获取列表页面按钮信息
*
* @return
*/
public Map<String, Object> getTableBtn() {
return getSchemeService(user).getTableBtn();
}
public List<TypeTreeVO> getTreeData() {
return getSchemeService(user).getTreeData();
}
}