diff --git a/.gitignore b/.gitignore index 9e527548..30fa9f8d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ target/ .idea /src/test +/src/rebel.xml /src/META-INF /log diff --git a/docs/初始数据SQL/jcl_field_extendgroup.sql b/docs/初始数据SQL/jcl_field_extendgroup.sql new file mode 100644 index 00000000..9f9f9bb8 --- /dev/null +++ b/docs/初始数据SQL/jcl_field_extendgroup.sql @@ -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); diff --git a/docs/初始数据SQL/jcl_field_extendinfo.sql b/docs/初始数据SQL/jcl_field_extendinfo.sql new file mode 100644 index 00000000..2a2e56a7 --- /dev/null +++ b/docs/初始数据SQL/jcl_field_extendinfo.sql @@ -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); diff --git a/docs/初始数据SQL/jcl_field_extendtitle.sql b/docs/初始数据SQL/jcl_field_extendtitle.sql new file mode 100644 index 00000000..41d57f77 --- /dev/null +++ b/docs/初始数据SQL/jcl_field_extendtitle.sql @@ -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); diff --git a/docs/表结构SQL/MySQL.sql b/docs/表结构SQL/MySQL.sql index 3bc3bbe4..e4d88dd4 100644 --- a/docs/表结构SQL/MySQL.sql +++ b/docs/表结构SQL/MySQL.sql @@ -105,6 +105,7 @@ CREATE TABLE JCL_ORG_COMP ( comp_principal int null, description text NULL, forbidden_tag int NULL, + show_order int NULL, is_used int null, creator int null, delete_type int null, @@ -120,6 +121,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP ( extend_type int null, group_name varchar(100) NULL, show_order int null, + is_show varchar(100) NULL, + is_system_default int null, creator int null, delete_type int null, create_time date null, @@ -134,6 +137,7 @@ create table JCL_FIELD_EXTENDTITLE ( title varchar(100) null, show_order int null, is_show int null, + is_system_default int null, creator int null, delete_type int null, create_time date null, @@ -161,6 +165,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO ( add_show int null, browser_show int null, show_order int null, + is_system_default int null, creator int null, delete_type int null, create_time date null, @@ -290,6 +295,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 ( CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id) ); +-- JCL_ORG_HRMRESOURCE +CREATE TABLE JCL_ORG_HRMRESOURCE ( + id int auto_increment NOT NULL, + work_code varchar(60) null, + login_id varchar(60) null, + last_name varchar(60) null, + sex int null, + account_type int null, + belong_to int null, + company_id int null, + department_id int null, + job_activity int null, + job_title int null, + job_call int null, + job_level int null, + job_group_id int null, + job_activity_desc varchar(200) null, + status int null, + system_language int null, + resource_image_id varchar(1000) null, + messager_url varchar(1000) null, + location_id int null, + manager_id int null, + assistant_id int null, + mobile varchar(60) null, + telephone varchar(60) null, + mobile_call varchar(60) null, + fax varchar(60) null, + email varchar(60) null, + workroom varchar(60) null, + creator int null, + delete_type int null, + create_time date null, + update_time date null, + CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (id) +); + +-- JCL_ORG_HRMRESOURCEEXT +CREATE TABLE JCL_ORG_HRMRESOURCEEXT ( + id int NOT NULL, + creator int null, + delete_type int null, + create_time date null, + update_time date null, + CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (id) +); + +-- JCL_ORG_HRMRESOURCEEXT_DT1 +CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 ( + id int auto_increment NOT NULL, + mainid int NULL, + creator int null, + delete_type int null, + create_time date null, + update_time date null, + CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (id) +); + -- JCL_ORG_STAFFPLAN CREATE TABLE JCL_ORG_STAFFPLAN ( @@ -345,4 +408,36 @@ CREATE TABLE JCL_ORG_STAFFS ( create_time date null, update_time date null, CONSTRAINT JCL_ORG_STAFFS_PK PRIMARY KEY (id) +); + +-- JCL_ORG_MAP +CREATE TABLE JCL_ORG_MAP ( + id int auto_increment NOT NULL, + ftype int NULL, + fobjid int NULL, + fecid int NULL, + Uuid varchar(100) NULL, + fclass int NULL, + fclassname varchar(100) NULL, + fnumber varchar(100) NULL, + fname varchar(255) NULL, + fleader int NULL, + fleaderimg int NULL, + fleadername varchar(100) NULL, + fleaderjobid int NULL, + fleaderjob varchar(255) NULL, + fleaderlv varchar(100) NULL, + fleaderst varchar(100) NULL, + fparentid int null, + fobjparentid int null, + fplan int null, + fonjob int null, + fisvitual int null, + fdatebegin date null, + fdateend date null, + creator int null, + delete_type int null, + create_time date null, + update_time date null, + CONSTRAINT JCL_ORG_MAP PRIMARY KEY (id) ); \ No newline at end of file diff --git a/docs/表结构SQL/Oracle.sql b/docs/表结构SQL/Oracle.sql index ebc68141..8ce1558e 100644 --- a/docs/表结构SQL/Oracle.sql +++ b/docs/表结构SQL/Oracle.sql @@ -107,6 +107,7 @@ CREATE TABLE JCL_ORG_COMP ( COMP_PRINCIPAL NUMBER NULL, DESCRIPTION NVARCHAR2(1000) NULL, FORBIDDEN_TAG NUMBER NULL, + SHOW_ORDER NUMBER NULL, IS_USED NUMBER NULL, CREATOR NUMBER NULL, DELETE_TYPE NUMBER NULL, @@ -122,6 +123,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP ( EXTEND_TYPE NUMBER NULL, GROUP_NAME NVARCHAR2(100) NULL, SHOW_ORDER NUMBER null, + IS_SHOW NVARCHAR2(100) NULL, + IS_SYSTEM_DEFAULT NUMBER NULL, CREATOR NUMBER NULL, DELETE_TYPE NUMBER NULL, CREATE_TIME DATE NULL, @@ -136,6 +139,7 @@ CREATE TABLE JCL_FIELD_EXTENDTITLE ( TITLE VARCHAR(100) NULL, SHOW_ORDER NUMBER NULL, IS_SHOW NUMBER NULL, + IS_SYSTEM_DEFAULT NUMBER NULL, CREATOR NUMBER NULL, DELETE_TYPE NUMBER NULL, CREATE_TIME DATE NULL, @@ -163,6 +167,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO ( ADD_SHOW NUMBER NULL, BROWSER_SHOW NUMBER NULL, SHOW_ORDER NUMBER NULL, + IS_SYSTEM_DEFAULT NUMBER NULL, CREATOR NUMBER NULL, DELETE_TYPE NUMBER NULL, CREATE_TIME DATE NULL, @@ -292,6 +297,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 ( CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (ID) ); +-- JCL_ORG_HRMRESOURCE +CREATE TABLE JCL_ORG_HRMRESOURCE ( + ID NUMBER NOT NULL, + WORK_CODE NVARCHAR2(60) NULL, + LOGIN_ID NVARCHAR2(60) NULL, + LAST_NAME NVARCHAR2(60) NULL, + SEX NUMBER NULL, + ACCOUNT_TYPE NUMBER NULL, + BELONG_TO NUMBER NULL, + COMPANY_ID NUMBER NULL, + DEPARTMENT_ID NUMBER NULL, + JOB_ACTIVITY NUMBER NULL, + JOB_TITLE NUMBER NULL, + JOB_CALL NUMBER NULL, + JOB_LEVEL NUMBER NULL, + JOB_GROUP_ID NUMBER NULL, + JOB_ACTIVITY_DESC NVARCHAR2(200) NULL, + STATUS NUMBER NULL, + SYSTEM_LANGUAGE NUMBER NULL, + RESOURCE_IMAGE_ID NVARCHAR2(1000) NULL, + MESSAGER_URL NVARCHAR2(1000) NULL, + LOCATION_ID NUMBER NULL, + MANAGER_ID NUMBER NULL, + ASSISTANT_ID NUMBER NULL, + MOBILE NVARCHAR2(60) NULL, + TELEPHONE NVARCHAR2(60) NULL, + MOBILE_CALL NVARCHAR2(60) NULL, + FAX NVARCHAR2(60) NULL, + EMAIL NVARCHAR2(60) NULL, + WORKROOM NVARCHAR2(60) NULL, + CREATOR NUMBER NULL, + DELETE_TYPE NUMBER NULL, + CREATE_TIME DATE NULL, + UPDATE_TIME DATE NULL, + CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (ID) +); + +-- JCL_ORG_HRMRESOURCEEXT +CREATE TABLE JCL_ORG_HRMRESOURCEEXT ( + ID NUMBER NOT NULL, + CREATOR NUMBER NULL, + DELETE_TYPE NUMBER NULL, + CREATE_TIME DATE NULL, + UPDATE_TIME DATE NULL, + CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (ID) +); + +-- JCL_ORG_HRMRESOURCEEXT_DT1 +CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 ( + ID NUMBER NOT NULL, + MAINID NUMBER NULL, + CREATOR NUMBER NULL, + DELETE_TYPE NUMBER NULL, + CREATE_TIME DATE NULL, + UPDATE_TIME DATE NULL, + CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (ID) +); + -- JCL_ORG_STAFFPLAN CREATE TABLE JCL_ORG_STAFFPLAN ( ID NUMBER NOT NULL, diff --git a/docs/表结构SQL/SqlServer.sql b/docs/表结构SQL/SqlServer.sql index d6c4d2b6..c098665e 100644 --- a/docs/表结构SQL/SqlServer.sql +++ b/docs/表结构SQL/SqlServer.sql @@ -105,6 +105,7 @@ CREATE TABLE JCL_ORG_COMP ( comp_principal int null, description text COLLATE Chinese_PRC_CI_AS NULL, forbidden_tag int NULL, + show_order int null, is_used int null, creator int null, delete_type int null, @@ -120,6 +121,8 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP ( extend_type int null, group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, show_order int null, + is_show varchar(100) COLLATE Chinese_PRC_CI_AS NULL, + is_system_default int null, creator int null, delete_type int null, create_time datetime null, @@ -134,10 +137,11 @@ create table JCL_FIELD_EXTENDTITLE ( title varchar(100) COLLATE Chinese_PRC_CI_AS NULL, show_order int null, is_show int null, + is_system_default int null, creator int null, delete_type int null, - create_time date null, - update_time date null, + create_time datetime null, + update_time datetime null, CONSTRAINT JCL_FIELD_EXTENDTITLE_PK PRIMARY KEY (id) ); @@ -161,6 +165,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO ( add_show int null, browser_show int null, show_order int null, + is_system_default int null, creator int null, delete_type int null, create_time datetime null, @@ -290,6 +295,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 ( CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id) ); +-- JCL_ORG_HRMRESOURCE +CREATE TABLE JCL_ORG_HRMRESOURCE ( + id int IDENTITY(1,1) NOT NULL, + work_code varchar(60) null, + login_id varchar(60) null, + last_name varchar(60) null, + sex int null, + account_type int null, + belong_to int null, + company_id int null, + department_id int null, + job_activity int null, + job_title int null, + job_call int null, + job_level int null, + job_group_id int null, + job_activity_desc varchar(200) null, + status int null, + system_language int null, + resource_image_id varchar(1000) null, + messager_url varchar(1000) null, + location_id int null, + manager_id int null, + assistant_id int null, + mobile varchar(60) null, + telephone varchar(60) null, + mobile_call varchar(60) null, + fax varchar(60) null, + email varchar(60) null, + workroom varchar(60) null, + creator int null, + delete_type int null, + create_time datetime null, + update_time datetime null, + CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (id) +); + +-- JCL_ORG_HRMRESOURCEEXT +CREATE TABLE JCL_ORG_HRMRESOURCEEXT ( + id int IDENTITY(1,1) NOT NULL, + creator int null, + delete_type int null, + create_time datetime null, + update_time datetime null, + CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (id) +); + +-- JCL_ORG_HRMRESOURCEEXT_DT1 +CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 ( + id int IDENTITY(1,1) NOT NULL, + mainid int NULL, + creator int null, + delete_type int null, + create_time datetime null, + update_time datetime null, + CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (id) +); + -- JCL_ORG_STAFFPLAN CREATE TABLE JCL_ORG_STAFFPLAN ( diff --git a/src/com/api/organization/web/HrmResourceController.java b/src/com/api/organization/web/HrmResourceController.java new file mode 100644 index 00000000..bcb62d46 --- /dev/null +++ b/src/com/api/organization/web/HrmResourceController.java @@ -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{ +} diff --git a/src/com/engine/organization/annotation/Log.java b/src/com/engine/organization/annotation/Log.java index 9ef0d9e0..0a7020d1 100644 --- a/src/com/engine/organization/annotation/Log.java +++ b/src/com/engine/organization/annotation/Log.java @@ -4,12 +4,7 @@ import com.engine.organization.enums.OperateTypeEnum; import java.lang.annotation.*; -/** - * @Author dxfeng - * @Description: - * @Date 2022/5/9 - * @Version V1.0 - **/ + @Target({ElementType.PARAMETER, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented diff --git a/src/com/engine/organization/annotation/OrganizationTable.java b/src/com/engine/organization/annotation/OrganizationTable.java index ec6d14bb..7734c21e 100644 --- a/src/com/engine/organization/annotation/OrganizationTable.java +++ b/src/com/engine/organization/annotation/OrganizationTable.java @@ -55,6 +55,13 @@ public @interface OrganizationTable { */ boolean distinct() default false; + + /** + * 排序方式 + * @return + */ + String sortway() default "desc"; + /** * 操作按钮 */ diff --git a/src/com/engine/organization/annotation/TableTitle.java b/src/com/engine/organization/annotation/TableTitle.java index 22893a1a..aff2bf9a 100644 --- a/src/com/engine/organization/annotation/TableTitle.java +++ b/src/com/engine/organization/annotation/TableTitle.java @@ -11,4 +11,6 @@ public @interface TableTitle { String dataIndex(); String key(); boolean display() default true; + String width() default ""; + boolean sorter() default false; } diff --git a/src/com/engine/organization/common/BaseQueryParam.java b/src/com/engine/organization/common/BaseQueryParam.java index c5defd50..b86d5412 100644 --- a/src/com/engine/organization/common/BaseQueryParam.java +++ b/src/com/engine/organization/common/BaseQueryParam.java @@ -19,4 +19,9 @@ public class BaseQueryParam { //每页数据条数 private Integer pageSize = 10; + + /** + * 排序 + */ + private String sortParams; } diff --git a/src/com/engine/organization/component/OrganizationWeaTable.java b/src/com/engine/organization/component/OrganizationWeaTable.java index 35369fbf..43b56438 100644 --- a/src/com/engine/organization/component/OrganizationWeaTable.java +++ b/src/com/engine/organization/component/OrganizationWeaTable.java @@ -38,6 +38,10 @@ public class OrganizationWeaTable extends WeaTable { if (StringUtils.isNotBlank(orderby)) { super.setSqlorderby(orderby); } + String sortway = table.sortway(); + if (StringUtils.isNotBlank(sortway)) { + super.setSqlsortway(sortway); + } String groupby = table.groupby(); if (StringUtils.isNotBlank(groupby)) { super.setSqlgroupby(groupby); diff --git a/src/com/engine/organization/entity/company/bo/CompBO.java b/src/com/engine/organization/entity/company/bo/CompBO.java index 38ce339b..c43b684e 100644 --- a/src/com/engine/organization/entity/company/bo/CompBO.java +++ b/src/com/engine/organization/entity/company/bo/CompBO.java @@ -38,6 +38,7 @@ public class CompBO { .orgCode(e.getOrgCode()) .industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + "")) .compPrincipal(getUserNameById(e.getCompPrincipal() + "")) + .showOrder(e.getShowOrder()) .forbiddenTag(e.getForbiddenTag()) .build()).collect(Collectors.toList()); Map> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany)); diff --git a/src/com/engine/organization/entity/company/dto/CompListDTO.java b/src/com/engine/organization/entity/company/dto/CompListDTO.java index 1e630d21..b533ce18 100644 --- a/src/com/engine/organization/entity/company/dto/CompListDTO.java +++ b/src/com/engine/organization/entity/company/dto/CompListDTO.java @@ -1,7 +1,6 @@ package com.engine.organization.entity.company.dto; import com.engine.organization.annotation.OrganizationTable; -import com.engine.organization.annotation.OrganizationTableOperate; import com.engine.organization.annotation.TableTitle; import lombok.AllArgsConstructor; import lombok.Builder; @@ -20,12 +19,7 @@ import java.util.List; @Builder @NoArgsConstructor @AllArgsConstructor -@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508", - operates = { - @OrganizationTableOperate(text = "编辑"), - @OrganizationTableOperate(index = "1", text = "删除"), - @OrganizationTableOperate(index = "2", text = "查看部门") - }) +@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508") public class CompListDTO { /** * 主键id @@ -56,7 +50,7 @@ public class CompListDTO { /** * 上级公司 */ - @TableTitle(title = "上级公司", dataIndex = "parentCompName", key = "parentCompName") + @TableTitle(title = "上级分部", dataIndex = "parentCompName", key = "parentCompName") private String parentCompName; private Long parentCompany; @@ -79,10 +73,13 @@ public class CompListDTO { @TableTitle(title = "负责人", dataIndex = "compPrincipal", key = "compPrincipal") private String compPrincipal; + @TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true) + private Integer showOrder; + /** * 禁用标记 */ - @TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag") + @TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag") private int forbiddenTag; /** diff --git a/src/com/engine/organization/entity/company/param/CompSearchParam.java b/src/com/engine/organization/entity/company/param/CompSearchParam.java index a82c93b3..1134b99c 100644 --- a/src/com/engine/organization/entity/company/param/CompSearchParam.java +++ b/src/com/engine/organization/entity/company/param/CompSearchParam.java @@ -16,7 +16,7 @@ import lombok.NoArgsConstructor; @Builder @AllArgsConstructor @NoArgsConstructor -public class CompSearchParam extends BaseQueryParam { +public class CompSearchParam extends BaseQueryParam { /** * 主键 diff --git a/src/com/engine/organization/entity/company/po/CompPO.java b/src/com/engine/organization/entity/company/po/CompPO.java index f23ab7cb..c4c61fce 100644 --- a/src/com/engine/organization/entity/company/po/CompPO.java +++ b/src/com/engine/organization/entity/company/po/CompPO.java @@ -69,6 +69,11 @@ public class CompPO { */ private Integer forbiddenTag; + /** + * 显示顺序 + */ + private Integer showOrder; + private Long creator; private int deleteType; private Date createTime; diff --git a/src/com/engine/organization/entity/department/bo/DepartmentBO.java b/src/com/engine/organization/entity/department/bo/DepartmentBO.java index 1a960959..1e46142b 100644 --- a/src/com/engine/organization/entity/department/bo/DepartmentBO.java +++ b/src/com/engine/organization/entity/department/bo/DepartmentBO.java @@ -39,7 +39,7 @@ public class DepartmentBO { .deptPrincipal(getEmployeeNameById(e.getDeptPrincipal())) .showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder()) .forbiddenTag(e.getForbiddenTag()) - .build() ).collect(Collectors.toList()); + .build()).collect(Collectors.toList()); Map> collects = dtoList.stream().filter(item -> null != item.getParentDept() && 0 != item.getParentDept()).collect(Collectors.groupingBy(DepartmentListDTO::getParentDept)); // 处理被引用数据 List usedIds = MapperProxyFactory.getProxy(DepartmentMapper.class).listUsedId(); @@ -109,7 +109,7 @@ public class DepartmentBO { .deptName(e.getDeptName()) .parentComp(e.getParentComp()) .parentDept(e.getParentDept()) - .parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept().intValue())) + .parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept())) .deptPrincipalName(getEmployeeNameById(e.getDeptPrincipal())) .build()).collect(Collectors.toList()); //获取非一级部门 @@ -118,13 +118,17 @@ public class DepartmentBO { return singleDeptTreeVOS.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> parentComp.equals(item.getParentComp())).collect(Collectors.toList()); } - public static List buildSetToSearchTree(Set departmentPOS) { + return buildSetToSearchTree(departmentPOS, true); + } + + + public static List buildSetToSearchTree(Set departmentPOS, boolean isLeaf) { return departmentPOS.stream().map(item -> { SearchTree tree = new SearchTree(); tree.setCanClick(true); tree.setCanceled(false); - tree.setIcon("icon-coms-Branch"); + tree.setIcon(isLeaf ? "icon-coms-Branch" : "icon-coms-LargeArea"); tree.setId(item.getId().toString()); tree.setIsParent(false); tree.setIsVirtual("0"); @@ -138,7 +142,7 @@ public class DepartmentBO { } - public static String getDeptNameById(Integer id) { + public static String getDeptNameById(Long id) { return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id); } diff --git a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java index b7c24e29..94e401ba 100644 --- a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java +++ b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java @@ -2,7 +2,6 @@ package com.engine.organization.entity.department.dto; import com.cloudstore.eccom.pc.table.WeaTableType; import com.engine.organization.annotation.OrganizationTable; -import com.engine.organization.annotation.OrganizationTableOperate; import com.engine.organization.annotation.TableTitle; import lombok.AllArgsConstructor; import lombok.Builder; @@ -22,15 +21,7 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor @OrganizationTable(pageId = "96f2bb0d-da73-11ec-a0da-00ffcbed7508", - tableType = WeaTableType.NONE, - operates = { - @OrganizationTableOperate(text = "编辑"), - @OrganizationTableOperate(index = "1", text = "删除"), - @OrganizationTableOperate(index = "2", text = "合并"), - @OrganizationTableOperate(index = "3", text = "转移"), - @OrganizationTableOperate(index = "4", text = "联查岗位"), - @OrganizationTableOperate(index = "4", text = "联查人员") - }) + tableType = WeaTableType.NONE) public class DepartmentListDTO { private Long id; @@ -38,11 +29,6 @@ public class DepartmentListDTO { * 是否被引用 */ private Integer isUsed; - /** - * 编号 - */ - @TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo") - private String deptNo; /** * 名称 @@ -50,6 +36,12 @@ public class DepartmentListDTO { @TableTitle(title = "名称", dataIndex = "deptName", key = "deptName") private String deptName; + /** + * 编号 + */ + @TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo") + private String deptNo; + /** * 简称 */ @@ -79,7 +71,7 @@ public class DepartmentListDTO { /** * 显示顺序 */ - @TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder") + @TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder",sorter = true) private int showOrder; ///** @@ -91,7 +83,7 @@ public class DepartmentListDTO { /** * 禁用标记 */ - @TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag") + @TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag") private int forbiddenTag; /** * 操作列 diff --git a/src/com/engine/organization/entity/extend/bo/ExtendGroupBO.java b/src/com/engine/organization/entity/extend/bo/ExtendGroupBO.java index 76614a44..a746d1cc 100644 --- a/src/com/engine/organization/entity/extend/bo/ExtendGroupBO.java +++ b/src/com/engine/organization/entity/extend/bo/ExtendGroupBO.java @@ -31,6 +31,7 @@ public class ExtendGroupBO { TypeTreeVO.builder() .canClick(true) .addChild(e.getPid() == null) + .isSelected(isSelect(e.getId())) .domid(String.valueOf(e.getId())) .childs(Lists.newArrayList()) .hasGroup(isHasGroup(e.getId())) @@ -74,6 +75,9 @@ public class ExtendGroupBO { case 3: tableName = "JCL_ORG_JOB"; break; + case 4: + tableName = "JCL_ORG_HRMRESOURCE"; + break; default: break; } @@ -87,4 +91,13 @@ public class ExtendGroupBO { } return tableName; } + + + private static boolean isSelect(Long id) { + if (id == 1 || id == 2 || id == 3 || id ==4) { + return true; + }else { + return false; + } + } } diff --git a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java index 0adfead5..e9650393 100644 --- a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java +++ b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java @@ -1,5 +1,7 @@ package com.engine.organization.entity.extend.bo; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.api.browser.bean.BrowserBean; import com.api.browser.bean.BrowserValueInfo; import com.api.browser.bean.SearchConditionItem; @@ -106,7 +108,7 @@ public class ExtendInfoBO { .editShow("0".equals(infoFieldParam.getIsModify()) ? 0 : 1) .addShow(1) .browserShow(1) - .customValue(infoFieldParam.getFieldType().toString()) + .customValue(convertSelectCustom(controlType, infoFieldParam.getFieldType().toString())) .showOrder(showOrder) // 非系统初始化字段 .isSystemDefault(1) @@ -116,6 +118,31 @@ public class ExtendInfoBO { .build(); } + private static String convertSelectCustom(String controlType, String fieldType) { + if (!"5".equals(controlType)) { + return fieldType; + } + JSONArray objects = JSONObject.parseArray(fieldType); + if (objects.size() < 3) { + return objects.toString(); + } + JSONObject o = (JSONObject) objects.get(2); + JSONArray datas = o.getJSONArray("datas"); + if (!datas.isEmpty()) { + int size = datas.size(); + for (int i = 0; i < size; i++) { + JSONObject jsonObject = (JSONObject) datas.get(i); + if (StringUtils.isBlank(jsonObject.getString("id"))) { + jsonObject.put("id", i + ""); + } + if (StringUtils.isBlank(jsonObject.getString("key"))) { + jsonObject.put("key", i + ""); + } + } + } + return objects.toString(); + } + /** * 当前自定义字段是否已使用 * @@ -174,7 +201,7 @@ public class ExtendInfoBO { // 必填 if (1 == extendInfoPO.getIsrequired()) { fieldItem.setViewAttr(3); - fieldItem.setRules("required|string"); + fieldItem.setRules("required"); } else { fieldItem.setViewAttr(2); } diff --git a/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java b/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java index 7e055d9c..e8ea88b0 100644 --- a/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java +++ b/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java @@ -7,7 +7,6 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import org.apache.commons.lang.StringUtils; import weaver.general.Util; /** @@ -110,21 +109,4 @@ public class ExtendInfoFieldParam { } return fp.getFielddbtype(); } - - public static String toDbc(String input) { - if (StringUtils.isBlank(input)) { - return ""; - } - char[] c = input.toCharArray(); - for (int i = 0; i < c.length; i++) { - if (c[i] == 12288) { - c[i] = (char) 32; - continue; - } - if (c[i] > 65280 && c[i] < 65375) { - c[i] = (char) (c[i] - 65248); - } - } - return new String(c); - } } \ No newline at end of file diff --git a/src/com/engine/organization/entity/extend/param/ExtendInfoParams.java b/src/com/engine/organization/entity/extend/param/ExtendInfoParams.java new file mode 100644 index 00000000..50959aa5 --- /dev/null +++ b/src/com/engine/organization/entity/extend/param/ExtendInfoParams.java @@ -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 params; +} diff --git a/src/com/engine/organization/entity/fieldset/vo/TypeTreeVO.java b/src/com/engine/organization/entity/fieldset/vo/TypeTreeVO.java index 32c09f11..1b4f18a9 100644 --- a/src/com/engine/organization/entity/fieldset/vo/TypeTreeVO.java +++ b/src/com/engine/organization/entity/fieldset/vo/TypeTreeVO.java @@ -69,4 +69,7 @@ public class TypeTreeVO { //父节点id private Long pid; + public boolean getIsSelected() { + return isSelected; + } } diff --git a/src/com/engine/organization/entity/hrmresource/param/HrmResourceSearchParam.java b/src/com/engine/organization/entity/hrmresource/param/HrmResourceSearchParam.java new file mode 100644 index 00000000..5ac816b4 --- /dev/null +++ b/src/com/engine/organization/entity/hrmresource/param/HrmResourceSearchParam.java @@ -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; +} diff --git a/src/com/engine/organization/entity/hrmresource/po/HrmResourcePO.java b/src/com/engine/organization/entity/hrmresource/po/HrmResourcePO.java new file mode 100644 index 00000000..678f639a --- /dev/null +++ b/src/com/engine/organization/entity/hrmresource/po/HrmResourcePO.java @@ -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; +} diff --git a/src/com/engine/organization/entity/hrmresource/vo/HrmResourceVO.java b/src/com/engine/organization/entity/hrmresource/vo/HrmResourceVO.java new file mode 100644 index 00000000..a23c5e4e --- /dev/null +++ b/src/com/engine/organization/entity/hrmresource/vo/HrmResourceVO.java @@ -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; +} diff --git a/src/com/engine/organization/entity/job/bo/JobBO.java b/src/com/engine/organization/entity/job/bo/JobBO.java index 5e8bec08..9e9d294c 100644 --- a/src/com/engine/organization/entity/job/bo/JobBO.java +++ b/src/com/engine/organization/entity/job/bo/JobBO.java @@ -4,6 +4,7 @@ import com.engine.organization.entity.job.dto.JobListDTO; import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.vo.SingleJobTreeVO; +import com.engine.organization.entity.searchtree.SearchTree; import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.transmethod.JobTransMethod; import com.engine.organization.util.db.MapperProxyFactory; @@ -39,6 +40,7 @@ public class JobBO { .description(param.getDescription()) .workDuty(param.getWorkDuty()) .workAuthority(param.getWorkAuthority()) + .showOrder(param.getShowOrder()) .forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1) .deleteType(0) .createTime(new Date()) @@ -87,6 +89,7 @@ public class JobBO { .parentJob(e.getParentJob()) .parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName()) .isKey(JobTransMethod.getIsKeySpan(e.getIsKey())) + .showOrder(e.getShowOrder()) .forbiddenTag(e.getForbiddenTag()) .build()).collect(Collectors.toList()); Map> 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 buildSetToSearchTree(Set 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()); + + } } diff --git a/src/com/engine/organization/entity/job/dto/JobListDTO.java b/src/com/engine/organization/entity/job/dto/JobListDTO.java index 28b7c573..652e331d 100644 --- a/src/com/engine/organization/entity/job/dto/JobListDTO.java +++ b/src/com/engine/organization/entity/job/dto/JobListDTO.java @@ -2,7 +2,6 @@ package com.engine.organization.entity.job.dto; import com.cloudstore.eccom.pc.table.WeaTableType; import com.engine.organization.annotation.OrganizationTable; -import com.engine.organization.annotation.OrganizationTableOperate; import com.engine.organization.annotation.TableTitle; import lombok.AllArgsConstructor; import lombok.Builder; @@ -22,15 +21,7 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor @OrganizationTable(pageId = "0efea835-dfc5-11ec-a09e-00e04c680716", - tableType = WeaTableType.NONE, - operates = { - @OrganizationTableOperate(text = "编辑"), - @OrganizationTableOperate(index = "1", text = "删除"), - @OrganizationTableOperate(index = "2", text = "合并"), - @OrganizationTableOperate(index = "3", text = "转移"), - @OrganizationTableOperate(index = "4", text = "联查岗位"), - @OrganizationTableOperate(index = "4", text = "联查人员") - }) + tableType = WeaTableType.NONE) public class JobListDTO { /** * 主键 @@ -82,10 +73,16 @@ public class JobListDTO { @TableTitle(title = "是否关键岗", dataIndex = "isKey", key = "isKey") private String isKey; + /** + * 显示顺序 + */ + @TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true) + private Integer showOrder; + /** * 禁用标记 */ - @TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag") + @TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag") private Integer forbiddenTag; /** diff --git a/src/com/engine/organization/entity/job/param/JobMergeParam.java b/src/com/engine/organization/entity/job/param/JobMergeParam.java new file mode 100644 index 00000000..b5629f38 --- /dev/null +++ b/src/com/engine/organization/entity/job/param/JobMergeParam.java @@ -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; +} diff --git a/src/com/engine/organization/entity/job/param/JobSearchParam.java b/src/com/engine/organization/entity/job/param/JobSearchParam.java index c1da3d3b..2d7cc07a 100644 --- a/src/com/engine/organization/entity/job/param/JobSearchParam.java +++ b/src/com/engine/organization/entity/job/param/JobSearchParam.java @@ -74,6 +74,11 @@ public class JobSearchParam extends BaseQueryParam { */ private Boolean forbiddenTag; + /** + * 显示顺序 + */ + private Integer showOrder; + private Long subcompanyid1; private Long departmentid; diff --git a/src/com/engine/organization/entity/job/po/JobPO.java b/src/com/engine/organization/entity/job/po/JobPO.java index a99bb164..79be008f 100644 --- a/src/com/engine/organization/entity/job/po/JobPO.java +++ b/src/com/engine/organization/entity/job/po/JobPO.java @@ -74,6 +74,10 @@ public class JobPO { * 禁用标记 */ private Integer forbiddenTag; + /** + * 显示顺序 + */ + private Integer showOrder; private Long creator; diff --git a/src/com/engine/organization/entity/postion/dto/PostDTO.java b/src/com/engine/organization/entity/postion/dto/PostDTO.java index 51de900f..b1058917 100644 --- a/src/com/engine/organization/entity/postion/dto/PostDTO.java +++ b/src/com/engine/organization/entity/postion/dto/PostDTO.java @@ -17,7 +17,6 @@ public class PostDTO { } return PostPO.builder() .id(postPO.getId() == null ? 0 : postPO.getId()) - .postNo(postPO.getPostNo() == null ? null : postPO.getPostNo()) .postName(postPO.getPostName() == null ? null : postPO.getPostName()) .description(postPO.getDescription() == null ? null : postPO.getDescription()) .deleteType(0) diff --git a/src/com/engine/organization/entity/postion/po/PostPO.java b/src/com/engine/organization/entity/postion/po/PostPO.java index e9f07b1f..292df986 100644 --- a/src/com/engine/organization/entity/postion/po/PostPO.java +++ b/src/com/engine/organization/entity/postion/po/PostPO.java @@ -22,10 +22,6 @@ public class PostPO { * 主键 */ private Long id; - /** - * 编号 - */ - private String postNo; /** * 名称 */ diff --git a/src/com/engine/organization/entity/postion/vo/PostInfoTableVO.java b/src/com/engine/organization/entity/postion/vo/PostInfoTableVO.java index 58bd87d5..c89837c7 100644 --- a/src/com/engine/organization/entity/postion/vo/PostInfoTableVO.java +++ b/src/com/engine/organization/entity/postion/vo/PostInfoTableVO.java @@ -29,7 +29,8 @@ import lombok.NoArgsConstructor; " t.description," + " t.forbidden_tag", fromSql = " from jcl_org_post_info t inner join jcl_org_post a on t.post_id = a.id ", - orderby = "id desc", + orderby = "post_info_no", + sortway = "asc", primarykey = "id", operates = { @OrganizationTableOperate(index = "0", text = "编辑"), @@ -45,7 +46,7 @@ public class PostInfoTableVO { /** * 编号 */ - @OrganizationTableColumn(text = "编号", width = "20%", column = "post_info_no") + @OrganizationTableColumn(text = "编号", width = "20%", column = "post_info_no", orderkey = "post_info_no") private String postInfoNo; /** * 名称 @@ -81,6 +82,6 @@ public class PostInfoTableVO { /** * 禁用标记 */ - @OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag") + @OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag") private Integer forbiddenTag; } diff --git a/src/com/engine/organization/entity/scheme/vo/GradeTableVO.java b/src/com/engine/organization/entity/scheme/vo/GradeTableVO.java index ef037941..2934666f 100644 --- a/src/com/engine/organization/entity/scheme/vo/GradeTableVO.java +++ b/src/com/engine/organization/entity/scheme/vo/GradeTableVO.java @@ -27,7 +27,8 @@ import lombok.NoArgsConstructor; " t.forbidden_tag," + "t.is_used", fromSql = "from jcl_org_grade t inner join jcl_org_scheme a on t.scheme_id = a.id ", - orderby = "id desc", + orderby = "grade_no", + sortway = "asc", primarykey = "id", operates = { @OrganizationTableOperate(text = "编辑"), @@ -52,7 +53,7 @@ public class GradeTableVO { /** * 编号 */ - @OrganizationTableColumn(text = "编号", width = "20%", column = "grade_no") + @OrganizationTableColumn(text = "编号", width = "20%", column = "grade_no", orderkey = "grade_no") private String gradeNo; /** * 名称 @@ -82,6 +83,6 @@ public class GradeTableVO { /** * 禁用标记 */ - @OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag") + @OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag") private int forbiddenTag; } diff --git a/src/com/engine/organization/entity/scheme/vo/LevelTableVO.java b/src/com/engine/organization/entity/scheme/vo/LevelTableVO.java index f33db78a..46f8b8d2 100644 --- a/src/com/engine/organization/entity/scheme/vo/LevelTableVO.java +++ b/src/com/engine/organization/entity/scheme/vo/LevelTableVO.java @@ -26,7 +26,8 @@ import lombok.NoArgsConstructor; "t.create_time," + "t.update_time", fromSql = "FROM jcl_org_level t inner join jcl_org_scheme s on t.scheme_id = s.id ", - orderby = "id desc", + orderby = "level_no", + sortway = "asc", primarykey = "id", operates = { @OrganizationTableOperate(text = "编辑"), @@ -50,7 +51,7 @@ public class LevelTableVO { /** * 编号 */ - @OrganizationTableColumn(text = "编号", width = "20%", column = "level_no") + @OrganizationTableColumn(text = "编号", width = "20%", column = "level_no", orderkey = "level_no") private String levelNo; /** * 名称 @@ -73,6 +74,6 @@ public class LevelTableVO { /** * 禁用标记 */ - @OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag") + @OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag") private Integer forbiddenTag; } diff --git a/src/com/engine/organization/entity/scheme/vo/SchemeTableVO.java b/src/com/engine/organization/entity/scheme/vo/SchemeTableVO.java index ed40b29c..1062b88b 100644 --- a/src/com/engine/organization/entity/scheme/vo/SchemeTableVO.java +++ b/src/com/engine/organization/entity/scheme/vo/SchemeTableVO.java @@ -24,7 +24,8 @@ import lombok.NoArgsConstructor; "t.create_time," + "t.update_time", fromSql = "FROM jcl_org_scheme t ", - orderby = "id desc", + orderby = "scheme_no", + sortway = "asc", primarykey = "id", operates = { @OrganizationTableOperate(index = "0", text = "编辑"), @@ -49,7 +50,7 @@ public class SchemeTableVO { /** * 方案编号 */ - @OrganizationTableColumn(text = "编号", width = "25%", column = "scheme_no") + @OrganizationTableColumn(text = "编号", width = "25%", column = "scheme_no", orderkey = "scheme_no") private String schemeNo; /** * 方案名称 @@ -66,6 +67,6 @@ public class SchemeTableVO { /** * 禁用标识 */ - @OrganizationTableColumn(text = "禁用标记", width = "25%", column = "forbidden_tag") + @OrganizationTableColumn(text = "是否启用", width = "25%", column = "forbidden_tag") private Integer forbiddenTag; } diff --git a/src/com/engine/organization/entity/sequence/vo/SequenceTableVO.java b/src/com/engine/organization/entity/sequence/vo/SequenceTableVO.java index b061d363..93c1722c 100644 --- a/src/com/engine/organization/entity/sequence/vo/SequenceTableVO.java +++ b/src/com/engine/organization/entity/sequence/vo/SequenceTableVO.java @@ -30,7 +30,8 @@ import lombok.NoArgsConstructor; "t.create_time," + "t.update_time", fromSql = "FROM jcl_org_sequence t inner join jcl_org_scheme s on t.scheme_id = s.id ", - orderby = "id desc", + orderby = "sequence_no", + sortway = "asc", primarykey = "id", operates = { @OrganizationTableOperate(text = "编辑"), @@ -43,42 +44,42 @@ import lombok.NoArgsConstructor; ) public class SequenceTableVO { - /** - * 主键 - */ - @OrganizationTableColumn(column = "id", display = false) - private Long id; - /** - * 是否被引用 - */ - @OrganizationTableColumn(column = "isUsed", display = false) - private Integer isUsed; - /** - * 编号 - */ - @OrganizationTableColumn(text = "编号", width = "20%", column = "sequence_no") - private String sequenceNo; - /** - * 名称 - */ - @OrganizationTableColumn(text = "名称", width = "20%", column = "sequence_name") - private String sequenceName; + /** + * 主键 + */ + @OrganizationTableColumn(column = "id", display = false) + private Long id; + /** + * 是否被引用 + */ + @OrganizationTableColumn(column = "isUsed", display = false) + private Integer isUsed; + /** + * 编号 + */ + @OrganizationTableColumn(text = "编号", width = "20%", column = "sequence_no", orderkey = "sequence_no") + private String sequenceNo; + /** + * 名称 + */ + @OrganizationTableColumn(text = "名称", width = "20%", column = "sequence_name") + private String sequenceName; - /** - * 描述说明 - */ - @OrganizationTableColumn(text = "描述说明", width = "20%", column = "description") - private String description; + /** + * 描述说明 + */ + @OrganizationTableColumn(text = "描述说明", width = "20%", column = "description") + private String description; - /** - * 等级方案 - */ - @OrganizationTableColumn(text = "等级方案", width = "20%", column = "scheme_name") - private String schemeName; + /** + * 等级方案 + */ + @OrganizationTableColumn(text = "等级方案", width = "20%", column = "scheme_name") + private String schemeName; - /** - * 禁用标记 - */ - @OrganizationTableColumn(text = "禁用标记", width = "20%", column = "forbidden_tag") - private Integer forbiddenTag; + /** + * 禁用标记 + */ + @OrganizationTableColumn(text = "是否启用", width = "20%", column = "forbidden_tag") + private Integer forbiddenTag; } diff --git a/src/com/engine/organization/entity/staff/param/StaffSearchParam.java b/src/com/engine/organization/entity/staff/param/StaffSearchParam.java index 95773df5..49fb0f68 100644 --- a/src/com/engine/organization/entity/staff/param/StaffSearchParam.java +++ b/src/com/engine/organization/entity/staff/param/StaffSearchParam.java @@ -75,4 +75,9 @@ public class StaffSearchParam { * 调整数量 */ private Integer changeNum; + + /** + * 调整说明 + */ + private String changeDescription; } diff --git a/src/com/engine/organization/entity/staff/po/StaffsPO.java b/src/com/engine/organization/entity/staff/po/StaffsPO.java index a68211ad..d424a5c4 100644 --- a/src/com/engine/organization/entity/staff/po/StaffsPO.java +++ b/src/com/engine/organization/entity/staff/po/StaffsPO.java @@ -43,6 +43,11 @@ public class StaffsPO { */ private Integer requestId; + /** + * 调整说明 + */ + private String description; + private Long creator; private int deleteType; private Date createTime; diff --git a/src/com/engine/organization/entity/staff/vo/StaffPlanTableVO.java b/src/com/engine/organization/entity/staff/vo/StaffPlanTableVO.java index 01bae639..e2da7e3f 100644 --- a/src/com/engine/organization/entity/staff/vo/StaffPlanTableVO.java +++ b/src/com/engine/organization/entity/staff/vo/StaffPlanTableVO.java @@ -20,7 +20,8 @@ import lombok.NoArgsConstructor; @OrganizationTable(pageId = "e04abd72-dbd6-11ec-b69e-00ffcbed7508", fields = "t.id,t.is_used, t.plan_no, t.plan_name, t.plan_year, t.time_start, t.time_end, t.forbidden_tag", fromSql = "FROM jcl_org_staffplan t ", - orderby = "id desc", + orderby = "plan_no", + sortway = "asc", primarykey = "id", operates = { @OrganizationTableOperate(text = "编辑"), @@ -46,7 +47,7 @@ public class StaffPlanTableVO { /** * 编号 */ - @OrganizationTableColumn(text = "编号", width = "16%", column = "plan_no") + @OrganizationTableColumn(text = "编号", width = "16%", column = "plan_no", orderkey = "plan_no") private String planNo; /** * 名称 @@ -71,7 +72,7 @@ public class StaffPlanTableVO { /** * 状态 */ - @OrganizationTableColumn(text = "状态", width = "16%", column = "forbidden_tag") + @OrganizationTableColumn(text = "是否启用", width = "16%", column = "forbidden_tag") private Integer forbiddenTag; } diff --git a/src/com/engine/organization/mapper/comp/CompMapper.java b/src/com/engine/organization/mapper/comp/CompMapper.java index 33477e2a..8f10abcc 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.java +++ b/src/com/engine/organization/mapper/comp/CompMapper.java @@ -19,7 +19,7 @@ public interface CompMapper { * * @return */ - List list(); + List list(@Param("orderSql") String orderSql); /** * 查询所有被引用的ID @@ -33,7 +33,7 @@ public interface CompMapper { * * @return */ - List listByFilter(CompPO compPO); + List listByFilter(@Param("compPO") CompPO compPO, @Param("orderSql") String orderSql); /** * 获取顶级数据 @@ -95,13 +95,13 @@ public interface CompMapper { /** * 根据ID批量查询数据 + * * @param ids * @return */ List getCompsByIds(@Param("ids") Collection ids); - /** * 保存公司/分部基础信息 * @@ -133,4 +133,11 @@ public interface CompMapper { * @param ids */ int deleteByIds(@Param("ids") Collection ids); + + /** + * 获取最大排序 + * + * @return + */ + int getMaxShowOrder(); } diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index 042a8b3f..d22ac668 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -12,6 +12,7 @@ + @@ -32,6 +33,7 @@ , t.comp_principal , t.description , t.forbidden_tag + , t.show_order , t.creator , t.delete_type , t.create_time @@ -91,6 +93,9 @@ description, forbidden_tag, + + show_order, + @@ -130,6 +135,7 @@ #{description}, 0, + #{showOrder}, @@ -138,7 +144,7 @@ FROM jcl_org_comp t - WHERE t.delete_type = 0 + WHERE t.delete_type = 0 order by ${orderSql} - SELECT FROM jcl_org_comp t WHERE t.delete_type = 0 - - and t.parent_company = #{parentCompany} + + and t.parent_company = #{compPO.parentCompany} - - and t.industry = #{industry} + + and t.industry = #{compPO.industry} - - and t.comp_principal = #{compPrincipal} + + and t.comp_principal = #{compPO.compPrincipal} - - and t.forbidden_tag = #{forbiddenTag} + + and t.forbidden_tag = #{compPO.forbiddenTag} + order by ${orderSql} + update jcl_org_comp @@ -282,52 +292,53 @@ industry=#{industry}, comp_principal=#{compPrincipal}, description=#{description}, + show_order=#{showOrder}, WHERE id = #{id} AND delete_type = 0 - - and t.comp_no like CONCAT('%',#{compNo},'%') + + and t.comp_no like CONCAT('%',#{compPO.compNo},'%') - - and t.comp_name like CONCAT('%',#{compName},'%') + + and t.comp_name like CONCAT('%',#{compPO.compName},'%') - - and t.comp_name_short like CONCAT('%',#{compNameShort},'%') + + and t.comp_name_short like CONCAT('%',#{compPO.compNameShort},'%') - - and t.org_code like CONCAT('%',#{orgCode},'%') + + and t.org_code like CONCAT('%',#{compPO.orgCode},'%') - - and t.comp_no like '%'||#{compNo}||'%' + + and t.comp_no like '%'||#{compPO.compNo}||'%' - - and t.comp_name like '%'||#{compName}||'%' + + and t.comp_name like '%'||#{compPO.compName}||'%' - - and t.comp_name_short like '%'||#{compNameShort}||'%' + + and t.comp_name_short like '%'||#{compPO.compNameShort}||'%' - - and t.org_code like '%'||#{orgCode}||'%' + + and t.org_code like '%'||#{compPO.orgCode}||'%' - - and t.comp_no like '%'+#{compNo}+'%' + + and t.comp_no like '%'+#{compPO.compNo}+'%' - - and t.comp_name like '%'+#{compName}+'%' + + and t.comp_name like '%'+#{compPO.compName}+'%' - - and t.comp_name_short like '%'+#{compNameShort}+'%' + + and t.comp_name_short like '%'+#{compPO.compNameShort}+'%' - - and t.org_code like '%'+#{orgCode}+'%' + + and t.org_code like '%'+#{compPO.orgCode}+'%' diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.java b/src/com/engine/organization/mapper/department/DepartmentMapper.java index 0df6b635..8445ee0e 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.java +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.java @@ -27,7 +27,7 @@ public interface DepartmentMapper { * * @return */ - List list(); + List list(@Param("orderSql") String orderSql); /** * 根据No查询数据 @@ -42,7 +42,7 @@ public interface DepartmentMapper { * * @return */ - List listByFilter(DepartmentPO departmentPO); + List listByFilter(@Param("departmentPO") DepartmentPO departmentPO, @Param("orderSql") String orderSql); /** * 浏览按钮展示数据用 @@ -52,6 +52,8 @@ public interface DepartmentMapper { */ List> listDeptsByIds(@Param("ids") Collection ids); + List getDeptsByIds(@Param("ids") Collection ids); + /** * 根据ID查询数据 * @@ -66,7 +68,7 @@ public interface DepartmentMapper { * @param id * @return */ - String getDeptNameById(@Param("id") int id); + String getDeptNameById(@Param("id") Long id); /** * 添加数据 @@ -92,14 +94,6 @@ public interface DepartmentMapper { */ int updateForbiddenTagById(DepartmentPO departmentPO); - /** - * 批量禁用部门 - * - * @param ids - * @return - */ - int forbiddenDepartmentByIds(@Param("ids") Collection ids); - /** * 批量删除 * @@ -113,4 +107,11 @@ public interface DepartmentMapper { * @return */ List listUsedId(); + + /** + * 获取最大排序 + * + * @return + */ + int getMaxShowOrder(); } diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml index e5ec0fff..ea6e20ed 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -62,21 +62,22 @@ from jcl_org_dept t where delete_type = 0 - - and t.parent_comp = #{parentComp} + + and t.parent_comp = #{departmentPO.parentComp} - - and t.parent_dept = #{parentDept} + + and t.parent_dept = #{departmentPO.parentDept} - - and t.dept_principal = #{deptPrincipal} + + and t.dept_principal = #{departmentPO.deptPrincipal} - - and t.show_order = #{showOrder} + + and t.show_order = #{departmentPO.showOrder} - - and t.forbidden_tag = #{forbiddenTag} + + and t.forbidden_tag = #{departmentPO.forbiddenTag} + order by ${orderSql} + + + forbidden_tag=#{forbiddenTag}, + WHERE id = #{id} AND delete_type = 0 @@ -244,48 +262,41 @@ #{id} - - update jcl_org_dept set forbidden_tag = 1 WHERE delete_type = 0 - AND id IN - - #{id} - - - - and t.dept_no like CONCAT('%',#{deptNo},'%') + + and t.dept_no like CONCAT('%',#{departmentPO.deptNo},'%') - - and t.dept_name like CONCAT('%',#{deptName},'%') + + and t.dept_name like CONCAT('%',#{departmentPO.deptName},'%') - - and t.dept_name_short like CONCAT('%',#{deptNameShort},'%') + + and t.dept_name_short like CONCAT('%',#{departmentPO.deptNameShort},'%') - - and t.dept_no like '%'||#{deptNo}||'%' + + and t.dept_no like '%'||#{departmentPO.deptNo}||'%' - - and t.dept_name like '%'||#{deptName}||'%' + + and t.dept_name like '%'||#{departmentPO.deptName}||'%' - - and t.dept_name_short like '%'||#{deptNameShort}||'%' + + and t.dept_name_short like '%'||#{departmentPO.deptNameShort}||'%' - - and t.dept_no like '%'+#{deptNo}+'%' + + and t.dept_no like '%'+#{departmentPO.deptNo}+'%' - - and t.dept_name like '%'+#{deptName}+'%' + + and t.dept_name like '%'+#{departmentPO.deptName}+'%' - - and t.dept_name_short like '%'+#{deptNameShort}+'%' + + and t.dept_name_short like '%'+#{departmentPO.deptNameShort}+'%' diff --git a/src/com/engine/organization/mapper/extend/ExtMapper.java b/src/com/engine/organization/mapper/extend/ExtMapper.java index 1a258c10..247d5e15 100644 --- a/src/com/engine/organization/mapper/extend/ExtMapper.java +++ b/src/com/engine/organization/mapper/extend/ExtMapper.java @@ -1,6 +1,6 @@ package com.engine.organization.mapper.extend; -import org.apache.ibatis.annotations.Param; +import com.engine.organization.entity.extend.param.ExtendInfoParams; import java.util.Map; @@ -15,34 +15,32 @@ public interface ExtMapper { /** * 根据主表id,查询主表拓展表数据 * - * @param tableName - * @param id + * @param params * @return */ - Map listExt(@Param("tableName") String tableName, @Param("fields") String fields, @Param("id") long id); + Map listExt(ExtendInfoParams params); /** * 判断当前数据是否存在 * - * @param tableName - * @param id + * @param params * @return */ - int countExtById(@Param("tableName") String tableName, @Param("id") long id); + int countExtById(ExtendInfoParams params); /** * 插入主表拓展表 * - * @param map + * @param params * @return */ - int insertExt(@Param("tableName") String tableName, @Param("map") Map map); + int insertExt(ExtendInfoParams params); /** * 更新主表拓展表 * - * @param map + * @param params * @return */ - int updateExt(@Param("tableName") String tableName, @Param("id") long id, @Param("map") Map map); + int updateExt(ExtendInfoParams params); } diff --git a/src/com/engine/organization/mapper/extend/ExtMapper.xml b/src/com/engine/organization/mapper/extend/ExtMapper.xml index 612c228b..05c24278 100644 --- a/src/com/engine/organization/mapper/extend/ExtMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtMapper.xml @@ -2,36 +2,38 @@ - - + insert into ${tableName} ( - + ${key} ) values ( - + #{value} ) - + update ${tableName} set - + ${key} = #{value} where id = #{id} - select ${fields} from ${tableName} where delete_type = 0 and id = #{id} - select count(1) from ${tableName} where delete_type = 0 diff --git a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml index 725c17ac..eddb6dca 100644 --- a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml @@ -269,7 +269,6 @@ + + - - and t.job_no like CONCAT('%',#{jobNo},'%') + + and t.job_no like CONCAT('%',#{jobPO.jobNo},'%') - - and t.job_name like CONCAT('%',#{jobName},'%') + + and t.job_name like CONCAT('%',#{jobPO.jobName},'%') - - and t.workplace like CONCAT('%',#{workplace},'%') + + and t.workplace like CONCAT('%',#{jobPO.workplace},'%') - - and t.description like CONCAT('%',#{description},'%') + + and t.description like CONCAT('%',#{jobPO.description},'%') - - and t.work_duty like CONCAT('%',#{workDuty},'%') + + and t.work_duty like CONCAT('%',#{jobPO.workDuty},'%') - - and t.work_authority like CONCAT('%',#{workAuthority},'%') + + and t.work_authority like CONCAT('%',#{jobPO.workAuthority},'%') - - and t.job_no like '%'||#{jobNo}||'%' + + and t.job_no like '%'||#{jobPO.jobNo}||'%' - - and t.job_name like '%'||#{jobName}||'%' + + and t.job_name like '%'||#{jobPO.jobName}||'%' - - and t.workplace like '%'||#{workplace}||'%' + + and t.workplace like '%'||#{jobPO.workplace}||'%' - - and t.description like '%'||#{description}||'%' + + and t.description like '%'||#{jobPO.description}||'%' - - and t.work_duty like '%'||#{workDuty}||'%' + + and t.work_duty like '%'||#{jobPO.workDuty}||'%' - - and t.work_authority like '%'||#{workAuthority}||'%' + + and t.work_authority like '%'||#{jobPO.workAuthority}||'%' - - and t.job_no like '%'+#{jobNo}+'%' + + and t.job_no like '%'+#{jobPO.jobNo}+'%' - - and t.job_name like '%'+#{jobName}+'%' + + and t.job_name like '%'+#{jobPO.jobName}+'%' - - and t.workplace like '%'+#{workplace}+'%' + + and t.workplace like '%'+#{jobPO.workplace}+'%' - - and t.description like '%'+#{description}+'%' + + and t.description like '%'+#{jobPO.description}+'%' - - and t.work_duty like '%'+#{workDuty}+'%' + + and t.work_duty like '%'+#{jobPO.workDuty}+'%' - - and t.work_authority like '%'+#{workAuthority}+'%' + + and t.work_authority like '%'+#{jobPO.workAuthority}+'%' \ No newline at end of file diff --git a/src/com/engine/organization/mapper/post/PostMapper.java b/src/com/engine/organization/mapper/post/PostMapper.java index 0ec48e85..db7ab1a0 100644 --- a/src/com/engine/organization/mapper/post/PostMapper.java +++ b/src/com/engine/organization/mapper/post/PostMapper.java @@ -18,15 +18,6 @@ import java.util.Map; * @Version V1.0 **/ public interface PostMapper { - - /** - * 根据No查询职务分类 - * - * @param postNo - * @return - */ - List listByNo(@Param("postNo") String postNo); - /** * 获取职务分类根据ID * diff --git a/src/com/engine/organization/mapper/post/PostMapper.xml b/src/com/engine/organization/mapper/post/PostMapper.xml index 3604960f..df766b4b 100644 --- a/src/com/engine/organization/mapper/post/PostMapper.xml +++ b/src/com/engine/organization/mapper/post/PostMapper.xml @@ -3,7 +3,6 @@ - @@ -22,7 +21,6 @@ t . id - , t.post_no , t.post_name , t.description , t.creator @@ -37,13 +35,6 @@ from jcl_org_post t where id = #{id} AND delete_type = 0 - - - select @@ -68,6 +75,11 @@ from JCL_ORG_JOBDT where delete_type = 0 + update jcl_org_level diff --git a/src/com/engine/organization/mapper/scheme/SchemeMapper.java b/src/com/engine/organization/mapper/scheme/SchemeMapper.java index e3f6ec68..ea41da19 100644 --- a/src/com/engine/organization/mapper/scheme/SchemeMapper.java +++ b/src/com/engine/organization/mapper/scheme/SchemeMapper.java @@ -1,10 +1,12 @@ package com.engine.organization.mapper.scheme; +import com.engine.organization.entity.TreeData; import com.engine.organization.entity.scheme.po.SchemePO; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; @@ -79,4 +81,10 @@ public interface SchemeMapper { * @param ids */ int deleteByIds(@Param("ids") Collection ids); + + /** + * 获取左侧树 + * @return + */ + ArrayList getTreeData(); } diff --git a/src/com/engine/organization/mapper/scheme/SchemeMapper.xml b/src/com/engine/organization/mapper/scheme/SchemeMapper.xml index b43994d7..daff34ff 100644 --- a/src/com/engine/organization/mapper/scheme/SchemeMapper.xml +++ b/src/com/engine/organization/mapper/scheme/SchemeMapper.xml @@ -13,6 +13,11 @@ + + + + + t @@ -68,6 +73,11 @@ from JCL_ORG_JOB where delete_type = 0 + diff --git a/src/com/engine/organization/mapper/staff/StaffsMapper.xml b/src/com/engine/organization/mapper/staff/StaffsMapper.xml index 11695407..7460adb2 100644 --- a/src/com/engine/organization/mapper/staff/StaffsMapper.xml +++ b/src/com/engine/organization/mapper/staff/StaffsMapper.xml @@ -59,6 +59,9 @@ requestid, + + description, + @@ -89,6 +92,9 @@ #{requestId}, + + #{description}, + diff --git a/src/com/engine/organization/service/CompService.java b/src/com/engine/organization/service/CompService.java index c6f16a79..7ac016f7 100644 --- a/src/com/engine/organization/service/CompService.java +++ b/src/com/engine/organization/service/CompService.java @@ -1,8 +1,11 @@ package com.engine.organization.service; +import com.api.browser.bean.SearchConditionGroup; import com.engine.organization.entity.company.param.CompSearchParam; +import com.engine.organization.entity.department.param.DepartmentMoveParam; import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -27,7 +30,7 @@ public interface CompService { * @param params * @return */ - int saveBaseComp(Map params); + Long saveBaseComp(Map params); /** * 更新禁用标记 @@ -43,7 +46,7 @@ public interface CompService { * @param params * @return */ - int updateComp(Map params); + Long updateComp(Map params); /** @@ -83,4 +86,19 @@ public interface CompService { */ Map getCompSaveForm(); + /** + * 转移分部表单 + * + * @return + */ + List getMoveForm(); + + /** + * 转移到指定分部或部门 + * + * @param moveParam + * @return + */ + int moveCompany(DepartmentMoveParam moveParam); + } diff --git a/src/com/engine/organization/service/DepartmentService.java b/src/com/engine/organization/service/DepartmentService.java index 176e31ae..a3d382e0 100644 --- a/src/com/engine/organization/service/DepartmentService.java +++ b/src/com/engine/organization/service/DepartmentService.java @@ -58,7 +58,7 @@ public interface DepartmentService { * @param params * @return */ - int saveBaseForm(Map params); + Long saveBaseForm(Map params); /** * 更新禁用标记 @@ -74,7 +74,7 @@ public interface DepartmentService { * @param params * @return */ - int updateForm(Map params); + Long updateForm(Map params); /** diff --git a/src/com/engine/organization/service/ExtService.java b/src/com/engine/organization/service/ExtService.java index af0e8484..172414da 100644 --- a/src/com/engine/organization/service/ExtService.java +++ b/src/com/engine/organization/service/ExtService.java @@ -73,7 +73,7 @@ public interface ExtService { * @param id * @return */ - int updateExtForm(User user, String extendType, String tableName, Map params, String groupId, Long id); + Long updateExtForm(User user, String extendType, String tableName, Map params, String groupId, Long id); /** * 更新明细表 diff --git a/src/com/engine/organization/service/HrmResourceService.java b/src/com/engine/organization/service/HrmResourceService.java new file mode 100644 index 00000000..5c0193b3 --- /dev/null +++ b/src/com/engine/organization/service/HrmResourceService.java @@ -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 getSearchTree(SearchTreeParams params); + + /** + * 人员列表 + * + * @param params + * @return + */ + Map listPage(HrmResourceSearchParam params); + + /** + * 获取新增表单 + * + * @return + */ + Map getSaveForm(); + + /** + * 新增 + * + * @param params + * @return + */ + Long saveBaseForm(Map params); + + /** + * 获取基本信息表单 + * + * @param params + * @return + */ + Map getBaseForm(Map params); + + /** + * 更新 + * + * @param params + * @return + */ + int updateForm(Map params); + + /** + * 获取搜索条件 + * + * @param params + * @return + */ + Map getSearchCondition(Map params); + + /** + * 获取列表页面按钮信息 + * + * @return + */ + Map getHasRight(); +} diff --git a/src/com/engine/organization/service/JobService.java b/src/com/engine/organization/service/JobService.java index 57ff8c5d..95cfb27e 100644 --- a/src/com/engine/organization/service/JobService.java +++ b/src/com/engine/organization/service/JobService.java @@ -1,9 +1,12 @@ package com.engine.organization.service; +import com.api.browser.bean.SearchConditionGroup; +import com.engine.organization.entity.job.param.JobMergeParam; import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.searchtree.SearchTreeParams; import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -63,7 +66,7 @@ public interface JobService { * @param params * @return */ - int saveBaseForm(Map params); + Long saveBaseForm(Map params); /** * 更新主表、拓展表、明细表 @@ -71,7 +74,7 @@ public interface JobService { * @param params * @return */ - int updateForm(Map params); + Long updateForm(Map params); /** * 复制岗位到指定部门 @@ -98,4 +101,19 @@ public interface JobService { int deleteByIds(Collection ids); Map getHrmListByJobId(Long jobId); + + /** + * 合并表单 + * + * @return + */ + List getMergeForm(); + + /** + * 合并岗位 + * + * @param mergeParam + * @return + */ + int mergeJob(JobMergeParam mergeParam); } diff --git a/src/com/engine/organization/service/LevelService.java b/src/com/engine/organization/service/LevelService.java index dff80c24..4a8bffff 100644 --- a/src/com/engine/organization/service/LevelService.java +++ b/src/com/engine/organization/service/LevelService.java @@ -1,5 +1,6 @@ package com.engine.organization.service; +import com.engine.organization.entity.TreeData; import com.engine.organization.entity.scheme.param.LevelSearchParam; import java.util.Collection; @@ -78,4 +79,11 @@ public interface LevelService { */ Map getTabInfo(); + /** + * 获取左侧树 + * + * @return + */ + TreeData getTreeData(); + } diff --git a/src/com/engine/organization/service/SchemeService.java b/src/com/engine/organization/service/SchemeService.java index ced25c40..7d5aa550 100644 --- a/src/com/engine/organization/service/SchemeService.java +++ b/src/com/engine/organization/service/SchemeService.java @@ -1,8 +1,10 @@ package com.engine.organization.service; +import com.engine.organization.entity.fieldset.vo.TypeTreeVO; import com.engine.organization.entity.scheme.param.SchemeSearchParam; import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -70,8 +72,16 @@ public interface SchemeService { /** * 获取列表页面按钮信息 + * * @return */ Map getTableBtn(); + /** + * 获取左侧树 + * + * @return + */ + List getTreeData(); + } diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index 28f232f8..91c746b9 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -11,25 +11,27 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.hrm.entity.RuleCodeType; import com.engine.organization.component.OrganizationWeaTable; +import com.engine.organization.entity.DeleteParam; +import com.engine.organization.entity.codesetting.po.CodeRulePO; import com.engine.organization.entity.company.bo.CompBO; import com.engine.organization.entity.company.dto.CompListDTO; import com.engine.organization.entity.company.param.CompSearchParam; import com.engine.organization.entity.company.po.CompPO; +import com.engine.organization.entity.department.param.DepartmentMoveParam; import com.engine.organization.entity.extend.po.ExtendTitlePO; +import com.engine.organization.mapper.codesetting.CodeRuleMapper; import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper; import com.engine.organization.service.CompService; import com.engine.organization.service.ExtService; -import com.engine.organization.util.HasRightUtil; -import com.engine.organization.util.MenuBtn; -import com.engine.organization.util.OrganizationAssert; -import com.engine.organization.util.OrganizationFormItemUtil; +import com.engine.organization.util.*; import com.engine.organization.util.coderule.CodeRuleUtil; import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.page.Column; import com.engine.organization.util.page.PageInfo; import com.engine.organization.util.page.PageUtil; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; import weaver.general.StringUtil; import weaver.general.Util; import weaver.hrm.User; @@ -95,11 +97,12 @@ public class CompServiceImpl extends Service implements CompService { CompPO compPO = CompBO.convertParamToPO(params, (long) user.getUID()); boolean filter = isFilter(compPO); PageInfo pageInfos; - List alltList = getCompMapper().list(); + String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams()); + List alltList = getCompMapper().list(orderSql); // 通过子级遍历父级元素 if (filter) { // 根据条件获取元素 - List filterCompPOs = getCompMapper().listByFilter(compPO); + List filterCompPOs = getCompMapper().listByFilter(compPO, orderSql); // 添加父级元素 List compListDTOS = CompBO.buildCompDTOList(alltList, filterCompPOs); List subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS); @@ -132,14 +135,16 @@ public class CompServiceImpl extends Service implements CompService { } @Override - public int saveBaseComp(Map params) { + public Long saveBaseComp(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); String compNo = (String) params.get("comp_no"); - compNo = CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, compNo); - List list = getCompMapper().listByNo(Util.null2String(compNo)); - OrganizationAssert.isEmpty(list, "编号不允许重复"); + // 判断是否开启自动编号 + compNo = repeatDetermine(compNo); params.put("comp_no", compNo); - + if (StringUtils.isBlank(params.get("show_order").toString())) { + int maxShowOrder = getCompMapper().getMaxShowOrder(); + params.put("show_order", maxShowOrder + 1); + } return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", null); } @@ -151,22 +156,27 @@ public class CompServiceImpl extends Service implements CompService { } @Override - public int updateComp(Map params) { + public Long updateComp(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class); String groupId = (String) params.get("viewCondition"); if ("0".equals(groupId)) { groupId = GROUP_ID.toString(); } - int updateCount = 0; + String oldCompNo = getCompMapper().listById(searchParam.getId()).getCompNo(); + String compNo = searchParam.getCompNo(); + if (!oldCompNo.equals(compNo)) { + compNo = repeatDetermine(compNo); + params.put("comp_no", compNo); + } // 更新主表数据 - updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId()); + getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId()); // 更新主表拓展表 - updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, searchParam.getId()); + getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, groupId, searchParam.getId()); //更新明细表 getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, searchParam.getId()); - return updateCount; + return searchParam.getId(); } @Override @@ -243,7 +253,10 @@ public class CompServiceImpl extends Service implements CompService { if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { - addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_COMP : JCL_ORG_COMPEXT, viewAttr, id, extendTitle.getId() + "", "comp_no"))); + List 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 extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { - addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendTitle.getId() + "", "comp_no", RuleCodeType.SUBCOMPANY.getValue()))); + List items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendTitle.getId() + "", "comp_no", RuleCodeType.SUBCOMPANY.getValue()); + if (CollectionUtils.isNotEmpty(items)) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items)); + } } } apiDatas.put("condition", addGroups); @@ -279,6 +295,34 @@ public class CompServiceImpl extends Service implements CompService { } + @Override + public List getMoveForm() { + List addGroups = new ArrayList<>(); + List 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 disableIds = new HashSet<>(); + disableIds.add(companyId); + List compPOS = getCompMapper().listChild(DeleteParam.builder().ids(companyId.toString()).build().getIds()); + if (CollectionUtils.isNotEmpty(compPOS)) { + addDisableIds(disableIds, compPOS); + } + OrganizationAssert.isFalse(disableIds.contains(targetCompanyId), "请勿选择当前分部本身及其子分部"); + CompPO compPO = getCompMapper().listById(companyId); + compPO.setParentCompany(targetCompanyId); + return getCompMapper().updateBaseComp(compPO); + } + /** * 是否为搜索查询 @@ -297,4 +341,52 @@ public class CompServiceImpl extends Service implements CompService { && null == compPO.getForbiddenTag()); } + + /** + * 判断编号是否重复 + * + * @return + */ + private String repeatDetermine(String compNo) { + CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.SUBCOMPANY.getValue()); + if (StringUtils.isNotBlank(compNo)) { + compNo = CodeRuleUtil.generateCode(RuleCodeType.SUBCOMPANY, compNo); + List 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 list = getCompMapper().listByNo(Util.null2String(generateCode)); + if (CollectionUtils.isNotEmpty(list)) { + generateCode = autoCreateCompanyNo(); + } + return generateCode; + } + + /** + * 添加子元素ID + * + * @param disableIds + * @param compPOS + */ + private void addDisableIds(Set disableIds, List compPOS) { + for (CompPO compPO : compPOS) { + disableIds.add(compPO.getId()); + List childCompPOS = getCompMapper().listChild(DeleteParam.builder().ids(compPO.getId().toString()).build().getIds()); + addDisableIds(disableIds, childCompPOS); + } + } + } diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index 798f3350..741da437 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -10,6 +10,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.hrm.entity.RuleCodeType; import com.engine.organization.component.OrganizationWeaTable; +import com.engine.organization.entity.codesetting.po.CodeRulePO; import com.engine.organization.entity.company.bo.CompBO; import com.engine.organization.entity.company.po.CompPO; import com.engine.organization.entity.department.bo.DepartmentBO; @@ -23,16 +24,14 @@ import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.vo.SingleJobTreeVO; import com.engine.organization.entity.searchtree.SearchTree; import com.engine.organization.entity.searchtree.SearchTreeParams; +import com.engine.organization.mapper.codesetting.CodeRuleMapper; import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper; import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.service.DepartmentService; import com.engine.organization.service.ExtService; -import com.engine.organization.util.HasRightUtil; -import com.engine.organization.util.MenuBtn; -import com.engine.organization.util.OrganizationAssert; -import com.engine.organization.util.OrganizationFormItemUtil; +import com.engine.organization.util.*; import com.engine.organization.util.coderule.CodeRuleUtil; import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.page.Column; @@ -40,6 +39,7 @@ import com.engine.organization.util.page.PageInfo; import com.engine.organization.util.page.PageUtil; import com.engine.organization.util.tree.SearchTreeUtil; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang.StringUtils; import weaver.general.StringUtil; import weaver.general.Util; import weaver.hrm.User; @@ -104,7 +104,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService public PageInfo getDeptListByPid(QuerySingleDeptListParam param) { //1.查询分部下所有部门 //PageUtil.start(param.getCurrent(), param.getPageSize()); - List departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).list(); + List departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).list("show_order"); PageInfo pageInfo = new PageInfo<>(departmentPOS); List singleDeptTreeVOS = DepartmentBO.buildSingleDeptTreeVOS(departmentPOS, param.getParentComp()); PageInfo pageInfos = new PageInfo<>(singleDeptTreeVOS, SingleDeptTreeVO.class); @@ -148,11 +148,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService DepartmentPO departmentPO = DepartmentBO.convertParamsToPO(param, user.getUID()); boolean filter = isFilter(departmentPO); PageInfo pageInfos; - List allList = getDepartmentMapper().list(); + String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams()); + List allList = getDepartmentMapper().list(orderSql); // 通过子级遍历父级元素 if (filter) { // 根据条件获取元素 - List filterDeptPOs = getDepartmentMapper().listByFilter(departmentPO); + List filterDeptPOs = getDepartmentMapper().listByFilter(departmentPO, orderSql); // 添加父级元素 List compListDTOS = DepartmentBO.buildDeptDTOList(allList, filterDeptPOs); List subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS); @@ -185,13 +186,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService } @Override - public int saveBaseForm(Map params) { + public Long saveBaseForm(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); String deptNo = (String) params.get("dept_no"); - deptNo = CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptNo); - List list = getDepartmentMapper().listByNo(Util.null2String(deptNo)); - OrganizationAssert.isEmpty(list, "编号不允许重复"); + // 判断是否开启自动编号 + deptNo = repeatDetermine(deptNo); params.put("dept_no", deptNo); + if (StringUtils.isBlank((String) params.get("show_order"))) { + int maxShowOrder = getDepartmentMapper().getMaxShowOrder(); + params.put("show_order", maxShowOrder + 1); + } return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", null); } @@ -204,22 +208,28 @@ public class DepartmentServiceImpl extends Service implements DepartmentService } @Override - public int updateForm(Map params) { + public Long updateForm(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class); String groupId = (String) params.get("viewCondition"); if ("0".equals(groupId)) { groupId = GROUP_ID.toString(); } - int updateCount = 0; + + String oldDeptNo = getDepartmentMapper().getDeptById(searchParam.getId()).getDeptNo(); + String deptNo = searchParam.getDeptNo(); + if (!oldDeptNo.equals(deptNo)) { + deptNo = repeatDetermine(deptNo); + params.put("dept_no", deptNo); + } // 更新主表数据 - updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId()); + getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId()); // 更新主表拓展表 - updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId()); + getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId()); //更新明细表 getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId()); - return updateCount; + return searchParam.getId(); } @Override @@ -296,7 +306,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService List extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId)); if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { - addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_DEPT : JCL_ORG_DEPTEXT, viewAttr, id, extendTitle.getId().toString(), "dept_no"))); + List items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_DEPT : JCL_ORG_DEPTEXT, viewAttr, id, extendTitle.getId().toString(), ""); + + if (CollectionUtils.isNotEmpty(items)) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items)); + } } } @@ -324,7 +338,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { - addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendTitle.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue()))); + List items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendTitle.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue()); + if (CollectionUtils.isNotEmpty(items)) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items)); + } } } apiDatas.put("condition", addGroups); @@ -365,23 +382,19 @@ public class DepartmentServiceImpl extends Service implements DepartmentService OrganizationAssert.notBlank(copyParam.getCompany(), "请指定需要复制的公司/分部"); int insertCount = 0; List idList = Arrays.stream(copyParam.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList()); - for (Long id : idList) { - DepartmentPO deptById = getDepartmentMapper().getDeptById(id); + int maxShowOrder = getDepartmentMapper().getMaxShowOrder(); + for (int i = 0; i < idList.size(); i++) { + DepartmentPO deptById = getDepartmentMapper().getDeptById(idList.get(i)); // 处理自动编号 - deptById.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptById.getDeptNo(), true)); + deptById.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptById.getDeptNo(), false)); deptById.setParentComp(Long.parseLong(copyParam.getCompany())); + // 显示顺序字段 + deptById.setShowOrder(maxShowOrder + i + 1); insertCount += getDepartmentMapper().insertIgnoreNull(deptById); if ("1".equals(copyParam.getCopyJob())) { - List jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listJobsByDepartmentId(id); - for (JobPO jobPO : jobPOS) { - // 处理自动编号 - jobPO.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobPO.getJobNo(), true)); - jobPO.setParentDept(deptById.getId()); - jobPO.setCreator((long) user.getUID()); - jobPO.setCreateTime(new Date()); - jobPO.setParentComp(deptById.getParentComp()); - insertCount += MapperProxyFactory.getProxy(JobMapper.class).insertIgnoreNull(jobPO); - } + List jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listJobsByDepartmentId(idList.get(i)); + int maxJobOrder = MapperProxyFactory.getProxy(JobMapper.class).getMaxShowOrder(); + recursionCopyJob((long) user.getUID(), jobPOS, deptById.getParentComp(), deptById.getId(), maxJobOrder); } } return insertCount; @@ -395,7 +408,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService deptBrowserItem.setRules("required|string"); SearchConditionItem mergeNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "合并后名称", "mergeName"); mergeNameItem.setRules("required|string"); - String departmentName = getDepartmentMapper().getDeptNameById(id.intValue()); + String departmentName = getDepartmentMapper().getDeptNameById(id); mergeNameItem.setValue(departmentName); condition.add(deptBrowserItem); @@ -411,18 +424,22 @@ public class DepartmentServiceImpl extends Service implements DepartmentService OrganizationAssert.isFalse(mergeParam.getId().equals(mergeParam.getDepartment()), "所选部门与待合并部门一致,无需操作"); OrganizationAssert.notNull(mergeParam.getDepartment(), "请选择需要合并的部门"); OrganizationAssert.notBlank(mergeParam.getMergeName(), "请输入合并后的名称"); + // 合并到的部门 + DepartmentPO targetDepartment = getDepartmentMapper().getDeptById(mergeParam.getDepartment()); + Long parentComp = targetDepartment.getParentComp(); + // 所选部门 DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId()); mergeDepartment.setDeptName(mergeParam.getMergeName()); mergeDepartment.setDeptNameShort(mergeParam.getMergeName()); mergeDepartment.setParentDept(mergeParam.getDepartment()); + mergeDepartment.setParentComp(parentComp); + // 禁用 + mergeDepartment.setForbiddenTag(1); updateCount += getDepartmentMapper().updateBaseDept(mergeDepartment); // 合并后部门及子部门禁用 - Set ids = new HashSet<>(); - ids.add(mergeParam.getId()); List deptList = getDepartmentMapper().getDeptListByPId(mergeParam.getId()); - forbiddenChildTag(deptList, ids); - updateCount += getDepartmentMapper().forbiddenDepartmentByIds(ids); + forbiddenChildTag(parentComp, deptList); return updateCount; } @@ -430,12 +447,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService public List getMoveForm() { List addGroups = new ArrayList<>(); List condition = new ArrayList<>(); - SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "请选择公司/分部", "161", "company", "compBrowser"); - SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "请选择部门", "161", "department", "deptBrowser"); + SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择分部", "161", "company", "compBrowser"); + SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择部门", "161", "department", "deptBrowser"); List selectOptions = new ArrayList<>(); - SearchConditionOption compOption = new SearchConditionOption("0", "公司/分部"); + SearchConditionOption compOption = new SearchConditionOption("0", "分部"); SearchConditionOption deptOption = new SearchConditionOption("1", "部门"); selectOptions.add(compOption); selectOptions.add(deptOption); @@ -458,7 +475,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService // 0:公司/分部 1:部门 if ("0".equals(moveParam.getMoveType())) { Long company = moveParam.getCompany(); - OrganizationAssert.notNull(company, "请选择要转移到的公司/分部"); + OrganizationAssert.notNull(company, "请选择要转移到的分部"); deptById.setParentComp(company); deptById.setParentDept(null); } else if ("1".equals(moveParam.getMoveType())) { @@ -473,15 +490,17 @@ public class DepartmentServiceImpl extends Service implements DepartmentService /** * 获取所有子部门id * + * @param parentComp * @param deptList - * @param ids */ - void forbiddenChildTag(List deptList, Set ids) { + void forbiddenChildTag(Long parentComp, List deptList) { if (CollectionUtils.isNotEmpty(deptList)) { for (DepartmentPO departmentPO : deptList) { - ids.add(departmentPO.getId()); + departmentPO.setParentComp(parentComp); + departmentPO.setForbiddenTag(1); + getDepartmentMapper().updateBaseDept(departmentPO); List childList = getDepartmentMapper().getDeptListByPId(departmentPO.getId()); - forbiddenChildTag(childList, ids); + forbiddenChildTag(parentComp, childList); } } } @@ -508,7 +527,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService // 查询部门信息 Long parentCompId = StringUtil.isEmpty(id) ? null : Long.parseLong(id); CompPO compBuild = CompPO.builder().compName(keyword).parentCompany(parentCompId).build(); - List filterComps = getCompMapper().listByFilter(compBuild); + List filterComps = getCompMapper().listByFilter(compBuild, "show_order"); Set builderComps = new HashSet<>(); for (CompPO compPO : filterComps) { @@ -535,4 +554,65 @@ public class DepartmentServiceImpl extends Service implements DepartmentService } } + /** + * 判断编号是否重复 + * + * @return + */ + private String repeatDetermine(String deptNo) { + CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.DEPARTMENT.getValue()); + if (StringUtils.isNotBlank(deptNo)) { + deptNo = CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptNo); + List 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 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 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 jobsByPid = MapperProxyFactory.getProxy(JobMapper.class).getJobsByPid(jobPO.getId()); + if (CollectionUtils.isNotEmpty(jobsByPid)) { + recursionCopyJob(creator, jobsByPid, parentCompId, parentDeptId, orderNum); + } + } + } + } diff --git a/src/com/engine/organization/service/impl/ExtServiceImpl.java b/src/com/engine/organization/service/impl/ExtServiceImpl.java index 91a68d3f..5efdfc0f 100644 --- a/src/com/engine/organization/service/impl/ExtServiceImpl.java +++ b/src/com/engine/organization/service/impl/ExtServiceImpl.java @@ -6,9 +6,11 @@ import com.engine.organization.entity.TopTab; import com.engine.organization.entity.codesetting.po.CodeRulePO; import com.engine.organization.entity.extend.ExtendInfoOperateType; import com.engine.organization.entity.extend.bo.ExtendInfoBO; +import com.engine.organization.entity.extend.param.ExtendInfoParams; import com.engine.organization.entity.extend.po.ExtendGroupPO; import com.engine.organization.entity.extend.po.ExtendInfoPO; import com.engine.organization.entity.extend.po.ExtendTitlePO; +import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.mapper.codesetting.CodeRuleMapper; import com.engine.organization.mapper.extend.*; import com.engine.organization.service.ExtService; @@ -31,13 +33,6 @@ import java.util.stream.Collectors; public class ExtServiceImpl extends Service implements ExtService { private static final Integer BROWSER_TYPE = 3; - /** - * 分组类型 - * 1:分部 - * 2:部门 - * 3:岗位 - */ - private static final String TYPE_JOB = "3"; private ExtendInfoMapper getExtendInfoMapper() { return MapperProxyFactory.getProxy(ExtendInfoMapper.class); @@ -71,7 +66,8 @@ public class ExtServiceImpl extends Service implements ExtService { if (StringUtils.isEmpty(fields)) { return conditionItems; } - Map compExtMap = getExtMapper().listExt(tableName, fields, id); + ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(tableName).fields(fields).params(null).id(id).build(); + Map compExtMap = getExtMapper().listExt(infoParams); List readOnlyFieldList = Arrays.asList(readOnlyFields); // 组装拓展页内容 for (ExtendInfoPO extendInfoPO : infoPOList) { @@ -82,9 +78,13 @@ public class ExtServiceImpl extends Service implements ExtService { item.setViewAttr(1); } else if (1 == extendInfoPO.getIsrequired()) { item.setViewAttr(3); - item.setRules("required|string"); + item.setRules("required"); } } + // 分部,上级部门添加提示信息 + if (1 != viewAttr && ModuleTypeEnum.departmentfielddefined.getValue().toString().equals(groupId) && "parent_dept".equalsIgnoreCase(extendInfoPO.getFieldName())) { + item.setHelpfulTip("请先选择所属分部再选择" + extendInfoPO.getFieldNameDesc()); + } conditionItems.add(item); } return conditionItems; @@ -103,9 +103,9 @@ public class ExtServiceImpl extends Service implements ExtService { item.setFieldcol(16); if (1 == extendInfoPO.getIsrequired()) { item.setViewAttr(3); - item.setRules("required|string"); + item.setRules("required"); } - if (extendInfoPO.getFieldName().equals(autoNoField)) { + if (StringUtils.isNotBlank(autoNoField) && extendInfoPO.getFieldName().equals(autoNoField)) { // 判断是否开启自动编号 CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(serialType); if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) { @@ -114,6 +114,10 @@ public class ExtServiceImpl extends Service implements ExtService { item.setRules(""); } } + // 分部,上级部门添加提示信息 + if (ModuleTypeEnum.departmentfielddefined.getValue().toString().equals(groupId) && "parent_dept".equalsIgnoreCase(extendInfoPO.getFieldName())) { + item.setHelpfulTip("请先选择所属分部再选择" + extendInfoPO.getFieldNameDesc()); + } conditionItems.add(item); } return conditionItems; @@ -184,41 +188,56 @@ public class ExtServiceImpl extends Service implements ExtService { } @Override - public int updateExtForm(User user, String extendType, String tableName, Map params, String groupId, Long id) { - int updateBaseComp; - List extInfoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ExtendInfoOperateType.EDIT.getValue()); + public Long updateExtForm(User user, String extendType, String tableName, Map params, String groupId, Long id) { + List extInfoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ""); Map map = new HashMap<>(); - for (ExtendInfoPO extendInfoPO : extInfoPOList) { - String key = extendInfoPO.getFieldName(); - Object value = params.get(extendInfoPO.getFieldName()); - if ("int".equals(extendInfoPO.getFieldType()) && StringUtils.isEmpty((String) value)) { - value = null; + // 遍历Map + Map collect = extInfoPOList.stream().collect(Collectors.toMap(ExtendInfoPO::getFieldName, item -> item)); + for (Map.Entry entry : params.entrySet()) { + String key = entry.getKey(); + if (collect.containsKey(key)) { + Object value = entry.getValue(); + if (null != value && StringUtils.isBlank(value.toString())) { + value = null; + } + if (null == value) { + if ("int".equals(collect.get(key).getFieldType())) { + value = null; + } + // 兼容sqlServer数据库text字段类型 + if ("text".equals(collect.get(key).getFieldType())) { + value = ""; + } + } + map.put(key, value); } - map.put(key, value); } + ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(tableName).params(map).id(id).build(); if (null != id) { // 判断更新还是插入 - int count = getExtMapper().countExtById(tableName, id); + int count = getExtMapper().countExtById(infoParams); if (count > 0) { map.put("update_time", new Date()); - updateBaseComp = getExtMapper().updateExt(tableName, id, map); + getExtMapper().updateExt(infoParams); } else { map.put("creator", user.getUID()); map.put("delete_type", 0); map.put("create_time", new Date()); map.put("update_time", new Date()); map.put("id", id); - updateBaseComp = getExtMapper().insertExt(tableName, map); + getExtMapper().insertExt(infoParams); } } else { - map.put("forbidden_tag", 0); + if (!tableName.equals("JCL_ORG_HRMRESOURCE")) { + map.put("forbidden_tag", 0); + } map.put("creator", user.getUID()); map.put("delete_type", 0); map.put("create_time", new Date()); map.put("update_time", new Date()); - updateBaseComp = getExtMapper().insertExt(tableName, map); + getExtMapper().insertExt(infoParams); } - return updateBaseComp; + return infoParams.getId(); } @Override diff --git a/src/com/engine/organization/service/impl/GradeServiceImpl.java b/src/com/engine/organization/service/impl/GradeServiceImpl.java index c217bb8e..d2017f94 100644 --- a/src/com/engine/organization/service/impl/GradeServiceImpl.java +++ b/src/com/engine/organization/service/impl/GradeServiceImpl.java @@ -83,6 +83,11 @@ public class GradeServiceImpl extends Service implements GradeService { public int updateGrade(GradeSearchParam param) { HasRightUtil.hasRight(user, RIGHT_NAME, false); GradePO gradePO = GradeDTO.convertParamToPO(param, (long) user.getUID()); + String oldGradeNo = getGradeMapper().getGradeByID(gradePO.getId()).getGradeNo(); + if (!oldGradeNo.equals(gradePO.getGradeNo())) { + List list = getGradeMapper().listByNo(Util.null2String(param.getGradeNo())); + OrganizationAssert.isEmpty(list, "编号不允许重复"); + } return getGradeMapper().updateGrade(gradePO); } @@ -155,7 +160,7 @@ public class GradeServiceImpl extends Service implements GradeService { levelBrowserItem.setBrowserConditionParam(levelBrowserBean); // 编辑状态下,编号只读 - gradeNoCondition.setViewAttr(1); + // gradeNoCondition.setViewAttr(1); } selectItems.add(gradeNoCondition); @@ -205,7 +210,7 @@ public class GradeServiceImpl extends Service implements GradeService { sqlWhere += " AND t.grade_name " + dbType.like(gradeName); } String schemeId = (String) params.get("schemeId"); - if (StringUtils.isNotBlank(schemeId)) { + if (StringUtils.isNotBlank(schemeId) && !"-1".equals(schemeId)) { sqlWhere += " AND t.scheme_id = '" + schemeId + "'"; } String viewCondition = (String) params.get("viewCondition"); diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java new file mode 100644 index 00000000..8dc22340 --- /dev/null +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -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 { + /** + * 左侧树 类型表示 + *

+ * 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 getSearchTree(SearchTreeParams params) { + String keyword = params.getKeyword(); + String id = params.getId(); + String type = Util.null2String(params.getType()); + List treeList = getFilterCompany(id, type, keyword); + return SearchTreeUtil.getSearchTree(type, treeList); + } + + @Override + public Map listPage(HrmResourceSearchParam params) { + Map resultMap = new HashMap<>(); + OrganizationWeaTable 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 getSaveForm() { + Map apiDatas = new HashMap<>(); + List addGroups = new ArrayList<>(); + List 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 params) { + return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null); + } + + @Override + public Map getBaseForm(Map 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 buttonsMap = new HashMap<>(); + buttonsMap.put("hasEdit", true); + buttonsMap.put("hasSave", true); + + List addGroups = new ArrayList<>(); + if ("0".equals(groupId)) { + groupId = GROUP_ID.toString(); + } + List 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 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 apiDatas = new HashMap<>(); + + apiDatas.put("result", resultMap); + + return apiDatas; + } + + @Override + public int updateForm(Map 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 getSearchCondition(Map params) { + Map apiDatas = new HashMap<>(); + List addGroups = new ArrayList<>(); + List 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 getHasRight() { + Map btnDatas = new HashMap<>(); + ArrayList topMenuList = new ArrayList<>(); + ArrayList 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 getFilterCompany(String id, String type, String keyword) { + List 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 filterDeparts = getJobMapper().listPOsByFilter(JobPO.builder().jobName(keyword).parentJob(Long.parseLong(id)).build()); + Set 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 buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild, JobPO jobBuild) { + List jobPOS = getJobMapper().listPOsByFilter(jobBuild); + List filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order"); + // 添加父级岗位 + Set builderJobs = new HashSet<>(); + for (JobPO jobPO : jobPOS) { + buildParentJobs(jobPO, builderJobs); + } + // 添加岗位的上级部门或分部 + List jobTrees = SearchTreeUtil.builderTreeMode(JobBO.buildSetToSearchTree(builderJobs)); + String parentDeptS = jobTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(",")); + if (!StringUtil.isEmpty(parentDeptS)) { + List compsByIds = getDepartmentMapper().getDeptsByIds(DeleteParam.builder().ids(parentDeptS).build().getIds()); + if (CollectionUtils.isNotEmpty(compsByIds)) { + filterDeparts.addAll(compsByIds); + } + } + + // 查询分部信息 + List filterComps = getCompMapper().listByFilter(compBuild, "show_order"); + Set builderDeparts = new HashSet<>(); + for (DepartmentPO departmentPO : filterDeparts) { + buildParentDepts(departmentPO, builderDeparts); + } + List deptTrees = SearchTreeUtil.builderTreeMode(DepartmentBO.buildSetToSearchTree(builderDeparts, false)); + // 添加部门的上级分部 + String parentCompS = deptTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(",")); + if (!StringUtil.isEmpty(parentCompS)) { + List compsByIds = getCompMapper().getCompsByIds(DeleteParam.builder().ids(parentCompS).build().getIds()); + if (CollectionUtils.isNotEmpty(compsByIds)) { + filterComps.addAll(compsByIds); + } + } + Set builderComps = new HashSet<>(); + for (CompPO compPO : filterComps) { + buildParentComps(compPO, builderComps); + } + List searchTrees = SearchTreeUtil.builderTreeMode(deptTrees, jobTrees); + return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), searchTrees); + } + + private List buildTreeByDeptAndJob(DepartmentPO departmentBuild, JobPO jobBuild) { + List jobPOS = getJobMapper().listPOsByFilter(jobBuild); + List filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order"); + // 添加父级岗位 + Set builderJobs = new HashSet<>(); + for (JobPO jobPO : jobPOS) { + buildParentJobs(jobPO, builderJobs); + } + // 添加岗位的上级部门或分部 + List jobTrees = SearchTreeUtil.builderTreeMode(JobBO.buildSetToSearchTree(builderJobs)); + String parentDeptS = jobTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(",")); + if (!StringUtil.isEmpty(parentDeptS)) { + List compsByIds = getDepartmentMapper().getDeptsByIds(DeleteParam.builder().ids(parentDeptS).build().getIds()); + if (CollectionUtils.isNotEmpty(compsByIds)) { + filterDeparts.addAll(compsByIds); + } + } + + // 查询分部信息 + Set builderDeparts = new HashSet<>(); + for (DepartmentPO departmentPO : filterDeparts) { + buildParentDepts(departmentPO, builderDeparts); + } + return SearchTreeUtil.builderTreeMode(DepartmentBO.buildSetToSearchTree(builderDeparts, false), jobTrees); + } + + private void buildParentJobs(JobPO jobPO, Set 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 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 builderComps) { + builderComps.add(compPO); + if (SearchTreeUtil.isTop(compPO.getParentCompany())) { + return; + } + CompPO parentComp = getCompMapper().listById(compPO.getParentCompany()); + if (null != parentComp) { + buildParentComps(parentComp, builderComps); + } + } +} diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java index c6ce1991..88370b33 100644 --- a/src/com/engine/organization/service/impl/JobServiceImpl.java +++ b/src/com/engine/organization/service/impl/JobServiceImpl.java @@ -11,6 +11,7 @@ import com.engine.core.impl.Service; import com.engine.hrm.entity.RuleCodeType; import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.entity.DeleteParam; +import com.engine.organization.entity.codesetting.po.CodeRulePO; import com.engine.organization.entity.company.bo.CompBO; import com.engine.organization.entity.company.po.CompPO; import com.engine.organization.entity.department.bo.DepartmentBO; @@ -21,12 +22,14 @@ import com.engine.organization.entity.extend.po.ExtendInfoPO; import com.engine.organization.entity.extend.po.ExtendTitlePO; import com.engine.organization.entity.job.bo.JobBO; import com.engine.organization.entity.job.dto.JobListDTO; +import com.engine.organization.entity.job.param.JobMergeParam; import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.job.po.JobDTPO; import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.scheme.po.GradePO; import com.engine.organization.entity.searchtree.SearchTree; import com.engine.organization.entity.searchtree.SearchTreeParams; +import com.engine.organization.mapper.codesetting.CodeRuleMapper; import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper; @@ -36,10 +39,7 @@ import com.engine.organization.mapper.scheme.GradeMapper; import com.engine.organization.mapper.scheme.LevelMapper; import com.engine.organization.service.ExtService; import com.engine.organization.service.JobService; -import com.engine.organization.util.HasRightUtil; -import com.engine.organization.util.MenuBtn; -import com.engine.organization.util.OrganizationAssert; -import com.engine.organization.util.OrganizationFormItemUtil; +import com.engine.organization.util.*; import com.engine.organization.util.coderule.CodeRuleUtil; import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.page.Column; @@ -47,6 +47,7 @@ import com.engine.organization.util.page.PageInfo; import com.engine.organization.util.page.PageUtil; import com.engine.organization.util.tree.SearchTreeUtil; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang.StringUtils; import weaver.general.StringUtil; import weaver.general.Util; import weaver.hrm.User; @@ -144,11 +145,12 @@ public class JobServiceImpl extends Service implements JobService { JobPO jobPO = JobBO.convertParamsToPO(param, user.getUID()); boolean filter = isFilter(jobPO); PageInfo pageInfos; - List allList = getJobMapper().listNoFilter(); + String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams()); + List allList = getJobMapper().listNoFilter(orderSql); // 通过子级遍历父级元素 if (filter) { // 根据条件获取元素 - List filterJobPOs = getJobMapper().listByFilter(jobPO); + List filterJobPOs = getJobMapper().listByFilter(jobPO, orderSql); // 添加父级元素 List jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs); List subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS); @@ -254,7 +256,10 @@ public class JobServiceImpl extends Service implements JobService { List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { - addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendTitle.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue()))); + List items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendTitle.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue()); + if (CollectionUtils.isNotEmpty(items)) { + addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items)); + } } } apiDatas.put("condition", addGroups); @@ -281,7 +286,10 @@ public class JobServiceImpl extends Service implements JobService { List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID); if (CollectionUtils.isNotEmpty(extendTitles)) { for (ExtendTitlePO extendTitle : extendTitles) { - addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_JOB : JCL_ORG_JOBEXT, viewAttr, id, extendTitle.getId().toString(), "job_no"))); + List 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 resultMap = new HashMap<>(); @@ -291,7 +299,7 @@ public class JobServiceImpl extends Service implements JobService { // 拓展页面分组 resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_JOBEXT)); // 处理明细表 - List> extendTables = getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId),JCL_ORG_JOBEXT_DT1, id, viewAttr, false); + List> extendTables = getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_JOBEXT_DT1, id, viewAttr, false); Map tableMap = new HashMap<>(); tableMap.put("hide", false); @@ -320,36 +328,38 @@ public class JobServiceImpl extends Service implements JobService { } @Override - public int saveBaseForm(Map params) { + public Long saveBaseForm(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); + String jobNo = (String) params.get("job_no"); + // 判断是否开启自动编号 + jobNo = repeatDetermine(jobNo); + params.put("job_no", jobNo); JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class); - // 处理自动编号 - searchParam.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, searchParam.getJobNo())); - List list = getJobMapper().listByNo(Util.null2String(searchParam.getJobNo())); - OrganizationAssert.isEmpty(list, "编号不允许重复"); - JobPO jobPO = JobBO.convertParamsToPO(searchParam, user.getUID()); - jobPO.setIsKey(null == jobPO.getIsKey() ? 0 : jobPO.getIsKey()); - int insertCount = getJobMapper().insertIgnoreNull(jobPO); - params.put("job_no", jobPO.getJobNo()); - params.put("is_key", jobPO.getIsKey()); - - getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", jobPO.getId()); - if (null != jobPO.getSchemeId()) { + params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey()); + DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(searchParam.getParentDept()); + params.put("parent_comp", departmentPO.getParentComp()); + if (StringUtils.isBlank(params.get("show_order").toString())) { + int maxShowOrder = getJobMapper().getMaxShowOrder(); + params.put("show_order", maxShowOrder + 1); + } + + Long jobId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null); + if (null != searchParam.getSchemeId()) { // 插入明细表信息 // 根据等级方案查询职等、职级 - List gradePOS = MapperProxyFactory.getProxy(GradeMapper.class).listGradesBySchemeId(jobPO.getSchemeId()); + List gradePOS = MapperProxyFactory.getProxy(GradeMapper.class).listGradesBySchemeId(searchParam.getSchemeId()); for (GradePO gradePO : gradePOS) { List> maps = MapperProxyFactory.getProxy(LevelMapper.class).listLevelsByIds(DeleteParam.builder().ids(gradePO.getLevelId()).build().getIds()); String levelNames = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(",")); - insertCount += getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(gradePO.getLevelId()).gradeId(gradePO.getId() + "").levelIdspan(levelNames).gradeIdspan(gradePO.getGradeName()).mainId(jobPO.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build()); + getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(gradePO.getLevelId()).gradeId(gradePO.getId() + "").levelIdspan(levelNames).gradeIdspan(gradePO.getGradeName()).mainId(jobId).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build()); } } - return insertCount; + return jobId; } @Override - public int updateForm(Map params) { + public Long updateForm(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class); String groupId = (String) params.get("viewCondition"); @@ -357,13 +367,21 @@ public class JobServiceImpl extends Service implements JobService { if ("0".equals(groupId)) { groupId = GROUP_ID.toString(); } - int updateCount = 0; + String oldJobNo = getJobMapper().getJobById(searchParam.getId()).getJobNo(); + String jobNo = searchParam.getJobNo(); + if (!oldJobNo.equals(jobNo)) { + jobNo = repeatDetermine(jobNo); + params.put("job_no", jobNo); + } + // 更新主表数据 params.put("is_key", searchParam.getIsKey()); - updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId()); + DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(searchParam.getParentDept()); + params.put("parent_comp", departmentPO.getParentComp()); + getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId()); // 更新主表拓展表 - updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId()); + getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId()); // 更新明细表 getJobDTMapper().deleteByIds(searchParam.getId()); int rowNum = Util.getIntValue((String) params.get("rownum")); @@ -375,7 +393,7 @@ public class JobServiceImpl extends Service implements JobService { getJobDTMapper().insertIgnoreNull(JobDTPO.builder().levelId(levelId).gradeId(gradeId).levelIdspan(levelIdspan).gradeIdspan(gradeIdspan).mainId(searchParam.getId()).creator((long) user.getUID()).deleteType(0).createTime(new Date()).updateTime(new Date()).build()); } getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, searchParam.getId()); - return updateCount; + return searchParam.getId(); } @Override @@ -384,11 +402,14 @@ public class JobServiceImpl extends Service implements JobService { OrganizationAssert.notBlank(department, "请指定需要复制的部门"); int insertCount = 0; List idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList()); + int orderNum = getJobMapper().getMaxShowOrder(); for (Long id : idList) { + orderNum++; JobPO jobById = getJobMapper().getJobById(id); // 处理自动编号 - jobById.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobById.getJobNo(), true)); + jobById.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobById.getJobNo(), false)); jobById.setParentDept(Long.parseLong(department)); + jobById.setShowOrder(orderNum); insertCount += getJobMapper().insertIgnoreNull(jobById); } @@ -406,10 +427,7 @@ public class JobServiceImpl extends Service implements JobService { public int deleteByIds(Collection ids) { HasRightUtil.hasRight(user, RIGHT_NAME, false); OrganizationAssert.notEmpty(ids, "请选择要删除的数据"); - Collection deleteIds = new ArrayList<>(); - // 递归删除子节点 - getChildIds(ids, deleteIds); - return getJobMapper().deleteByIds(deleteIds); + return getJobMapper().deleteByIds(ids); } @Override @@ -421,6 +439,48 @@ public class JobServiceImpl extends Service implements JobService { return result.getResultMap(); } + @Override + public List getMergeForm() { + List addGroups = new ArrayList<>(); + List 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 disableIds = new HashSet<>(); + disableIds.add(mergeParam.getId()); + List 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 jobList = getJobMapper().getJobsByPid(mergeParam.getId()); + forbiddenChildTag(parentComp, parentDept, targetJob.getId(), jobList); + return updateCount; + } + /** * 添加查询元素的父级元素 * @@ -474,7 +534,7 @@ public class JobServiceImpl extends Service implements JobService { } else if (TYPE_DEPT.equals(type)) { // // 查询部门信息 - List filterDeparts = getDepartmentMapper().listByFilter(DepartmentPO.builder().deptName(keyword).parentDept(Long.parseLong(id)).build()); + List filterDeparts = getDepartmentMapper().listByFilter(DepartmentPO.builder().deptName(keyword).parentDept(Long.parseLong(id)).build(), "show_order"); Set builderDeparts = new HashSet<>(); for (DepartmentPO departmentPO : filterDeparts) { buildParentDepts(departmentPO, builderDeparts); @@ -493,9 +553,9 @@ public class JobServiceImpl extends Service implements JobService { * @return */ private List buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) { - List filterDeparts = getDepartmentMapper().listByFilter(departmentBuild); + List filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order"); // 查询分部信息 - List filterComps = getCompMapper().listByFilter(compBuild); + List filterComps = getCompMapper().listByFilter(compBuild, "show_order"); Set builderDeparts = new HashSet<>(); for (DepartmentPO departmentPO : filterDeparts) { 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 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 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 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 childJobs = getJobMapper().getJobsByPid(job.getId()); + forbiddenChildTag(parentComp, parentDept, job.getId(), childJobs); + } + } + } + + /** + * 添加子元素ID * - * @param ids - * @param deleteIds + * @param disableIds + * @param jobPOS */ - private void getChildIds(Collection ids, Collection deleteIds) { - for (Long id : ids) { - deleteIds.add(id); - Collection childIds = getJobMapper().getJobsByPid(id).stream().map(JobPO::getId).collect(Collectors.toList()); - getChildIds(childIds, deleteIds); + private void addDisableIds(Set disableIds, List jobPOS) { + for (JobPO jobPO : jobPOS) { + disableIds.add(jobPO.getId()); + List jobsByPid = getJobMapper().getJobsByPid(jobPO.getId()); + addDisableIds(disableIds, jobsByPid); } } diff --git a/src/com/engine/organization/service/impl/LevelServiceImpl.java b/src/com/engine/organization/service/impl/LevelServiceImpl.java index 01ff55dd..dfb576cb 100644 --- a/src/com/engine/organization/service/impl/LevelServiceImpl.java +++ b/src/com/engine/organization/service/impl/LevelServiceImpl.java @@ -8,6 +8,7 @@ import com.engine.core.impl.Service; import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.entity.DeleteParam; import com.engine.organization.entity.TopTab; +import com.engine.organization.entity.TreeData; import com.engine.organization.entity.scheme.dto.LevelDTO; import com.engine.organization.entity.scheme.param.LevelSearchParam; import com.engine.organization.entity.scheme.po.LevelPO; @@ -78,6 +79,12 @@ public class LevelServiceImpl extends Service implements LevelService { public int updateLevel(LevelSearchParam param) { HasRightUtil.hasRight(user, RIGHT_NAME, false); LevelPO levelPO = LevelDTO.convertParamToPO(param, (long) user.getUID()); + // 更新前先查询下旧编号, + String oldLevelNo = getLevelMapper().getLevelByID(levelPO.getId()).getLevelNo(); + if (!oldLevelNo.equals(levelPO.getLevelNo())) { + List list = getLevelMapper().listByNo(Util.null2String(levelPO.getLevelNo())); + OrganizationAssert.isEmpty(list, "编号不允许重复"); + } return getLevelMapper().updateLevel(levelPO); } @@ -142,7 +149,7 @@ public class LevelServiceImpl extends Service implements LevelService { browserBean.setReplaceDatas(maps); browserItem.setBrowserConditionParam(browserBean); // 编辑状态下,编号只读 - levelNoCondition.setViewAttr(1); + // levelNoCondition.setViewAttr(1); } selectItems.add(levelNoCondition); @@ -177,6 +184,12 @@ public class LevelServiceImpl extends Service implements LevelService { return apiDatas; } + @Override + public TreeData getTreeData() { + ArrayList treeDataList = getLevelMapper().getTreeData(); + return TreeData.builder().children(treeDataList).title("职等").key("-1").build(); + } + /** * 查询条件 * @@ -191,7 +204,7 @@ public class LevelServiceImpl extends Service implements LevelService { sqlWhere += " AND t.level_name " + dbType.like(levelName); } String schemeId = (String) params.get("schemeId"); - if (StringUtils.isNotBlank(schemeId)) { + if (StringUtils.isNotBlank(schemeId) && !"-1".equals(schemeId)) { sqlWhere += " AND t.scheme_id = '" + schemeId + "'"; } String viewCondition = (String) params.get("viewCondition"); diff --git a/src/com/engine/organization/service/impl/PostInfoServiceImpl.java b/src/com/engine/organization/service/impl/PostInfoServiceImpl.java index 1a0f7565..e5e8f9e3 100644 --- a/src/com/engine/organization/service/impl/PostInfoServiceImpl.java +++ b/src/com/engine/organization/service/impl/PostInfoServiceImpl.java @@ -78,6 +78,11 @@ public class PostInfoServiceImpl extends Service implements PostInfoService { public int updatePostInfo(PostInfoSearchParam param) { HasRightUtil.hasRight(user, RIGHT_NAME, false); PostInfoPO postInfoPO = PostInfoDTO.convertParamToPO(param, (long) user.getUID()); + String oldPostInfoNo = getPostInfoMapper().getPostInfoByID(postInfoPO.getId()).getPostInfoNo(); + if (!oldPostInfoNo.equals(postInfoPO.getPostInfoNo())) { + List list = getPostInfoMapper().listByNo(Util.null2String(postInfoPO.getPostInfoNo())); + OrganizationAssert.isEmpty(list, "编号不允许重复"); + } return getPostInfoMapper().updatePostInfo(postInfoPO); } @@ -125,11 +130,11 @@ public class PostInfoServiceImpl extends Service implements PostInfoService { SearchConditionItem nameItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "postInfoName"); nameItem.setRules("required|string"); // 权限 - SearchConditionItem authorityItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 2, 50, "权限", "postInfoAuthority"); + SearchConditionItem authorityItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "权限", "postInfoAuthority"); // 责任 - SearchConditionItem dutyItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 2, 50, "责任", "postInfoDuty"); + SearchConditionItem dutyItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "责任", "postInfoDuty"); // 资格 - SearchConditionItem qualificationItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 2, 50, "资格", "postInfoQualification"); + SearchConditionItem qualificationItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "资格", "postInfoQualification"); // 职务分类 SearchConditionItem postIdBrowser = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "职务分类", "161", "postId", "postBrowser"); postIdBrowser.setRules("required|string"); @@ -155,7 +160,7 @@ public class PostInfoServiceImpl extends Service implements PostInfoService { browserBean.setReplaceDatas(maps); postIdBrowser.setBrowserConditionParam(browserBean); // 编辑状态下,编号只读 - noItem.setViewAttr(1); + // noItem.setViewAttr(1); } selectItems.add(noItem); @@ -172,7 +177,25 @@ public class PostInfoServiceImpl extends Service implements PostInfoService { @Override public Map getHasRight() { - return MenuBtn.getCommonBtnDatas(); + Map btnDatas = new HashMap<>(); + ArrayList topMenuList = new ArrayList<>(); + ArrayList 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; } diff --git a/src/com/engine/organization/service/impl/PostServiceImpl.java b/src/com/engine/organization/service/impl/PostServiceImpl.java index 9bb6f26a..4aa59117 100644 --- a/src/com/engine/organization/service/impl/PostServiceImpl.java +++ b/src/com/engine/organization/service/impl/PostServiceImpl.java @@ -34,8 +34,8 @@ public class PostServiceImpl extends Service implements PostService { @Override public int savePost(PostPO postPO) { HasRightUtil.hasRight(user, RIGHT_NAME, false); - List list = getPostMapper().listByNo(Util.null2String(postPO.getPostNo())); - OrganizationAssert.isEmpty(list, "编号不允许重复"); + // List list = getPostMapper().listByNo(Util.null2String(postPO.getPostNo())); + // OrganizationAssert.isEmpty(list, "编号不允许重复"); return getPostMapper().insertIgnoreNull(PostDTO.convertPO(postPO, user.getUID())); } @@ -60,8 +60,6 @@ public class PostServiceImpl extends Service implements PostService { List addGroups = new ArrayList<>(); SearchConditionItem postNameItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "postName"); postNameItem.setRules("required|string"); - SearchConditionItem postNoItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "postNo"); - postNoItem.setRules("required|string"); SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description"); // 编辑状态下赋值操作 @@ -71,12 +69,10 @@ public class PostServiceImpl extends Service implements PostService { OrganizationAssert.notNull(postPO, "选择的数据不存在,或数据已删除"); postNameItem.setValue(postPO.getPostName()); - postNoItem.setValue(postPO.getPostNo()); descriptionItem.setValue(postPO.getDescription()); } - selectItems.add(postNoItem); selectItems.add(postNameItem); selectItems.add(descriptionItem); addGroups.add(new SearchConditionGroup("基本信息", true, selectItems)); @@ -87,7 +83,7 @@ public class PostServiceImpl extends Service implements PostService { @Override public TreeData getTreeData() { ArrayList treeDataList = getPostMapper().getTreeData(); - return TreeData.builder().children(treeDataList).title("全部类型").key("-1").build(); + return TreeData.builder().children(treeDataList).title("职务分类").key("-1").build(); } diff --git a/src/com/engine/organization/service/impl/SchemeServiceImpl.java b/src/com/engine/organization/service/impl/SchemeServiceImpl.java index 3ee3c742..1d312b1b 100644 --- a/src/com/engine/organization/service/impl/SchemeServiceImpl.java +++ b/src/com/engine/organization/service/impl/SchemeServiceImpl.java @@ -5,6 +5,8 @@ import com.api.browser.bean.SearchConditionItem; import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.core.impl.Service; import com.engine.organization.component.OrganizationWeaTable; +import com.engine.organization.entity.TreeData; +import com.engine.organization.entity.fieldset.vo.TypeTreeVO; import com.engine.organization.entity.scheme.dto.SchemeDTO; import com.engine.organization.entity.scheme.param.SchemeSearchParam; import com.engine.organization.entity.scheme.po.SchemePO; @@ -20,6 +22,7 @@ import weaver.general.StringUtil; import weaver.general.Util; import java.util.*; +import java.util.stream.Collectors; /** * @Author dxfeng @@ -72,6 +75,12 @@ public class SchemeServiceImpl extends Service implements SchemeService { HasRightUtil.hasRight(user, RIGHT_NAME, false); Map apidatas = new HashMap<>(); SchemePO schemePO = SchemeDTO.convertParamToPO(param, (long) user.getUID()); + // 更新前先查询下旧编号, + String oldSchemeNo = getSchemeMapper().getSchemeByID(schemePO.getId()).getSchemeNo(); + if (!oldSchemeNo.equals(schemePO.getSchemeNo())) { + List list = getSchemeMapper().listByNo(Util.null2String(schemePO.getSchemeNo())); + OrganizationAssert.isEmpty(list, "编号不允许重复"); + } getSchemeMapper().updateScheme(schemePO); return apidatas; } @@ -129,7 +138,7 @@ public class SchemeServiceImpl extends Service implements SchemeService { textareaItem.setValue(schemePO.getSchemeDescription()); // 编辑状态下,编号只读 - schemeNoCondition.setViewAttr(1); + // schemeNoCondition.setViewAttr(1); } selectItems.add(schemeNoCondition); @@ -145,6 +154,26 @@ public class SchemeServiceImpl extends Service implements SchemeService { return MenuBtn.getCommonBtnDatas(); } + @Override + public List getTreeData() { + ArrayList 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 typeTreeVOS = new ArrayList<>(); + typeTreeVOS.add(build); + return typeTreeVOS; + } + + /** * 查询条件 * diff --git a/src/com/engine/organization/service/impl/SequenceServiceImpl.java b/src/com/engine/organization/service/impl/SequenceServiceImpl.java index 01aae2e1..fefd3d20 100644 --- a/src/com/engine/organization/service/impl/SequenceServiceImpl.java +++ b/src/com/engine/organization/service/impl/SequenceServiceImpl.java @@ -78,6 +78,11 @@ public class SequenceServiceImpl extends Service implements SequenceService { public int updateSequence(SequenceSearchParam param) { HasRightUtil.hasRight(user, RIGHT_NAME, false); SequencePO sequencePO = SequenceDTO.convertParamToPO(param, (long) user.getUID()); + String oldSequenceNo = getSequenceMapper().getSequenceByID(sequencePO.getId()).getSequenceNo(); + if (!oldSequenceNo.equals(sequencePO.getSequenceNo())) { + List list = getSequenceMapper().listByNo(Util.null2String(sequencePO.getSequenceNo())); + OrganizationAssert.isEmpty(list, "编号不允许重复"); + } return getSequenceMapper().updateSequence(sequencePO); } @@ -142,7 +147,7 @@ public class SequenceServiceImpl extends Service implements SequenceService { browserBean.setReplaceDatas(maps); browserItem.setBrowserConditionParam(browserBean); // 编辑状态下,编号只读 - sequenceNoCondition.setViewAttr(1); + // sequenceNoCondition.setViewAttr(1); } selectItems.add(sequenceNoCondition); diff --git a/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java b/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java index 766b161d..5f9c779b 100644 --- a/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java @@ -78,6 +78,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService { public int updateStaffPlan(StaffPlanSearchParam param) { HasRightUtil.hasRight(user, RIGHT_NAME, false); StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID()); + // 更新前先查询下旧编号, + String oldPlanNo = getStaffPlanMapper().getStaffPlanByID(staffPlanPO.getId()).getPlanNo(); + if (!oldPlanNo.equals(staffPlanPO.getPlanNo())) { + List list = getStaffPlanMapper().listByNo(Util.null2String(staffPlanPO.getPlanNo())); + OrganizationAssert.isEmpty(list, "编号不允许重复"); + } return getStaffPlanMapper().updateStaffPlan(staffPlanPO); } @@ -173,8 +179,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService { planNoItem.setValue(staffPlanPO.getPlanNo()); planNameItem.setValue(staffPlanPO.getPlanName()); planYearItem.setValue(staffPlanPO.getPlanYear() + ""); - timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(),"yyyy-MM-dd")); - timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(),"yyyy-MM-dd")); + timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(), "yyyy-MM-dd")); + timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(), "yyyy-MM-dd")); BrowserBean browserBean = companyIdtItem.getBrowserConditionParam(); List> maps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPlanPO.getCompanyId()).build().getIds()); @@ -184,7 +190,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService { descriptionItem.setValue(staffPlanPO.getDescription()); // 编辑状态下,编号只读 - planNoItem.setViewAttr(1); + // planNoItem.setViewAttr(1); } selectItems.add(planNoItem); @@ -250,4 +256,5 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService { return sqlWhere; } + } diff --git a/src/com/engine/organization/service/impl/StaffServiceImpl.java b/src/com/engine/organization/service/impl/StaffServiceImpl.java index feae82bd..959095cb 100644 --- a/src/com/engine/organization/service/impl/StaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffServiceImpl.java @@ -102,7 +102,7 @@ public class StaffServiceImpl extends Service implements StaffService { } else { // 插入明细表数据 - StaffsPO staffsPO = StaffsPO.builder().staffId(staffPO.getId()).businessType(2).changeNum(changeNum).businessSource(1).build(); + StaffsPO staffsPO = StaffsPO.builder().staffId(staffPO.getId()).businessType(2).changeNum(changeNum).businessSource(1).description(param.getChangeDescription()).build(); MapperProxyFactory.getProxy(StaffsMapper.class).insertIgnoreNull(staffsPO); // 更新编制表 staffPO.setStaffNum(staffPO.getStaffNum() + changeNum); @@ -127,8 +127,10 @@ public class StaffServiceImpl extends Service implements StaffService { List addGroups = new ArrayList<>(); List conditionItems = new ArrayList<>(); - // 方案 - SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "方案", "161", "planId", "staffPlanBrowser"); + //// 方案 + //SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "方案11", "161", "planId", "staffPlanBrowser"); + //planIdItem.setHide(true); + //planIdItem.setDisplay("none"); // 分部 SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "compId", "compBrowser"); // 部门 @@ -155,7 +157,7 @@ public class StaffServiceImpl extends Service implements StaffService { // 说明 SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description"); - conditionItems.add(planIdItem); + //conditionItems.add(planIdItem); conditionItems.add(compIdItem); conditionItems.add(deptIdItem); conditionItems.add(jobIdItem); @@ -252,6 +254,9 @@ public class StaffServiceImpl extends Service implements StaffService { SearchConditionItem changeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 3, "调整数量", "changeNum"); staffNumItem.setRules("required"); selectItems.add(changeNumItem); + SearchConditionItem changeDescriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, false, 2, 50, "变更说明", "changeDescription"); + selectItems.add(changeDescriptionItem); + } addGroups.add(new SearchConditionGroup("基本信息", true, selectItems)); @@ -261,7 +266,18 @@ public class StaffServiceImpl extends Service implements StaffService { @Override public Map getHasRight() { - return MenuBtn.getCommonBtnDatas(); + Map datas = MenuBtn.getCommonBtnDatas(); + List addGroups = new ArrayList<>(); + List selectItems = new ArrayList<>(); + // 方案 + SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 4, 3, 2, false, "编制方案", "161", "planId", "staffPlanBrowser"); + planIdItem.setRules("required|string"); + planIdItem.setHelpfulTip("请选择编制方案后查看数据"); + planIdItem.setLabelcol(2); + selectItems.add(planIdItem); + addGroups.add(new SearchConditionGroup("基本信息", true, selectItems)); + datas.put("condition", addGroups); + return datas; } /** @@ -277,6 +293,8 @@ public class StaffServiceImpl extends Service implements StaffService { Long planId = param.getPlanId(); if (null != planId) { sqlWhere += " AND t.plan_id = '" + planId + "'"; + } else { + sqlWhere = " 1=2 "; } Long compId = param.getCompId(); if (null != compId) { diff --git a/src/com/engine/organization/transmethod/HrmResourceTransMethod.java b/src/com/engine/organization/transmethod/HrmResourceTransMethod.java new file mode 100644 index 00000000..23d79f3c --- /dev/null +++ b/src/com/engine/organization/transmethod/HrmResourceTransMethod.java @@ -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)); + } +} diff --git a/src/com/engine/organization/util/PageInfoSortUtil.java b/src/com/engine/organization/util/PageInfoSortUtil.java new file mode 100644 index 00000000..9146a6b8 --- /dev/null +++ b/src/com/engine/organization/util/PageInfoSortUtil.java @@ -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(); + } +} diff --git a/src/com/engine/organization/util/page/Column.java b/src/com/engine/organization/util/page/Column.java index 55a9c583..6f37237f 100644 --- a/src/com/engine/organization/util/page/Column.java +++ b/src/com/engine/organization/util/page/Column.java @@ -14,10 +14,13 @@ public class Column { String dataIndex; String key; boolean display; + String width; + boolean sorter; - public Column(String title, String dataIndex, String key) { + public Column(String title, String dataIndex, String key, String width) { this.title = title; this.dataIndex = dataIndex; this.key = key; + this.width = width; } } diff --git a/src/com/engine/organization/util/page/PageInfo.java b/src/com/engine/organization/util/page/PageInfo.java index 93e1c5b3..41cc3411 100644 --- a/src/com/engine/organization/util/page/PageInfo.java +++ b/src/com/engine/organization/util/page/PageInfo.java @@ -40,7 +40,7 @@ public class PageInfo extends com.github.pagehelper.PageInfo { public List buildColumns() { - if(clazz==null){ + if (clazz == null) { return this.columns; } Field[] fields = clazz.getDeclaredFields(); @@ -52,7 +52,9 @@ public class PageInfo extends com.github.pagehelper.PageInfo { String dataIndex = annotation.dataIndex(); String key = annotation.key(); boolean display = annotation.display(); - Column column = Column.builder().title(title).dataIndex(dataIndex).key(key).display(display).build(); + String width = annotation.width(); + boolean sorter = annotation.sorter(); + Column column = Column.builder().sorter(sorter).width(width).title(title).dataIndex(dataIndex).key(key).display(display).build(); columns.add(column); } } diff --git a/src/com/engine/organization/web/CompController.java b/src/com/engine/organization/web/CompController.java index fd10e420..38888e72 100644 --- a/src/com/engine/organization/web/CompController.java +++ b/src/com/engine/organization/web/CompController.java @@ -4,6 +4,7 @@ import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; import com.engine.organization.entity.DeleteParam; import com.engine.organization.entity.company.param.CompSearchParam; +import com.engine.organization.entity.department.param.DepartmentMoveParam; import com.engine.organization.util.response.ReturnResult; import com.engine.organization.wrapper.CompWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; @@ -62,7 +63,7 @@ public class CompController { @POST @Path("/saveBaseComp") @Produces(MediaType.APPLICATION_JSON) - public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody Map params) { + public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map params) { try { User user = HrmUserVarify.getUser(request, response); return ReturnResult.successed(getCompWrapper(user).saveBaseComp(params)); @@ -211,4 +212,29 @@ public class CompController { } } + @GET + @Path("/getMoveForm") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult getMoveForm(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + return ReturnResult.successed(getCompWrapper(user).getMoveForm()); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + + @POST + @Path("/moveCompany") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult moveCompany(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DepartmentMoveParam param) { + try { + User user = HrmUserVarify.getUser(request, response); + return ReturnResult.successed(getCompWrapper(user).moveCompany(param)); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + + } diff --git a/src/com/engine/organization/web/HrmResourceController.java b/src/com/engine/organization/web/HrmResourceController.java new file mode 100644 index 00000000..b3c5e9ac --- /dev/null +++ b/src/com/engine/organization/web/HrmResourceController.java @@ -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 getSearchTree(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + Map 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 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 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 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 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 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()); + } + } +} diff --git a/src/com/engine/organization/web/JobController.java b/src/com/engine/organization/web/JobController.java index 789aa392..3da91b88 100644 --- a/src/com/engine/organization/web/JobController.java +++ b/src/com/engine/organization/web/JobController.java @@ -6,6 +6,7 @@ import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; import com.engine.organization.entity.DeleteParam; import com.engine.organization.entity.job.param.JobCopyParam; +import com.engine.organization.entity.job.param.JobMergeParam; import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.util.response.ReturnResult; @@ -274,5 +275,28 @@ public class JobController { } } + @GET + @Path("/getMergeForm") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult getMergeForm(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + return ReturnResult.successed(getJobWrapper(user).getMergeForm()); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } + + @POST + @Path("/mergeJob") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult mergeJob(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody JobMergeParam param) { + try { + User user = HrmUserVarify.getUser(request, response); + return ReturnResult.successed(getJobWrapper(user).mergeJob(param)); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } } diff --git a/src/com/engine/organization/web/LevelController.java b/src/com/engine/organization/web/LevelController.java index fad3db68..2f9157aa 100644 --- a/src/com/engine/organization/web/LevelController.java +++ b/src/com/engine/organization/web/LevelController.java @@ -202,4 +202,16 @@ public class LevelController { return ReturnResult.exceptionHandle(e.getMessage()); } } + + @GET + @Path("/getTreeData") + @Produces(MediaType.APPLICATION_JSON) + public ReturnResult getTreeData(@Context HttpServletRequest request, @Context HttpServletResponse response) { + try { + User user = HrmUserVarify.getUser(request, response); + return ReturnResult.successed(getLevelWrapper(user).getTreeData()); + } catch (Exception e) { + return ReturnResult.exceptionHandle(e.getMessage()); + } + } } diff --git a/src/com/engine/organization/web/SchemeController.java b/src/com/engine/organization/web/SchemeController.java index d6f815a0..b8c23fd2 100644 --- a/src/com/engine/organization/web/SchemeController.java +++ b/src/com/engine/organization/web/SchemeController.java @@ -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()); + } + } + } diff --git a/src/com/engine/organization/wrapper/CompWrapper.java b/src/com/engine/organization/wrapper/CompWrapper.java index 6363ee2b..a3800d7f 100644 --- a/src/com/engine/organization/wrapper/CompWrapper.java +++ b/src/com/engine/organization/wrapper/CompWrapper.java @@ -1,13 +1,16 @@ package com.engine.organization.wrapper; +import com.api.browser.bean.SearchConditionGroup; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.organization.entity.company.param.CompSearchParam; +import com.engine.organization.entity.department.param.DepartmentMoveParam; import com.engine.organization.service.CompService; import com.engine.organization.service.impl.CompServiceImpl; import weaver.hrm.User; import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -38,7 +41,7 @@ public class CompWrapper extends Service { * @param params * @return */ - public int saveBaseComp(Map params) { + public Long saveBaseComp(Map params) { return getCompService(user).saveBaseComp(params); } @@ -57,7 +60,7 @@ public class CompWrapper extends Service { * @param params * @return */ - public int updateComp(Map params) { + public Long updateComp(Map params) { return getCompService(user).updateComp(params); } @@ -108,4 +111,18 @@ public class CompWrapper extends Service { return getCompService(user).getCompSaveForm(); } + /** + * 转移分部 + * + * @param moveParam + * @return + */ + public int moveCompany(DepartmentMoveParam moveParam) { + return getCompService(user).moveCompany(moveParam); + } + + public List getMoveForm() { + return getCompService(user).getMoveForm(); + } + } diff --git a/src/com/engine/organization/wrapper/DepartmentWrapper.java b/src/com/engine/organization/wrapper/DepartmentWrapper.java index 197e9f1a..0a6cb835 100644 --- a/src/com/engine/organization/wrapper/DepartmentWrapper.java +++ b/src/com/engine/organization/wrapper/DepartmentWrapper.java @@ -79,7 +79,7 @@ public class DepartmentWrapper extends Service { * @param params * @return */ - public int saveBaseForm(Map params) { + public Long saveBaseForm(Map params) { return getDepartmentService(user).saveBaseForm(params); } @@ -99,7 +99,7 @@ public class DepartmentWrapper extends Service { * @param params * @return */ - public int updateForm(Map params) { + public Long updateForm(Map params) { return getDepartmentService(user).updateForm(params); } diff --git a/src/com/engine/organization/wrapper/HrmResourceWrapper.java b/src/com/engine/organization/wrapper/HrmResourceWrapper.java new file mode 100644 index 00000000..fa3dace7 --- /dev/null +++ b/src/com/engine/organization/wrapper/HrmResourceWrapper.java @@ -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 getSearchTree(SearchTreeParams params) { + return getHrmResourceService(user).getSearchTree(params); + } + + public Map listPage(HrmResourceSearchParam params) { + return getHrmResourceService(user).listPage(params); + } + + public Map getSaveForm() { + return getHrmResourceService(user).getSaveForm(); + } + + public Long saveBaseForm(Map params) { + return getHrmResourceService(user).saveBaseForm(params); + } + + public Map getBaseForm(Map params) { + return getHrmResourceService(user).getBaseForm(params); + } + + public int updateForm(Map params) { + return getHrmResourceService(user).updateForm(params); + } + + public Map getSearchCondition(Map params) { + return getHrmResourceService(user).getSearchCondition(params); + } + + public Map getHasRight() { + return getHrmResourceService(user).getHasRight(); + } +} diff --git a/src/com/engine/organization/wrapper/JobWrapper.java b/src/com/engine/organization/wrapper/JobWrapper.java index 9eab4a7c..9a870adb 100644 --- a/src/com/engine/organization/wrapper/JobWrapper.java +++ b/src/com/engine/organization/wrapper/JobWrapper.java @@ -4,6 +4,7 @@ import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.organization.entity.job.param.JobMergeParam; import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.service.JobService; @@ -89,7 +90,7 @@ public class JobWrapper extends Service { * @param params * @return */ - public int saveBaseForm(Map params) { + public Long saveBaseForm(Map params) { return getJobService(user).saveBaseForm(params); } @@ -99,7 +100,7 @@ public class JobWrapper extends Service { * @param params * @return */ - public int updateForm(Map params) { + public Long updateForm(Map params) { return getJobService(user).updateForm(params); } @@ -158,4 +159,12 @@ public class JobWrapper extends Service { Map hrmListByJobId = getJobService(user).getHrmListByJobId(jobId); return ReturnResult.successed(hrmListByJobId); } + + public List getMergeForm() { + return getJobService(user).getMergeForm(); + } + + public int mergeJob(JobMergeParam mergeParam) { + return getJobService(user).mergeJob(mergeParam); + } } diff --git a/src/com/engine/organization/wrapper/LevelWrapper.java b/src/com/engine/organization/wrapper/LevelWrapper.java index 20c733e0..a3430d6b 100644 --- a/src/com/engine/organization/wrapper/LevelWrapper.java +++ b/src/com/engine/organization/wrapper/LevelWrapper.java @@ -2,6 +2,7 @@ package com.engine.organization.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.organization.entity.TreeData; import com.engine.organization.entity.scheme.param.LevelSearchParam; import com.engine.organization.service.LevelService; import com.engine.organization.service.impl.LevelServiceImpl; @@ -108,4 +109,8 @@ public class LevelWrapper extends Service { public Map getTabInfo() { return getLevelService(user).getTabInfo(); } + + public TreeData getTreeData() { + return getLevelService(user).getTreeData(); + } } diff --git a/src/com/engine/organization/wrapper/SchemeWrapper.java b/src/com/engine/organization/wrapper/SchemeWrapper.java index fbb0d6ab..2f8727ad 100644 --- a/src/com/engine/organization/wrapper/SchemeWrapper.java +++ b/src/com/engine/organization/wrapper/SchemeWrapper.java @@ -2,6 +2,7 @@ package com.engine.organization.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.organization.entity.fieldset.vo.TypeTreeVO; import com.engine.organization.entity.scheme.param.SchemeSearchParam; import com.engine.organization.service.SchemeService; import com.engine.organization.service.impl.SchemeServiceImpl; @@ -9,6 +10,7 @@ import org.apache.ibatis.annotations.Param; import weaver.hrm.User; import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -74,6 +76,7 @@ public class SchemeWrapper extends Service { /** * 获取搜索条件 + * * @param params * @return */ @@ -84,6 +87,7 @@ public class SchemeWrapper extends Service { /** * 获取新增表单 + * * @param params * @return */ @@ -93,9 +97,14 @@ public class SchemeWrapper extends Service { /** * 获取列表页面按钮信息 + * * @return */ public Map getTableBtn() { return getSchemeService(user).getTableBtn(); } + + public List getTreeData() { + return getSchemeService(user).getTreeData(); + } }