!124 生产合并

Merge pull request !124 from reset/develop
pull/152/MERGE
reset 3 years ago committed by Gitee
commit 11d6474e13
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

1
.gitignore vendored

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

@ -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);

@ -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);

@ -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);

@ -105,6 +105,7 @@ CREATE TABLE JCL_ORG_COMP (
comp_principal int null, comp_principal int null,
description text NULL, description text NULL,
forbidden_tag int NULL, forbidden_tag int NULL,
show_order int NULL,
is_used int null, is_used int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
@ -120,6 +121,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
extend_type int null, extend_type int null,
group_name varchar(100) NULL, group_name varchar(100) NULL,
show_order int null, show_order int null,
is_show varchar(100) NULL,
is_system_default int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time date null, create_time date null,
@ -134,6 +137,7 @@ create table JCL_FIELD_EXTENDTITLE (
title varchar(100) null, title varchar(100) null,
show_order int null, show_order int null,
is_show int null, is_show int null,
is_system_default int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time date null, create_time date null,
@ -161,6 +165,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
add_show int null, add_show int null,
browser_show int null, browser_show int null,
show_order int null, show_order int null,
is_system_default int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time date null, create_time date null,
@ -290,6 +295,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id) 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 -- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN ( CREATE TABLE JCL_ORG_STAFFPLAN (
@ -345,4 +408,36 @@ CREATE TABLE JCL_ORG_STAFFS (
create_time date null, create_time date null,
update_time date null, update_time date null,
CONSTRAINT JCL_ORG_STAFFS_PK PRIMARY KEY (id) 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)
); );

@ -107,6 +107,7 @@ CREATE TABLE JCL_ORG_COMP (
COMP_PRINCIPAL NUMBER NULL, COMP_PRINCIPAL NUMBER NULL,
DESCRIPTION NVARCHAR2(1000) NULL, DESCRIPTION NVARCHAR2(1000) NULL,
FORBIDDEN_TAG NUMBER NULL, FORBIDDEN_TAG NUMBER NULL,
SHOW_ORDER NUMBER NULL,
IS_USED NUMBER NULL, IS_USED NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
@ -122,6 +123,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
EXTEND_TYPE NUMBER NULL, EXTEND_TYPE NUMBER NULL,
GROUP_NAME NVARCHAR2(100) NULL, GROUP_NAME NVARCHAR2(100) NULL,
SHOW_ORDER NUMBER null, SHOW_ORDER NUMBER null,
IS_SHOW NVARCHAR2(100) NULL,
IS_SYSTEM_DEFAULT NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL, CREATE_TIME DATE NULL,
@ -136,6 +139,7 @@ CREATE TABLE JCL_FIELD_EXTENDTITLE (
TITLE VARCHAR(100) NULL, TITLE VARCHAR(100) NULL,
SHOW_ORDER NUMBER NULL, SHOW_ORDER NUMBER NULL,
IS_SHOW NUMBER NULL, IS_SHOW NUMBER NULL,
IS_SYSTEM_DEFAULT NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL, CREATE_TIME DATE NULL,
@ -163,6 +167,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
ADD_SHOW NUMBER NULL, ADD_SHOW NUMBER NULL,
BROWSER_SHOW NUMBER NULL, BROWSER_SHOW NUMBER NULL,
SHOW_ORDER NUMBER NULL, SHOW_ORDER NUMBER NULL,
IS_SYSTEM_DEFAULT NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL, CREATE_TIME DATE NULL,
@ -292,6 +297,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (ID) 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 -- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN ( CREATE TABLE JCL_ORG_STAFFPLAN (
ID NUMBER NOT NULL, ID NUMBER NOT NULL,

@ -105,6 +105,7 @@ CREATE TABLE JCL_ORG_COMP (
comp_principal int null, comp_principal int null,
description text COLLATE Chinese_PRC_CI_AS NULL, description text COLLATE Chinese_PRC_CI_AS NULL,
forbidden_tag int NULL, forbidden_tag int NULL,
show_order int null,
is_used int null, is_used int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
@ -120,6 +121,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
extend_type int null, extend_type int null,
group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
show_order int null, show_order int null,
is_show varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
is_system_default int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time datetime null, create_time datetime null,
@ -134,10 +137,11 @@ create table JCL_FIELD_EXTENDTITLE (
title varchar(100) COLLATE Chinese_PRC_CI_AS NULL, title varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
show_order int null, show_order int null,
is_show int null, is_show int null,
is_system_default int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time date null, create_time datetime null,
update_time date null, update_time datetime null,
CONSTRAINT JCL_FIELD_EXTENDTITLE_PK PRIMARY KEY (id) CONSTRAINT JCL_FIELD_EXTENDTITLE_PK PRIMARY KEY (id)
); );
@ -161,6 +165,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
add_show int null, add_show int null,
browser_show int null, browser_show int null,
show_order int null, show_order int null,
is_system_default int null,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time datetime null, create_time datetime null,
@ -290,6 +295,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id) 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 -- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN ( CREATE TABLE JCL_ORG_STAFFPLAN (

@ -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{
}

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

@ -55,6 +55,13 @@ public @interface OrganizationTable {
*/ */
boolean distinct() default false; boolean distinct() default false;
/**
*
* @return
*/
String sortway() default "desc";
/** /**
* *
*/ */

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

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

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

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

@ -1,7 +1,6 @@
package com.engine.organization.entity.company.dto; package com.engine.organization.entity.company.dto;
import com.engine.organization.annotation.OrganizationTable; import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableOperate;
import com.engine.organization.annotation.TableTitle; import com.engine.organization.annotation.TableTitle;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@ -20,12 +19,7 @@ import java.util.List;
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508", @OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508")
operates = {
@OrganizationTableOperate(text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除"),
@OrganizationTableOperate(index = "2", text = "查看部门")
})
public class CompListDTO { public class CompListDTO {
/** /**
* id * id
@ -56,7 +50,7 @@ public class CompListDTO {
/** /**
* *
*/ */
@TableTitle(title = "上级公司", dataIndex = "parentCompName", key = "parentCompName") @TableTitle(title = "上级分部", dataIndex = "parentCompName", key = "parentCompName")
private String parentCompName; private String parentCompName;
private Long parentCompany; private Long parentCompany;
@ -79,10 +73,13 @@ public class CompListDTO {
@TableTitle(title = "负责人", dataIndex = "compPrincipal", key = "compPrincipal") @TableTitle(title = "负责人", dataIndex = "compPrincipal", key = "compPrincipal")
private String 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; private int forbiddenTag;
/** /**

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

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

@ -39,7 +39,7 @@ public class DepartmentBO {
.deptPrincipal(getEmployeeNameById(e.getDeptPrincipal())) .deptPrincipal(getEmployeeNameById(e.getDeptPrincipal()))
.showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder()) .showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder())
.forbiddenTag(e.getForbiddenTag()) .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)); 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(); List<String> usedIds = MapperProxyFactory.getProxy(DepartmentMapper.class).listUsedId();
@ -109,7 +109,7 @@ public class DepartmentBO {
.deptName(e.getDeptName()) .deptName(e.getDeptName())
.parentComp(e.getParentComp()) .parentComp(e.getParentComp())
.parentDept(e.getParentDept()) .parentDept(e.getParentDept())
.parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept().intValue())) .parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept()))
.deptPrincipalName(getEmployeeNameById(e.getDeptPrincipal())) .deptPrincipalName(getEmployeeNameById(e.getDeptPrincipal()))
.build()).collect(Collectors.toList()); .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()); 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) { 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 -> { return departmentPOS.stream().map(item -> {
SearchTree tree = new SearchTree(); SearchTree tree = new SearchTree();
tree.setCanClick(true); tree.setCanClick(true);
tree.setCanceled(false); tree.setCanceled(false);
tree.setIcon("icon-coms-Branch"); tree.setIcon(isLeaf ? "icon-coms-Branch" : "icon-coms-LargeArea");
tree.setId(item.getId().toString()); tree.setId(item.getId().toString());
tree.setIsParent(false); tree.setIsParent(false);
tree.setIsVirtual("0"); 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); return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id);
} }

@ -2,7 +2,6 @@ package com.engine.organization.entity.department.dto;
import com.cloudstore.eccom.pc.table.WeaTableType; import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.organization.annotation.OrganizationTable; import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableOperate;
import com.engine.organization.annotation.TableTitle; import com.engine.organization.annotation.TableTitle;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@ -22,15 +21,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@OrganizationTable(pageId = "96f2bb0d-da73-11ec-a0da-00ffcbed7508", @OrganizationTable(pageId = "96f2bb0d-da73-11ec-a0da-00ffcbed7508",
tableType = WeaTableType.NONE, 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 = "联查人员")
})
public class DepartmentListDTO { public class DepartmentListDTO {
private Long id; private Long id;
@ -38,11 +29,6 @@ public class DepartmentListDTO {
* *
*/ */
private Integer isUsed; 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") @TableTitle(title = "名称", dataIndex = "deptName", key = "deptName")
private String 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; 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; private int forbiddenTag;
/** /**
* *

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

@ -1,5 +1,7 @@
package com.engine.organization.entity.extend.bo; 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.BrowserBean;
import com.api.browser.bean.BrowserValueInfo; import com.api.browser.bean.BrowserValueInfo;
import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionItem;
@ -106,7 +108,7 @@ public class ExtendInfoBO {
.editShow("0".equals(infoFieldParam.getIsModify()) ? 0 : 1) .editShow("0".equals(infoFieldParam.getIsModify()) ? 0 : 1)
.addShow(1) .addShow(1)
.browserShow(1) .browserShow(1)
.customValue(infoFieldParam.getFieldType().toString()) .customValue(convertSelectCustom(controlType, infoFieldParam.getFieldType().toString()))
.showOrder(showOrder) .showOrder(showOrder)
// 非系统初始化字段 // 非系统初始化字段
.isSystemDefault(1) .isSystemDefault(1)
@ -116,6 +118,31 @@ public class ExtendInfoBO {
.build(); .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()) { if (1 == extendInfoPO.getIsrequired()) {
fieldItem.setViewAttr(3); fieldItem.setViewAttr(3);
fieldItem.setRules("required|string"); fieldItem.setRules("required");
} else { } else {
fieldItem.setViewAttr(2); fieldItem.setViewAttr(2);
} }

@ -7,7 +7,6 @@ import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;
import weaver.general.Util; import weaver.general.Util;
/** /**
@ -110,21 +109,4 @@ public class ExtendInfoFieldParam {
} }
return fp.getFielddbtype(); 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);
}
} }

@ -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;
}

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

@ -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;
}

@ -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;
}

@ -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;
}

@ -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.param.JobSearchParam;
import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.job.vo.SingleJobTreeVO; 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.mapper.job.JobMapper;
import com.engine.organization.transmethod.JobTransMethod; import com.engine.organization.transmethod.JobTransMethod;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
@ -39,6 +40,7 @@ public class JobBO {
.description(param.getDescription()) .description(param.getDescription())
.workDuty(param.getWorkDuty()) .workDuty(param.getWorkDuty())
.workAuthority(param.getWorkAuthority()) .workAuthority(param.getWorkAuthority())
.showOrder(param.getShowOrder())
.forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1) .forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1)
.deleteType(0) .deleteType(0)
.createTime(new Date()) .createTime(new Date())
@ -87,6 +89,7 @@ public class JobBO {
.parentJob(e.getParentJob()) .parentJob(e.getParentJob())
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName()) .parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
.isKey(JobTransMethod.getIsKeySpan(e.getIsKey())) .isKey(JobTransMethod.getIsKeySpan(e.getIsKey()))
.showOrder(e.getShowOrder())
.forbiddenTag(e.getForbiddenTag()) .forbiddenTag(e.getForbiddenTag())
.build()).collect(Collectors.toList()); .build()).collect(Collectors.toList());
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob)); 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());
}
} }

@ -2,7 +2,6 @@ package com.engine.organization.entity.job.dto;
import com.cloudstore.eccom.pc.table.WeaTableType; import com.cloudstore.eccom.pc.table.WeaTableType;
import com.engine.organization.annotation.OrganizationTable; import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableOperate;
import com.engine.organization.annotation.TableTitle; import com.engine.organization.annotation.TableTitle;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@ -22,15 +21,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@OrganizationTable(pageId = "0efea835-dfc5-11ec-a09e-00e04c680716", @OrganizationTable(pageId = "0efea835-dfc5-11ec-a09e-00e04c680716",
tableType = WeaTableType.NONE, 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 = "联查人员")
})
public class JobListDTO { public class JobListDTO {
/** /**
* *
@ -82,10 +73,16 @@ public class JobListDTO {
@TableTitle(title = "是否关键岗", dataIndex = "isKey", key = "isKey") @TableTitle(title = "是否关键岗", dataIndex = "isKey", key = "isKey")
private String 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; private Integer forbiddenTag;
/** /**

@ -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;
}

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

@ -74,6 +74,10 @@ public class JobPO {
* *
*/ */
private Integer forbiddenTag; private Integer forbiddenTag;
/**
*
*/
private Integer showOrder;
private Long creator; private Long creator;

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

@ -22,10 +22,6 @@ public class PostPO {
* *
*/ */
private Long id; private Long id;
/**
*
*/
private String postNo;
/** /**
* *
*/ */

@ -29,7 +29,8 @@ import lombok.NoArgsConstructor;
" t.description," + " t.description," +
" t.forbidden_tag", " t.forbidden_tag",
fromSql = " from jcl_org_post_info t inner join jcl_org_post a on t.post_id = a.id ", 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", primarykey = "id",
operates = { operates = {
@OrganizationTableOperate(index = "0", text = "编辑"), @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; 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; private Integer forbiddenTag;
} }

@ -27,7 +27,8 @@ import lombok.NoArgsConstructor;
" t.forbidden_tag," + " t.forbidden_tag," +
"t.is_used", "t.is_used",
fromSql = "from jcl_org_grade t inner join jcl_org_scheme a on t.scheme_id = a.id ", 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", primarykey = "id",
operates = { operates = {
@OrganizationTableOperate(text = "编辑"), @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; 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; private int forbiddenTag;
} }

@ -26,7 +26,8 @@ import lombok.NoArgsConstructor;
"t.create_time," + "t.create_time," +
"t.update_time", "t.update_time",
fromSql = "FROM jcl_org_level t inner join jcl_org_scheme s on t.scheme_id = s.id ", 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", primarykey = "id",
operates = { operates = {
@OrganizationTableOperate(text = "编辑"), @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; 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; private Integer forbiddenTag;
} }

@ -24,7 +24,8 @@ import lombok.NoArgsConstructor;
"t.create_time," + "t.create_time," +
"t.update_time", "t.update_time",
fromSql = "FROM jcl_org_scheme t ", fromSql = "FROM jcl_org_scheme t ",
orderby = "id desc", orderby = "scheme_no",
sortway = "asc",
primarykey = "id", primarykey = "id",
operates = { operates = {
@OrganizationTableOperate(index = "0", text = "编辑"), @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; 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; private Integer forbiddenTag;
} }

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

@ -75,4 +75,9 @@ public class StaffSearchParam {
* *
*/ */
private Integer changeNum; private Integer changeNum;
/**
*
*/
private String changeDescription;
} }

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

@ -20,7 +20,8 @@ import lombok.NoArgsConstructor;
@OrganizationTable(pageId = "e04abd72-dbd6-11ec-b69e-00ffcbed7508", @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", 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 ", fromSql = "FROM jcl_org_staffplan t ",
orderby = "id desc", orderby = "plan_no",
sortway = "asc",
primarykey = "id", primarykey = "id",
operates = { operates = {
@OrganizationTableOperate(text = "编辑"), @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; 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; private Integer forbiddenTag;
} }

@ -19,7 +19,7 @@ public interface CompMapper {
* *
* @return * @return
*/ */
List<CompPO> list(); List<CompPO> list(@Param("orderSql") String orderSql);
/** /**
* ID * ID
@ -33,7 +33,7 @@ public interface CompMapper {
* *
* @return * @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 * ID
*
* @param ids * @param ids
* @return * @return
*/ */
List<CompPO> getCompsByIds(@Param("ids") Collection<Long> ids); List<CompPO> getCompsByIds(@Param("ids") Collection<Long> ids);
/** /**
* / * /
* *
@ -133,4 +133,11 @@ public interface CompMapper {
* @param ids * @param ids
*/ */
int deleteByIds(@Param("ids") Collection<Long> ids); int deleteByIds(@Param("ids") Collection<Long> ids);
/**
*
*
* @return
*/
int getMaxShowOrder();
} }

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

@ -27,7 +27,7 @@ public interface DepartmentMapper {
* *
* @return * @return
*/ */
List<DepartmentPO> list(); List<DepartmentPO> list(@Param("orderSql") String orderSql);
/** /**
* No * No
@ -42,7 +42,7 @@ public interface DepartmentMapper {
* *
* @return * @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<Map<String, Object>> listDeptsByIds(@Param("ids") Collection<Long> ids);
List<DepartmentPO> getDeptsByIds(@Param("ids") Collection<Long> ids);
/** /**
* ID * ID
* *
@ -66,7 +68,7 @@ public interface DepartmentMapper {
* @param id * @param id
* @return * @return
*/ */
String getDeptNameById(@Param("id") int id); String getDeptNameById(@Param("id") Long id);
/** /**
* *
@ -92,14 +94,6 @@ public interface DepartmentMapper {
*/ */
int updateForbiddenTagById(DepartmentPO departmentPO); int updateForbiddenTagById(DepartmentPO departmentPO);
/**
*
*
* @param ids
* @return
*/
int forbiddenDepartmentByIds(@Param("ids") Collection<Long> ids);
/** /**
* *
* *
@ -113,4 +107,11 @@ public interface DepartmentMapper {
* @return * @return
*/ */
List<String> listUsedId(); List<String> listUsedId();
/**
*
*
* @return
*/
int getMaxShowOrder();
} }

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

@ -1,6 +1,6 @@
package com.engine.organization.mapper.extend; package com.engine.organization.mapper.extend;
import org.apache.ibatis.annotations.Param; import com.engine.organization.entity.extend.param.ExtendInfoParams;
import java.util.Map; import java.util.Map;
@ -15,34 +15,32 @@ public interface ExtMapper {
/** /**
* id, * id,
* *
* @param tableName * @param params
* @param id
* @return * @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 params
* @param id
* @return * @return
*/ */
int countExtById(@Param("tableName") String tableName, @Param("id") long id); int countExtById(ExtendInfoParams params);
/** /**
* *
* *
* @param map * @param params
* @return * @return
*/ */
int insertExt(@Param("tableName") String tableName, @Param("map") Map<String, Object> map); int insertExt(ExtendInfoParams params);
/** /**
* *
* *
* @param map * @param params
* @return * @return
*/ */
int updateExt(@Param("tableName") String tableName, @Param("id") long id, @Param("map") Map<String, Object> map); int updateExt(ExtendInfoParams params);
} }

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

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

@ -21,14 +21,22 @@ public interface JobMapper {
* *
* @return * @return
*/ */
List<JobListDTO> listByFilter(JobPO jobPO); List<JobListDTO> listByFilter(@Param("jobPO") JobPO jobPO, @Param("orderSql") String orderSql);
/** /**
* *
* *
* @return * @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 * @return
*/ */
List<String> listUsedId(); List<String> listUsedId();
/**
*
*
* @return
*/
int getMaxShowOrder();
} }

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

@ -18,15 +18,6 @@ import java.util.Map;
* @Version V1.0 * @Version V1.0
**/ **/
public interface PostMapper { public interface PostMapper {
/**
* No
*
* @param postNo
* @return
*/
List<PostPO> listByNo(@Param("postNo") String postNo);
/** /**
* ID * ID
* *

@ -3,7 +3,6 @@
<mapper namespace="com.engine.organization.mapper.post.PostMapper"> <mapper namespace="com.engine.organization.mapper.post.PostMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.postion.po.PostPO"> <resultMap id="BaseResultMap" type="com.engine.organization.entity.postion.po.PostPO">
<result column="id" property="id"/> <result column="id" property="id"/>
<result column="post_no" property="postNo"/>
<result column="post_name" property="postName"/> <result column="post_name" property="postName"/>
<result column="description" property="description"/> <result column="description" property="description"/>
<result column="creator" property="creator"/> <result column="creator" property="creator"/>
@ -22,7 +21,6 @@
t t
. .
id id
, t.post_no
, t.post_name , t.post_name
, t.description , t.description
, t.creator , t.creator
@ -37,13 +35,6 @@
from jcl_org_post t where id = #{id} AND delete_type = 0 from jcl_org_post t where id = #{id} AND delete_type = 0
</select> </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 id="listPostsByIds" resultType="java.util.Map">
select select
@ -66,7 +57,6 @@
<set> <set>
creator=#{creator}, creator=#{creator},
update_time=#{updateTime}, update_time=#{updateTime},
post_no=#{postNo},
post_name=#{postName}, post_name=#{postName},
description=#{description}, description=#{description},
</set> </set>
@ -89,9 +79,6 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="postNo != null ">
post_no,
</if>
<if test="postName != null "> <if test="postName != null ">
post_name, post_name,
</if> </if>
@ -112,9 +99,6 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime}, #{updateTime},
</if> </if>
<if test="postNo != null ">
#{postNo},
</if>
<if test="postName != null "> <if test="postName != null ">
#{postName}, #{postName},
</if> </if>

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

@ -14,6 +14,11 @@
<result column="update_time" property="updateTime"/> <result column="update_time" property="updateTime"/>
</resultMap> </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"> <sql id="baseColumns">
t t
@ -29,6 +34,8 @@
, t.create_time , t.create_time
, t.update_time , t.update_time
</sql> </sql>
<select id="getLevelByID" parameterType="com.engine.organization.entity.scheme.po.LevelPO" <select id="getLevelByID" parameterType="com.engine.organization.entity.scheme.po.LevelPO"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
@ -68,6 +75,11 @@
from JCL_ORG_JOBDT from JCL_ORG_JOBDT
where delete_type = 0 where delete_type = 0
</select> </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 id="updateLevel" parameterType="com.engine.organization.entity.scheme.po.LevelPO">
update jcl_org_level update jcl_org_level

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

@ -13,6 +13,11 @@
<result column="update_time" property="updateTime"/> <result column="update_time" property="updateTime"/>
</resultMap> </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"> <sql id="baseColumns">
t t
@ -68,6 +73,11 @@
from JCL_ORG_JOB from JCL_ORG_JOB
where delete_type = 0 where delete_type = 0
</select> </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" <insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.scheme.po.SchemePO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true"> keyColumn="id" useGeneratedKeys="true">

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

@ -1,8 +1,11 @@
package com.engine.organization.service; package com.engine.organization.service;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.organization.entity.company.param.CompSearchParam; import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -27,7 +30,7 @@ public interface CompService {
* @param params * @param params
* @return * @return
*/ */
int saveBaseComp(Map<String, Object> params); Long saveBaseComp(Map<String, Object> params);
/** /**
* *
@ -43,7 +46,7 @@ public interface CompService {
* @param params * @param params
* @return * @return
*/ */
int updateComp(Map<String, Object> params); Long updateComp(Map<String, Object> params);
/** /**
@ -83,4 +86,19 @@ public interface CompService {
*/ */
Map<String, Object> getCompSaveForm(); Map<String, Object> getCompSaveForm();
/**
*
*
* @return
*/
List<SearchConditionGroup> getMoveForm();
/**
*
*
* @param moveParam
* @return
*/
int moveCompany(DepartmentMoveParam moveParam);
} }

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

@ -73,7 +73,7 @@ public interface ExtService {
* @param id * @param id
* @return * @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);
/** /**
* *

@ -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();
}

@ -1,9 +1,12 @@
package com.engine.organization.service; 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.job.param.JobSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.entity.searchtree.SearchTreeParams;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -63,7 +66,7 @@ public interface JobService {
* @param params * @param params
* @return * @return
*/ */
int saveBaseForm(Map<String, Object> params); Long saveBaseForm(Map<String, Object> params);
/** /**
* *
@ -71,7 +74,7 @@ public interface JobService {
* @param params * @param params
* @return * @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); int deleteByIds(Collection<Long> ids);
Map<String, Object> getHrmListByJobId(Long jobId); Map<String, Object> getHrmListByJobId(Long jobId);
/**
*
*
* @return
*/
List<SearchConditionGroup> getMergeForm();
/**
*
*
* @param mergeParam
* @return
*/
int mergeJob(JobMergeParam mergeParam);
} }

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

@ -1,8 +1,10 @@
package com.engine.organization.service; package com.engine.organization.service;
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
import com.engine.organization.entity.scheme.param.SchemeSearchParam; import com.engine.organization.entity.scheme.param.SchemeSearchParam;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -70,8 +72,16 @@ public interface SchemeService {
/** /**
* *
*
* @return * @return
*/ */
Map<String, Object> getTableBtn(); Map<String, Object> getTableBtn();
/**
*
*
* @return
*/
List<TypeTreeVO> getTreeData();
} }

@ -11,25 +11,27 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.hrm.entity.RuleCodeType; import com.engine.hrm.entity.RuleCodeType;
import com.engine.organization.component.OrganizationWeaTable; 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.bo.CompBO;
import com.engine.organization.entity.company.dto.CompListDTO; import com.engine.organization.entity.company.dto.CompListDTO;
import com.engine.organization.entity.company.param.CompSearchParam; import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.company.po.CompPO; 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.entity.extend.po.ExtendTitlePO;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.service.CompService; import com.engine.organization.service.CompService;
import com.engine.organization.service.ExtService; import com.engine.organization.service.ExtService;
import com.engine.organization.util.HasRightUtil; import com.engine.organization.util.*;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.coderule.CodeRuleUtil; import com.engine.organization.util.coderule.CodeRuleUtil;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.page.Column; import com.engine.organization.util.page.Column;
import com.engine.organization.util.page.PageInfo; import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil; import com.engine.organization.util.page.PageUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil; import weaver.general.StringUtil;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.User; import weaver.hrm.User;
@ -95,11 +97,12 @@ public class CompServiceImpl extends Service implements CompService {
CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID()); CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID());
boolean filter = isFilter(compPO); boolean filter = isFilter(compPO);
PageInfo<CompListDTO> pageInfos; PageInfo<CompListDTO> pageInfos;
List<CompPO> alltList = getCompMapper().list(); String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams());
List<CompPO> alltList = getCompMapper().list(orderSql);
// 通过子级遍历父级元素 // 通过子级遍历父级元素
if (filter) { if (filter) {
// 根据条件获取元素 // 根据条件获取元素
List<CompPO> filterCompPOs = getCompMapper().listByFilter(compPO); List<CompPO> filterCompPOs = getCompMapper().listByFilter(compPO, orderSql);
// 添加父级元素 // 添加父级元素
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(alltList, filterCompPOs); List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(alltList, filterCompPOs);
List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS); List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
@ -132,14 +135,16 @@ public class CompServiceImpl extends Service implements CompService {
} }
@Override @Override
public int saveBaseComp(Map<String, Object> params) { public Long saveBaseComp(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
String compNo = (String) params.get("comp_no"); String compNo = (String) params.get("comp_no");
compNo = CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, compNo); // 判断是否开启自动编号
List<CompPO> list = getCompMapper().listByNo(Util.null2String(compNo)); compNo = repeatDetermine(compNo);
OrganizationAssert.isEmpty(list, "编号不允许重复");
params.put("comp_no", 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); return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", null);
} }
@ -151,22 +156,27 @@ public class CompServiceImpl extends Service implements CompService {
} }
@Override @Override
public int updateComp(Map<String, Object> params) { public Long updateComp(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class); CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
String groupId = (String) params.get("viewCondition"); String groupId = (String) params.get("viewCondition");
if ("0".equals(groupId)) { if ("0".equals(groupId)) {
groupId = GROUP_ID.toString(); 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()); getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, searchParam.getId());
return updateCount; return searchParam.getId();
} }
@Override @Override
@ -243,7 +253,10 @@ public class CompServiceImpl extends Service implements CompService {
if (CollectionUtils.isNotEmpty(extendTitles)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : 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); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendTitles)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : 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); 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()); && 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);
}
}
} }

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

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

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

@ -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);
}
}
}

@ -11,6 +11,7 @@ import com.engine.core.impl.Service;
import com.engine.hrm.entity.RuleCodeType; import com.engine.hrm.entity.RuleCodeType;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam; 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.bo.CompBO;
import com.engine.organization.entity.company.po.CompPO; import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.bo.DepartmentBO; 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.extend.po.ExtendTitlePO;
import com.engine.organization.entity.job.bo.JobBO; import com.engine.organization.entity.job.bo.JobBO;
import com.engine.organization.entity.job.dto.JobListDTO; 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.param.JobSearchParam;
import com.engine.organization.entity.job.po.JobDTPO; import com.engine.organization.entity.job.po.JobDTPO;
import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.scheme.po.GradePO; import com.engine.organization.entity.scheme.po.GradePO;
import com.engine.organization.entity.searchtree.SearchTree; import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams; 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.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper; 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.mapper.scheme.LevelMapper;
import com.engine.organization.service.ExtService; import com.engine.organization.service.ExtService;
import com.engine.organization.service.JobService; import com.engine.organization.service.JobService;
import com.engine.organization.util.HasRightUtil; import com.engine.organization.util.*;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.coderule.CodeRuleUtil; import com.engine.organization.util.coderule.CodeRuleUtil;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.page.Column; 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.page.PageUtil;
import com.engine.organization.util.tree.SearchTreeUtil; import com.engine.organization.util.tree.SearchTreeUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil; import weaver.general.StringUtil;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.User; import weaver.hrm.User;
@ -144,11 +145,12 @@ public class JobServiceImpl extends Service implements JobService {
JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID()); JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID());
boolean filter = isFilter(jobPO); boolean filter = isFilter(jobPO);
PageInfo<JobListDTO> pageInfos; PageInfo<JobListDTO> pageInfos;
List<JobListDTO> allList = getJobMapper().listNoFilter(); String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
// 通过子级遍历父级元素 // 通过子级遍历父级元素
if (filter) { if (filter) {
// 根据条件获取元素 // 根据条件获取元素
List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO); List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO, orderSql);
// 添加父级元素 // 添加父级元素
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs); List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS); 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); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendTitles)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : 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); apiDatas.put("condition", addGroups);
@ -281,7 +286,10 @@ public class JobServiceImpl extends Service implements JobService {
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendTitles)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : 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<>(); 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)); 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<>(); Map<String, Object> tableMap = new HashMap<>();
tableMap.put("hide", false); tableMap.put("hide", false);
@ -320,36 +328,38 @@ public class JobServiceImpl extends Service implements JobService {
} }
@Override @Override
public int saveBaseForm(Map<String, Object> params) { public Long saveBaseForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); 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); JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
// 处理自动编号 params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
searchParam.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, searchParam.getJobNo())); DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(searchParam.getParentDept());
List<JobPO> list = getJobMapper().listByNo(Util.null2String(searchParam.getJobNo())); params.put("parent_comp", departmentPO.getParentComp());
OrganizationAssert.isEmpty(list, "编号不允许重复"); if (StringUtils.isBlank(params.get("show_order").toString())) {
JobPO jobPO = JobBO.convertParamsToPO(searchParam, user.getUID()); int maxShowOrder = getJobMapper().getMaxShowOrder();
jobPO.setIsKey(null == jobPO.getIsKey() ? 0 : jobPO.getIsKey()); params.put("show_order", maxShowOrder + 1);
int insertCount = getJobMapper().insertIgnoreNull(jobPO); }
params.put("job_no", jobPO.getJobNo());
params.put("is_key", jobPO.getIsKey()); Long jobId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
if (null != searchParam.getSchemeId()) {
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", jobPO.getId());
if (null != jobPO.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) { for (GradePO gradePO : gradePOS) {
List<Map<String, Object>> maps = MapperProxyFactory.getProxy(LevelMapper.class).listLevelsByIds(DeleteParam.builder().ids(gradePO.getLevelId()).build().getIds()); 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(",")); 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 @Override
public int updateForm(Map<String, Object> params) { public Long updateForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class); JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
String groupId = (String) params.get("viewCondition"); String groupId = (String) params.get("viewCondition");
@ -357,13 +367,21 @@ public class JobServiceImpl extends Service implements JobService {
if ("0".equals(groupId)) { if ("0".equals(groupId)) {
groupId = GROUP_ID.toString(); 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()); 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()); getJobDTMapper().deleteByIds(searchParam.getId());
int rowNum = Util.getIntValue((String) params.get("rownum")); 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()); 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()); getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, searchParam.getId());
return updateCount; return searchParam.getId();
} }
@Override @Override
@ -384,11 +402,14 @@ public class JobServiceImpl extends Service implements JobService {
OrganizationAssert.notBlank(department, "请指定需要复制的部门"); OrganizationAssert.notBlank(department, "请指定需要复制的部门");
int insertCount = 0; int insertCount = 0;
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList()); List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
int orderNum = getJobMapper().getMaxShowOrder();
for (Long id : idList) { for (Long id : idList) {
orderNum++;
JobPO jobById = getJobMapper().getJobById(id); 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.setParentDept(Long.parseLong(department));
jobById.setShowOrder(orderNum);
insertCount += getJobMapper().insertIgnoreNull(jobById); insertCount += getJobMapper().insertIgnoreNull(jobById);
} }
@ -406,10 +427,7 @@ public class JobServiceImpl extends Service implements JobService {
public int deleteByIds(Collection<Long> ids) { public int deleteByIds(Collection<Long> ids) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
OrganizationAssert.notEmpty(ids, "请选择要删除的数据"); OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
Collection<Long> deleteIds = new ArrayList<>(); return getJobMapper().deleteByIds(ids);
// 递归删除子节点
getChildIds(ids, deleteIds);
return getJobMapper().deleteByIds(deleteIds);
} }
@Override @Override
@ -421,6 +439,48 @@ public class JobServiceImpl extends Service implements JobService {
return result.getResultMap(); 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)) { } 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<>(); Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) { for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts); buildParentDepts(departmentPO, builderDeparts);
@ -493,9 +553,9 @@ public class JobServiceImpl extends Service implements JobService {
* @return * @return
*/ */
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) { 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<>(); Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) { for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts); buildParentDepts(departmentPO, builderDeparts);
@ -539,16 +599,70 @@ public class JobServiceImpl extends Service implements JobService {
} }
/** /**
* *
*
* @return
*/
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 ids * @param disableIds
* @param deleteIds * @param jobPOS
*/ */
private void getChildIds(Collection<Long> ids, Collection<Long> deleteIds) { private void addDisableIds(Set<Long> disableIds, List<JobPO> jobPOS) {
for (Long id : ids) { for (JobPO jobPO : jobPOS) {
deleteIds.add(id); disableIds.add(jobPO.getId());
Collection<Long> childIds = getJobMapper().getJobsByPid(id).stream().map(JobPO::getId).collect(Collectors.toList()); List<JobPO> jobsByPid = getJobMapper().getJobsByPid(jobPO.getId());
getChildIds(childIds, deleteIds); addDisableIds(disableIds, jobsByPid);
} }
} }

@ -8,6 +8,7 @@ import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam; import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.TopTab; 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.dto.LevelDTO;
import com.engine.organization.entity.scheme.param.LevelSearchParam; import com.engine.organization.entity.scheme.param.LevelSearchParam;
import com.engine.organization.entity.scheme.po.LevelPO; import com.engine.organization.entity.scheme.po.LevelPO;
@ -78,6 +79,12 @@ public class LevelServiceImpl extends Service implements LevelService {
public int updateLevel(LevelSearchParam param) { public int updateLevel(LevelSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
LevelPO levelPO = LevelDTO.convertParamToPO(param, (long) user.getUID()); 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); return getLevelMapper().updateLevel(levelPO);
} }
@ -142,7 +149,7 @@ public class LevelServiceImpl extends Service implements LevelService {
browserBean.setReplaceDatas(maps); browserBean.setReplaceDatas(maps);
browserItem.setBrowserConditionParam(browserBean); browserItem.setBrowserConditionParam(browserBean);
// 编辑状态下,编号只读 // 编辑状态下,编号只读
levelNoCondition.setViewAttr(1); // levelNoCondition.setViewAttr(1);
} }
selectItems.add(levelNoCondition); selectItems.add(levelNoCondition);
@ -177,6 +184,12 @@ public class LevelServiceImpl extends Service implements LevelService {
return apiDatas; 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); sqlWhere += " AND t.level_name " + dbType.like(levelName);
} }
String schemeId = (String) params.get("schemeId"); String schemeId = (String) params.get("schemeId");
if (StringUtils.isNotBlank(schemeId)) { if (StringUtils.isNotBlank(schemeId) && !"-1".equals(schemeId)) {
sqlWhere += " AND t.scheme_id = '" + schemeId + "'"; sqlWhere += " AND t.scheme_id = '" + schemeId + "'";
} }
String viewCondition = (String) params.get("viewCondition"); String viewCondition = (String) params.get("viewCondition");

@ -78,6 +78,11 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
public int updatePostInfo(PostInfoSearchParam param) { public int updatePostInfo(PostInfoSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
PostInfoPO postInfoPO = PostInfoDTO.convertParamToPO(param, (long) user.getUID()); 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); 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"); SearchConditionItem nameItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "postInfoName");
nameItem.setRules("required|string"); 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"); SearchConditionItem postIdBrowser = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "职务分类", "161", "postId", "postBrowser");
postIdBrowser.setRules("required|string"); postIdBrowser.setRules("required|string");
@ -155,7 +160,7 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
browserBean.setReplaceDatas(maps); browserBean.setReplaceDatas(maps);
postIdBrowser.setBrowserConditionParam(browserBean); postIdBrowser.setBrowserConditionParam(browserBean);
// 编辑状态下,编号只读 // 编辑状态下,编号只读
noItem.setViewAttr(1); // noItem.setViewAttr(1);
} }
selectItems.add(noItem); selectItems.add(noItem);
@ -172,7 +177,25 @@ public class PostInfoServiceImpl extends Service implements PostInfoService {
@Override @Override
public Map<String, Object> getHasRight() { 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;
} }

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

@ -5,6 +5,8 @@ import com.api.browser.bean.SearchConditionItem;
import com.cloudstore.eccom.result.WeaResultMsg; import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable; 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.dto.SchemeDTO;
import com.engine.organization.entity.scheme.param.SchemeSearchParam; import com.engine.organization.entity.scheme.param.SchemeSearchParam;
import com.engine.organization.entity.scheme.po.SchemePO; import com.engine.organization.entity.scheme.po.SchemePO;
@ -20,6 +22,7 @@ import weaver.general.StringUtil;
import weaver.general.Util; import weaver.general.Util;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Author dxfeng * @Author dxfeng
@ -72,6 +75,12 @@ public class SchemeServiceImpl extends Service implements SchemeService {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
Map<String, Object> apidatas = new HashMap<>(); Map<String, Object> apidatas = new HashMap<>();
SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID()); 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); getSchemeMapper().updateScheme(schemePO);
return apidatas; return apidatas;
} }
@ -129,7 +138,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
textareaItem.setValue(schemePO.getSchemeDescription()); textareaItem.setValue(schemePO.getSchemeDescription());
// 编辑状态下,编号只读 // 编辑状态下,编号只读
schemeNoCondition.setViewAttr(1); // schemeNoCondition.setViewAttr(1);
} }
selectItems.add(schemeNoCondition); selectItems.add(schemeNoCondition);
@ -145,6 +154,26 @@ public class SchemeServiceImpl extends Service implements SchemeService {
return MenuBtn.getCommonBtnDatas(); 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;
}
/** /**
* *
* *

@ -78,6 +78,11 @@ public class SequenceServiceImpl extends Service implements SequenceService {
public int updateSequence(SequenceSearchParam param) { public int updateSequence(SequenceSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
SequencePO sequencePO = SequenceDTO.convertParamToPO(param, (long) user.getUID()); 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); return getSequenceMapper().updateSequence(sequencePO);
} }
@ -142,7 +147,7 @@ public class SequenceServiceImpl extends Service implements SequenceService {
browserBean.setReplaceDatas(maps); browserBean.setReplaceDatas(maps);
browserItem.setBrowserConditionParam(browserBean); browserItem.setBrowserConditionParam(browserBean);
// 编辑状态下,编号只读 // 编辑状态下,编号只读
sequenceNoCondition.setViewAttr(1); // sequenceNoCondition.setViewAttr(1);
} }
selectItems.add(sequenceNoCondition); selectItems.add(sequenceNoCondition);

@ -78,6 +78,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
public int updateStaffPlan(StaffPlanSearchParam param) { public int updateStaffPlan(StaffPlanSearchParam param) {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID()); 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); return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
} }
@ -173,8 +179,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
planNoItem.setValue(staffPlanPO.getPlanNo()); planNoItem.setValue(staffPlanPO.getPlanNo());
planNameItem.setValue(staffPlanPO.getPlanName()); planNameItem.setValue(staffPlanPO.getPlanName());
planYearItem.setValue(staffPlanPO.getPlanYear() + ""); planYearItem.setValue(staffPlanPO.getPlanYear() + "");
timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(),"yyyy-MM-dd")); timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(), "yyyy-MM-dd"));
timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(),"yyyy-MM-dd")); timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(), "yyyy-MM-dd"));
BrowserBean browserBean = companyIdtItem.getBrowserConditionParam(); BrowserBean browserBean = companyIdtItem.getBrowserConditionParam();
List<Map<String, Object>> maps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPlanPO.getCompanyId()).build().getIds()); 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()); descriptionItem.setValue(staffPlanPO.getDescription());
// 编辑状态下,编号只读 // 编辑状态下,编号只读
planNoItem.setViewAttr(1); // planNoItem.setViewAttr(1);
} }
selectItems.add(planNoItem); selectItems.add(planNoItem);
@ -250,4 +256,5 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
return sqlWhere; return sqlWhere;
} }
} }

@ -102,7 +102,7 @@ public class StaffServiceImpl extends Service implements StaffService {
} else { } 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); MapperProxyFactory.getProxy(StaffsMapper.class).insertIgnoreNull(staffsPO);
// 更新编制表 // 更新编制表
staffPO.setStaffNum(staffPO.getStaffNum() + changeNum); staffPO.setStaffNum(staffPO.getStaffNum() + changeNum);
@ -127,8 +127,10 @@ public class StaffServiceImpl extends Service implements StaffService {
List<SearchConditionGroup> addGroups = new ArrayList<>(); List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = 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"); 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"); SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
conditionItems.add(planIdItem); //conditionItems.add(planIdItem);
conditionItems.add(compIdItem); conditionItems.add(compIdItem);
conditionItems.add(deptIdItem); conditionItems.add(deptIdItem);
conditionItems.add(jobIdItem); conditionItems.add(jobIdItem);
@ -252,6 +254,9 @@ public class StaffServiceImpl extends Service implements StaffService {
SearchConditionItem changeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 3, "调整数量", "changeNum"); SearchConditionItem changeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 3, "调整数量", "changeNum");
staffNumItem.setRules("required"); staffNumItem.setRules("required");
selectItems.add(changeNumItem); selectItems.add(changeNumItem);
SearchConditionItem changeDescriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, false, 2, 50, "变更说明", "changeDescription");
selectItems.add(changeDescriptionItem);
} }
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems)); addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
@ -261,7 +266,18 @@ public class StaffServiceImpl extends Service implements StaffService {
@Override @Override
public Map<String, Object> getHasRight() { 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(); Long planId = param.getPlanId();
if (null != planId) { if (null != planId) {
sqlWhere += " AND t.plan_id = '" + planId + "'"; sqlWhere += " AND t.plan_id = '" + planId + "'";
} else {
sqlWhere = " 1=2 ";
} }
Long compId = param.getCompId(); Long compId = param.getCompId();
if (null != compId) { if (null != compId) {

@ -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));
}
}

@ -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();
}
}

@ -14,10 +14,13 @@ public class Column {
String dataIndex; String dataIndex;
String key; String key;
boolean display; 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.title = title;
this.dataIndex = dataIndex; this.dataIndex = dataIndex;
this.key = key; this.key = key;
this.width = width;
} }
} }

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

@ -4,6 +4,7 @@ import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.DeleteParam; import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.param.CompSearchParam; 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.util.response.ReturnResult;
import com.engine.organization.wrapper.CompWrapper; import com.engine.organization.wrapper.CompWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -62,7 +63,7 @@ public class CompController {
@POST @POST
@Path("/saveBaseComp") @Path("/saveBaseComp")
@Produces(MediaType.APPLICATION_JSON) @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 { try {
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).saveBaseComp(params)); 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());
}
}
} }

@ -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());
}
}
}

@ -6,6 +6,7 @@ import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.DeleteParam; import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.job.param.JobCopyParam; 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.job.param.JobSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.util.response.ReturnResult; 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());
}
}
} }

@ -202,4 +202,16 @@ public class LevelController {
return ReturnResult.exceptionHandle(e.getMessage()); 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());
}
}
} }

@ -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());
}
}
} }

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

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

@ -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();
}
}

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

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

@ -2,6 +2,7 @@ package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; 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.entity.scheme.param.SchemeSearchParam;
import com.engine.organization.service.SchemeService; import com.engine.organization.service.SchemeService;
import com.engine.organization.service.impl.SchemeServiceImpl; import com.engine.organization.service.impl.SchemeServiceImpl;
@ -9,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
import weaver.hrm.User; import weaver.hrm.User;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -74,6 +76,7 @@ public class SchemeWrapper extends Service {
/** /**
* *
*
* @param params * @param params
* @return * @return
*/ */
@ -84,6 +87,7 @@ public class SchemeWrapper extends Service {
/** /**
* *
*
* @param params * @param params
* @return * @return
*/ */
@ -93,9 +97,14 @@ public class SchemeWrapper extends Service {
/** /**
* *
*
* @return * @return
*/ */
public Map<String, Object> getTableBtn() { public Map<String, Object> getTableBtn() {
return getSchemeService(user).getTableBtn(); return getSchemeService(user).getTableBtn();
} }
public List<TypeTreeVO> getTreeData() {
return getSchemeService(user).getTreeData();
}
} }

Loading…
Cancel
Save