Merge pull request !193 from dxfeng/feature/dxf
pull/194/MERGE
dxfeng 3 years ago committed by Gitee
commit 7ad378bedd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -33,6 +33,17 @@ INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, d
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '名称', 'post_name', '2', '', 1, uuid(), '0'); INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '名称', 'post_name', '2', '', 1, uuid(), '0');
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '说明', 'description', '2', '', 2, uuid(), ''); INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '说明', 'description', '2', '', 2, uuid(), '');
select @current_date:= date_format( now(),'%Y-%m-%d');
select @current_time:= date_format( now(),'%T');
INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('PostInfoBrowser', '1', '1', '', 'select * from jcl_org_post_info where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '1', 'id', '', '', '', '', '', '', 2, '职务信息浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', @current_date, @current_time, NULL, NULL, '', '', '0', uuid(), '', '', '', '', '1', 0, 1);
select @datashowset_id:= max(id) from datashowset;
INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('PostInfoBrowser', '0', 0, @current_date, @current_time, NULL, NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '编号', 'post_info_no', '', 1, 1, uuid(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '名称', 'post_info_name', '', 0, 2, uuid(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '职务分类', 'post_id', '', 0, 3, uuid(), NULL);
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '编号', 'post_info_no', '2', '', 1, uuid(), '');
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '名称', 'post_info_name', '2', '', 2, uuid(), '');
INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('compBrowser', '1', '1', '', 'select * from jcl_org_comp where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '2', 'id', 'parent_company', 'comp_name', '', '', '', '', 2, '公司分部浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', @current_date, @current_time, NULL, NULL, '', '', '0', uuid(), '', '', '', '', '2', 0, 1); INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('compBrowser', '1', '1', '', 'select * from jcl_org_comp where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '2', 'id', 'parent_company', 'comp_name', '', '', '', '', 2, '公司分部浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', @current_date, @current_time, NULL, NULL, '', '', '0', uuid(), '', '', '', '', '2', 0, 1);
INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('compBrowser', '0', 0, @current_date, @current_time, NULL, NULL); INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('compBrowser', '0', 0, @current_date, @current_time, NULL, NULL);

@ -28,13 +28,22 @@ INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, d
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '名称', 'post_name', '2', '', 1, SYS_GUID(), '0'); INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '名称', 'post_name', '2', '', 1, SYS_GUID(), '0');
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '说明', 'description', '2', '', 2, SYS_GUID(), ''); INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '说明', 'description', '2', '', 2, SYS_GUID(), '');
INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('PostInfoBrowser', '1', '1', '', 'select * from jcl_org_post_info where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '1', 'id', '', '', '', '', '', '', 2, '职务信息浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '1', 0, 1);
SELECT max(id) INTO datashowset_id FROM DATASHOWSET;
INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('PostInfoBrowser', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '编号', 'post_info_no', '', 0, 1, SYS_GUID(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '名称', 'post_info_name', '', 1, 2, SYS_GUID(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '职务分类', 'post_id', 'select post_name from jcl_org_post where id = {?currentvalue}', 0, 3, SYS_GUID(), NULL);
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '编号', 'post_info_no', '2', '', 1, SYS_GUID(), '');
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '名称', 'post_info_name', '2', '', 2, SYS_GUID(), '');
INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('compBrowser', '1', '1', '', 'select * from jcl_org_comp where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '2', 'id', 'parent_company', 'comp_name', '', '', '', '', 2, '公司分部浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '2', 0, 1); INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('compBrowser', '1', '1', '', 'select * from jcl_org_comp where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '2', 'id', 'parent_company', 'comp_name', '', '', '', '', 2, '公司分部浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '2', 0, 1);
INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('compBrowser', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL); INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('compBrowser', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL);
INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('deptBrowser', '1', '1', '', 'select * from jcl_org_dept where delete_type = 0 and forbidden_tag = 0 ', '', '', '', '', '2', 'id', 'parent_dept', 'dept_name', '', '', '', '', 2, '部门浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '2', 0, 1); INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('deptBrowser', '1', '1', '', 'select * from jcl_org_dept where delete_type = 0 and forbidden_tag = 0 ', '', '', '', '', '2', 'id', 'parent_dept', 'dept_name', '', '', '', '', 2, '部门浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '2', 0, 1);
INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('deptBrowser', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL); INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('deptBrowser', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL);
INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('sequenceBrowser', '1', '1', '', 'select *,scheme_id as scheme_value from jcl_org_sequence where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '1', 'id', '', '', '', '', '', '', 2, '岗位序列', NULL, '', NULL, NULL, NULL, NULL, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '1', 0, 1); INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('sequenceBrowser', '1', '1', '', 'select id,sequence_no,sequence_name, scheme_id,scheme_id as scheme_value from jcl_org_sequence where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '1', 'id', '', '', '', '', '', '', 2, '岗位序列', NULL, '', NULL, NULL, NULL, NULL, '', '', TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL, '', '', '0', SYS_GUID(), '', '', '', '', '1', 0, 1);
SELECT max(id) INTO datashowset_id FROM DATASHOWSET; SELECT max(id) INTO datashowset_id FROM DATASHOWSET;
INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('sequenceBrowser', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL); INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('sequenceBrowser', '0', 0, TO_CHAR(SYSDATE,'yyyy-MM-dd'), TO_CHAR(SYSDATE,'HH24:mm:ss'), NULL, NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '编号', 'sequence_no', '', 0, 1, SYS_GUID(), NULL); INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '编号', 'sequence_no', '', 0, 1, SYS_GUID(), NULL);

@ -10,19 +10,33 @@ vleader int;
vdatebegin date; vdatebegin date;
vplan int; vplan int;
vonjob int; vonjob int;
vcnt int;
begin begin
if :new.companyname!=:old.companyname then if :new.companyname!=:old.companyname then
select count(1) into vcnt from jcl_info where id=1;
if vcnt=1 then
select to_number(fvalue) into vleader from jcl_info where id=1; select to_number(fvalue) into vleader from jcl_info where id=1;
end if;
select count(1) into vcnt from hrmresource where id=vleader;
if vcnt=1 then
select messagerurl,lastname,jobtitle into vleaderimg,vleadername,vleaderjobid select messagerurl,lastname,jobtitle into vleaderimg,vleadername,vleaderjobid
from hrmresource where id=vleader; from hrmresource where id=vleader;
end if;
select count(1) into vcnt from hrmjobtitles where id=vleaderjobid;
if vcnt=1 then
select jobtitlemark into vleaderjob from hrmjobtitles where id=vleaderjobid; select jobtitlemark into vleaderjob from hrmjobtitles where id=vleaderjobid;
end if;
select count(1) into vcnt from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=vleader;
if vcnt=1 then
select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata
where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=vleader; where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=vleader;
end if;
vdatebegin:=sysdate; vdatebegin:=sysdate;
select sum(nvl(staff_num,0)) into vplan from JCL_ORG_STAFF select sum(nvl(staff_num,0)) into vplan from JCL_ORG_STAFF
where plan_id in (select id from JCL_ORG_STAFFPLAN where time_start<=vdatebegin and time_end>=vdatebegin); where plan_id in (select id from JCL_ORG_STAFFPLAN where time_start<=vdatebegin and time_end>=vdatebegin);
@ -60,6 +74,7 @@ vdatebegin date;
vobjparentid int; vobjparentid int;
vplan int; vplan int;
vonjob int; vonjob int;
vcnt int;
begin begin
if :new.comp_name!=:old.comp_name or :new.comp_principal!=:old.comp_principal or :new.parent_company!=:old.parent_company if :new.comp_name!=:old.comp_name or :new.comp_principal!=:old.comp_principal or :new.parent_company!=:old.parent_company
or :new.forbidden_tag!=:old.forbidden_tag or :new.DELETE_TYPE!=:old.DELETE_TYPE then or :new.forbidden_tag!=:old.forbidden_tag or :new.DELETE_TYPE!=:old.DELETE_TYPE then
@ -68,13 +83,28 @@ begin
vparentid:=nvl(:new.parent_company,0); vparentid:=nvl(:new.parent_company,0);
vobjparentid:=nvl(:new.parent_company,0); vobjparentid:=nvl(:new.parent_company,0);
select count(1) into vcnt from HrmSubCompany where uuid=:new.uuid;
if vcnt=1 then
select id into vecid from HrmSubCompany where uuid=:new.uuid; select id into vecid from HrmSubCompany where uuid=:new.uuid;
end if;
select count(1) into vcnt from hrmresource where id=:new.comp_principal;
if vcnt=1 then
select messagerurl,lastname,jobtitle into vleaderimg,vleadername,vleaderjobid from hrmresource where id=:new.comp_principal; select messagerurl,lastname,jobtitle into vleaderimg,vleadername,vleaderjobid from hrmresource where id=:new.comp_principal;
end if;
select count(1) into vcnt from hrmjobtitles where id=vleaderjobid;
if vcnt=1 then
select jobtitlemark into vleaderjob from hrmjobtitles where id=vleaderjobid; select jobtitlemark into vleaderjob from hrmjobtitles where id=vleaderjobid;
end if;
select count(1) into vcnt from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.comp_principal;
if vcnt=1 then
select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata
where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.comp_principal; where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.comp_principal;
select sum(nvl(staff_num,0)) into vplan from JCL_ORG_STAFF end if;
where plan_id in (select id from JCL_ORG_STAFFPLAN where time_start<=vdatebegin and time_end>=vdatebegin) and comp_id=:new.id;
select sum(nvl(staff_num,0)) into vplan from JCL_ORG_STAFF;
select count(1) into vonjob from hrmresource where status<=3 and subcompanyid1=vecid; select count(1) into vonjob from hrmresource where status<=3 and subcompanyid1=vecid;
delete from jcl_org_map where ftype=1 and fobjid=:new.id and fdatebegin=vdatebegin; delete from jcl_org_map where ftype=1 and fobjid=:new.id and fdatebegin=vdatebegin;
@ -108,6 +138,7 @@ st int;
vleaderlv VARCHAR2(255); vleaderlv VARCHAR2(255);
vplan int; vplan int;
vonjob int; vonjob int;
vcnt int;
begin begin
if :new.dept_name!=:old.dept_name or :new.dept_principal!=:old.dept_principal or :new.parent_comp!=:old.parent_comp if :new.dept_name!=:old.dept_name or :new.dept_principal!=:old.dept_principal or :new.parent_comp!=:old.parent_comp
or :new.parent_dept!=:old.parent_dept or :new.forbidden_tag!=:old.forbidden_tag or :new.DELETE_TYPE!=:old.DELETE_TYPE then or :new.parent_dept!=:old.parent_dept or :new.forbidden_tag!=:old.forbidden_tag or :new.DELETE_TYPE!=:old.DELETE_TYPE then
@ -126,15 +157,28 @@ else
vobjparentid:=:new.parent_dept+st; vobjparentid:=:new.parent_dept+st;
end if; end if;
select count(1) into vcnt from HrmDepartment where uuid=:new.uuid;
if vcnt=1 then
select id into vecid from HrmDepartment where uuid=:new.uuid; select id into vecid from HrmDepartment where uuid=:new.uuid;
end if;
select count(1) into vcnt from hrmresource where id=:new.dept_principal;
if vcnt=1 then
select messagerurl,lastname,jobtitle into vleaderimg,vleadername,veaderjobid select messagerurl,lastname,jobtitle into vleaderimg,vleadername,veaderjobid
from hrmresource where id=:new.dept_principal; from hrmresource where id=:new.dept_principal;
end if;
select count(1) into vcnt from hrmjobtitles where id=:new.dept_principal;
if vcnt=1 then
select jobtitlemark into vleaderjob from hrmjobtitles where id=:new.dept_principal; select jobtitlemark into vleaderjob from hrmjobtitles where id=:new.dept_principal;
end if;
select count(1) into vcnt from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.dept_principal;
if vcnt=1 then
select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata
where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.dept_principal; where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.dept_principal;
end if;
select sum(nvl(staff_num,0)) into vplan from JCL_ORG_STAFF select sum(nvl(staff_num,0)) into vplan from JCL_ORG_STAFF
where plan_id in (select id from JCL_ORG_STAFFPLAN where time_start<=vdatebegin and time_end>=vdatebegin) and dept_id=:new.id; where plan_id in (select id from JCL_ORG_STAFFPLAN where time_start<=vdatebegin and time_end>=vdatebegin) and dept_id=:new.id;
@ -215,6 +259,7 @@ st int;
vleaderlv VARCHAR2(255); vleaderlv VARCHAR2(255);
vstr VARCHAR2(255); vstr VARCHAR2(255);
vwz int; vwz int;
vcnt int;
begin begin
if :new.lastname!=:old.lastname or :new.status!=:old.status then if :new.lastname!=:old.lastname or :new.status!=:old.status then
st:=100000000; st:=100000000;
@ -227,18 +272,30 @@ begin
else else
vdelete:=1; vdelete:=1;
end if; end if;
select count(1) into vcnt from hrmjobtitles where id=:new.jobtitle;
if vcnt=1 then
select jobtitlemark into vleaderjob from hrmjobtitles where id=:new.jobtitle; select jobtitlemark into vleaderjob from hrmjobtitles where id=:new.jobtitle;
end if;
select count(1) into vcnt from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.id;
if vcnt=1 then
select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata
where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.id; where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.id;
end if;
delete from jcl_org_map where ftype=4 and fobjid=:new.id and fdatebegin=vdatebegin; delete from jcl_org_map where ftype=4 and fobjid=:new.id and fdatebegin=vdatebegin;
update jcl_org_map set fdateend=vdatebegin-1 where ftype=4 and fobjid=:new.id and fdateend>vdatebegin; update jcl_org_map set fdateend=vdatebegin-1 where ftype=4 and fobjid=:new.id and fdateend>vdatebegin;
select nvl(field100002,'') into vstr from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.id;
vwz:=Instr(vstr,'_'); select count(1) into vcnt from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=-1 and id=:new.id;
if vcnt=1 then
select nvl(field100002,'') into vstr from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=-1 and id=:new.id;
end if;
vwz:=Instr(vstr,'_');
vobjparentid:=to_number(substr(vstr,vwz+1,length(vstr)-vwz)); vobjparentid:=to_number(substr(vstr,vwz+1,length(vstr)-vwz));
vparentid:=vobjparentid+sj; vparentid:=vobjparentid+sj;
@ -274,6 +331,7 @@ st int;
vleaderlv VARCHAR2(255); vleaderlv VARCHAR2(255);
vstr VARCHAR2(255); vstr VARCHAR2(255);
vwz int; vwz int;
vcnt int;
begin begin
if :new.field100002!=:old.field100002 then if :new.field100002!=:old.field100002 then
st:=100000000; st:=100000000;
@ -281,19 +339,28 @@ begin
sk:=300000000; sk:=300000000;
vdatebegin:=to_date(sysdate); vdatebegin:=to_date(sysdate);
select count(1) into vcnt from hrmresource where id=:new.id;
if vcnt=1 then
select workcode,lastname,case when status<=3 then 0 else 1 end,messagerurl,lastname,jobtitle,uuid select workcode,lastname,case when status<=3 then 0 else 1 end,messagerurl,lastname,jobtitle,uuid
into vnumber,vname,vdelete,vleaderimg,vleadername,vleaderjobid,vuuid from hrmresource where id=:new.id; into vnumber,vname,vdelete,vleaderimg,vleadername,vleaderjobid,vuuid from hrmresource where id=:new.id;
end if;
select count(1) into vcnt from hrmjobtitles where id=vleaderjobid;
if vcnt=1 then
select jobtitlemark into vleaderjob from hrmjobtitles where id=vleaderjobid; select jobtitlemark into vleaderjob from hrmjobtitles where id=vleaderjobid;
end if;
select count(1) into vcnt from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.id;
if vcnt=1 then
select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata select nvl(field100008,''),nvl(field100007,'') into vleaderst,vleaderlv from cus_fielddata
where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.id; where scope='HrmCustomFieldByInfoType' and scopeid=3 and id=:new.id;
end if;
vstr:=nvl(:new.field100002,''); vstr:=nvl(:new.field100002,'');
vwz:=Instr(vstr,'_'); vwz:=Instr(vstr,'_');
vobjparentid:=to_number(substr(vstr,vwz+1,length(vstr)-vwz)); vobjparentid:=to_number(substr(vstr,vwz+1,length(vstr)-vwz));
vparentid:=vobjparentid+sj; vparentid:=vobjparentid+sj;
delete from jcl_org_map where ftype=4 and fobjid=:new.id and fdatebegin=vdatebegin; delete from jcl_org_map where ftype=4 and fobjid=:new.id and fdatebegin=vdatebegin;
update jcl_org_map set fdateend=vdatebegin-1 where ftype=4 and fobjid=:new.id and fdateend>vdatebegin; update jcl_org_map set fdateend=vdatebegin-1 where ftype=4 and fobjid=:new.id and fdateend>vdatebegin;
if vdelete=0 then if vdelete=0 then

@ -342,6 +342,8 @@ CREATE TABLE JCL_ORG_JOB (
WORK_AUTHORITY NVARCHAR2(1000) NULL, WORK_AUTHORITY NVARCHAR2(1000) NULL,
FORBIDDEN_TAG NUMBER NULL, FORBIDDEN_TAG NUMBER NULL,
SHOW_ORDER NUMBER NULL, SHOW_ORDER NUMBER NULL,
GRADE_ID NVARCHAR2(100) NULL,
LEVEL_ID NVARCHAR2(100) NULL,
IS_USED NUMBER NULL, IS_USED NUMBER NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
@ -395,6 +397,10 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL, CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL, UPDATE_TIME DATE NULL,
POST_ID NVARCHAR2(100) NULL,
POST_INFO_ID NVARCHAR2(100) NULL,
POST_IDSPAN NVARCHAR2(1000) NULL,
POST_INFO_IDSPAN NVARCHAR2(1000) NULL,
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (ID) CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (ID)
) )
/ /
@ -515,6 +521,7 @@ CREATE TABLE JCL_ORG_STAFFPLAN (
TIME_START DATE NULL, TIME_START DATE NULL,
TIME_END DATE NULL, TIME_END DATE NULL,
COMPANY_ID NVARCHAR2(100) NULL, COMPANY_ID NVARCHAR2(100) NULL,
CONTROL_DIMENSION NVARCHAR2(5) NULL,
DESCRIPTION NVARCHAR2(1000) NULL, DESCRIPTION NVARCHAR2(1000) NULL,
FORBIDDEN_TAG NUMBER NULL, FORBIDDEN_TAG NUMBER NULL,
IS_USED NUMBER NULL, IS_USED NUMBER NULL,

@ -49,6 +49,22 @@ INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFI
GO GO
declare @datashowset_id int
declare @current_date varchar(100)
declare @current_time varchar(100)
select @current_date = CONVERT(varchar(100), GETDATE(), 23)
select @current_time = CONVERT(varchar(100), GETDATE(), 24)
INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA, SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL, BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER, WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME, onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl, isPhyPage, subcompanyid, unconditionalQuery) VALUES ('PostInfoBrowser', '1', '1', '', 'select * from jcl_org_post_info where delete_type = 0 and forbidden_tag = 0', '', '', '', '', '1', 'id', '', '', '', '', '', '', 2, '职务信息浏览按钮', NULL, '', NULL, NULL, NULL, NULL, '', '', @current_date, @current_time, NULL, NULL, '', '', '0', newid(), '', '', '', '', '1', 0, 1)
set @datashowset_id = (select max(id) from datashowset)
INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) VALUES ('PostInfoBrowser', '0', 0, @current_date, @current_time, NULL, NULL)
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '编号', 'post_info_no', '', 1, 1, newid(), NULL)
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '名称', 'post_info_name', '', 0, 2, newid(), NULL)
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '职务分类', 'post_id', '', 0, 3, newid(), NULL)
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '编号', 'post_info_no', '2', '', 1, newid(), '')
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(@datashowset_id, '名称', 'post_info_name', '2', '', 2, newid(), '')
GO
declare @datashowset_id int declare @datashowset_id int
declare @current_date varchar(100) declare @current_date varchar(100)
declare @current_time varchar(100) declare @current_time varchar(100)

@ -317,8 +317,8 @@
<select id="listCompsByIds" resultType="java.util.Map"> <select id="listCompsByIds" resultType="java.util.Map">
select select
id, id as "id",
comp_name as name comp_name as "name"
from jcl_org_comp t from jcl_org_comp t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -93,8 +93,8 @@
<select id="listDeptsByIds" resultType="java.util.Map"> <select id="listDeptsByIds" resultType="java.util.Map">
select select
id, id as "id",
dept_name as name dept_name as "name"
from jcl_org_dept t from jcl_org_dept t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -29,12 +29,20 @@ public interface ExtMapper {
int countExtById(ExtendInfoParams params); int countExtById(ExtendInfoParams params);
/** /**
* *
* *
* @param params * @param params
* @return * @return
*/ */
int insertExt(ExtendInfoParams params); int insertTable(ExtendInfoParams params);
/**
*
*
* @param params
* @return
*/
int insertExtTable(ExtendInfoParams params);
/** /**
* *
@ -42,5 +50,5 @@ public interface ExtMapper {
* @param params * @param params
* @return * @return
*/ */
int updateExt(ExtendInfoParams params); int updateTable(ExtendInfoParams params);
} }

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.extend.ExtMapper"> <mapper namespace="com.engine.organization.mapper.extend.ExtMapper">
<insert id="insertExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams" <insert id="insertTable" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams"
keyProperty="id" keyProperty="id"
keyColumn="id" useGeneratedKeys="true"> keyColumn="id" useGeneratedKeys="true">
insert into ${tableName} ( insert into ${tableName} (
@ -17,8 +17,9 @@
) )
</insert> </insert>
<insert id="insertExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams" databaseId="oracle"> <insert id="insertTable" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams"
<selectKey keyProperty="id" resultType="long" order="AFTER"> databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select ${sequenceName}.currval from dual select ${sequenceName}.currval from dual
</selectKey> </selectKey>
@ -33,8 +34,20 @@
</foreach> </foreach>
) )
</insert> </insert>
<insert id="insertExtTable" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams">
insert into ${tableName} (
<foreach collection="params" item="value" index="key" separator=",">
${key}
</foreach>
)
values (
<foreach collection="params" item="value" index="key" separator=",">
#{value}
</foreach>
)
</insert>
<update id="updateExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams"> <update id="updateTable" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams">
update ${tableName} set update ${tableName} set
<foreach collection="params" item="value" index="key" separator=","> <foreach collection="params" item="value" index="key" separator=",">
${key} = #{value} ${key} = #{value}

@ -396,8 +396,8 @@
</select> </select>
<select id="listJobsByIds" resultType="java.util.Map"> <select id="listJobsByIds" resultType="java.util.Map">
select select
id, id as "id",
job_name as name job_name as "name"
from jcl_org_job t from jcl_org_job t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -51,8 +51,8 @@
<select id="listPostInfosByIds" resultType="java.util.Map"> <select id="listPostInfosByIds" resultType="java.util.Map">
select select
id, id as "id",
post_info_name as name post_info_name as "name"
from jcl_org_post_info t from jcl_org_post_info t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -38,8 +38,8 @@
<!-- 浏览按钮赋值、展示用 --> <!-- 浏览按钮赋值、展示用 -->
<select id="listPostsByIds" resultType="java.util.Map"> <select id="listPostsByIds" resultType="java.util.Map">
select select
id, id as "id",
post_name as name post_name as "name"
from jcl_org_post t from jcl_org_post t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -68,8 +68,8 @@
</select> </select>
<select id="listGradessByIds" resultType="java.util.Map"> <select id="listGradessByIds" resultType="java.util.Map">
select select
id, id as "id",
grade_name as name grade_name as "name"
from jcl_org_grade t from jcl_org_grade t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -57,8 +57,8 @@
<select id="listLevelsByIds" resultType="java.util.Map"> <select id="listLevelsByIds" resultType="java.util.Map">
select select
id, id as "id",
level_name as name level_name as "name"
from jcl_org_level t from jcl_org_level t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -47,8 +47,8 @@
</select> </select>
<select id="listSchemesByIds" resultType="java.util.Map"> <select id="listSchemesByIds" resultType="java.util.Map">
select select
id, id as "id",
scheme_name as name scheme_name as "name"
from jcl_org_scheme t from jcl_org_scheme t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -51,8 +51,8 @@
<select id="listSequencesByIds" resultType="java.util.Map"> <select id="listSequencesByIds" resultType="java.util.Map">
select select
id, id as "id",
sequence_name as name sequence_name as "name"
from jcl_org_sequence t from jcl_org_sequence t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -52,8 +52,8 @@
</select> </select>
<select id="listPlansByIds" resultType="java.util.Map"> <select id="listPlansByIds" resultType="java.util.Map">
select select
id, id as "id",
plan_name as name plan_name as "name"
from jcl_org_staffplan t from jcl_org_staffplan t
WHERE delete_type = 0 WHERE delete_type = 0
AND id IN AND id IN

@ -178,7 +178,7 @@ public class CompServiceImpl extends Service implements CompService {
} }
String oldCompNo = getCompMapper().listById(searchParam.getId()).getCompNo(); String oldCompNo = getCompMapper().listById(searchParam.getId()).getCompNo();
String compNo = searchParam.getCompNo(); String compNo = searchParam.getCompNo();
if (!oldCompNo.equals(compNo)) { if (!compNo.equals(oldCompNo)) {
compNo = repeatDetermine(compNo); compNo = repeatDetermine(compNo);
params.put("comp_no", compNo); params.put("comp_no", compNo);
} }

@ -230,7 +230,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
String oldDeptNo = getDepartmentMapper().getDeptById(searchParam.getId()).getDeptNo(); String oldDeptNo = getDepartmentMapper().getDeptById(searchParam.getId()).getDeptNo();
String deptNo = searchParam.getDeptNo(); String deptNo = searchParam.getDeptNo();
if (!oldDeptNo.equals(deptNo)) { if (!deptNo.equals(oldDeptNo)) {
deptNo = repeatDetermine(deptNo); deptNo = repeatDetermine(deptNo);
params.put("dept_no", deptNo); params.put("dept_no", deptNo);
} }

@ -232,14 +232,14 @@ public class ExtServiceImpl extends Service implements ExtService {
int count = getExtMapper().countExtById(infoParams); int count = getExtMapper().countExtById(infoParams);
if (count > 0) { if (count > 0) {
map.put("update_time", new Date()); map.put("update_time", new Date());
getExtMapper().updateExt(infoParams); getExtMapper().updateTable(infoParams);
} else { } else {
map.put("creator", user.getUID()); map.put("creator", user.getUID());
map.put("delete_type", 0); map.put("delete_type", 0);
map.put("create_time", new Date()); map.put("create_time", new Date());
map.put("update_time", new Date()); map.put("update_time", new Date());
map.put("id", id); map.put("id", id);
getExtMapper().insertExt(infoParams); getExtMapper().insertExtTable(infoParams);
} }
} else { } else {
if (!tableName.equals("JCL_ORG_HRMRESOURCE")) { if (!tableName.equals("JCL_ORG_HRMRESOURCE")) {
@ -249,7 +249,7 @@ public class ExtServiceImpl extends Service implements ExtService {
map.put("delete_type", 0); map.put("delete_type", 0);
map.put("create_time", new Date()); map.put("create_time", new Date());
map.put("update_time", new Date()); map.put("update_time", new Date());
getExtMapper().insertExt(infoParams); getExtMapper().insertTable(infoParams);
} }
return infoParams.getId(); return infoParams.getId();
} }

@ -641,7 +641,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.put("forbidden_tag", 0); map.put("forbidden_tag", 0);
} }
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build(); ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build();
MapperProxyFactory.getProxy(ExtMapper.class).insertExt(infoParams); MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
map.put("id", infoParams.getId()); map.put("id", infoParams.getId());
new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, map).run(); new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, map).run();
historyDetailPO.setOperateDetail("添加成功"); historyDetailPO.setOperateDetail("添加成功");
@ -657,7 +657,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
} }
if (checkRepeatNo(compNo, COMPANY_TYPE, companyId)) { if (checkRepeatNo(compNo, COMPANY_TYPE, companyId)) {
map.put("update_time", new Date()); map.put("update_time", new Date());
MapperProxyFactory.getProxy(ExtMapper.class).updateExt(ExtendInfoParams.builder().id(companyId).tableName("JCL_ORG_COMP").params(map).build()); MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(companyId).tableName("JCL_ORG_COMP").params(map).build());
map.put("id", companyId); map.put("id", companyId);
new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, map).run(); new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, map).run();
historyDetailPO.setOperateDetail("更新成功"); historyDetailPO.setOperateDetail("更新成功");
@ -828,7 +828,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.put("forbidden_tag", 0); map.put("forbidden_tag", 0);
} }
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_DEPT").params(map).build(); ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_DEPT").params(map).build();
MapperProxyFactory.getProxy(ExtMapper.class).insertExt(infoParams); MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
map.put("id", infoParams.getId()); map.put("id", infoParams.getId());
new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, map).run(); new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, map).run();
historyDetailPO.setOperateDetail("添加成功"); historyDetailPO.setOperateDetail("添加成功");
@ -844,7 +844,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
} }
if (checkRepeatNo(deptNo, DEPARTMENT_TYPE, departmentId)) { if (checkRepeatNo(deptNo, DEPARTMENT_TYPE, departmentId)) {
map.put("update_time", new Date()); map.put("update_time", new Date());
MapperProxyFactory.getProxy(ExtMapper.class).updateExt(ExtendInfoParams.builder().id(departmentId).tableName("JCL_ORG_DEPT").params(map).build()); MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(departmentId).tableName("JCL_ORG_DEPT").params(map).build());
map.put("id", departmentId); map.put("id", departmentId);
new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, map).run(); new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, map).run();
historyDetailPO.setOperateDetail("更新成功"); historyDetailPO.setOperateDetail("更新成功");
@ -1043,7 +1043,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.put("forbidden_tag", 0); map.put("forbidden_tag", 0);
} }
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_JOB").params(map).build(); ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_JOB").params(map).build();
MapperProxyFactory.getProxy(ExtMapper.class).insertExt(infoParams); MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
map.put("jobactivityid", JobServiceImpl.JOB_ACTIVITY_ID); map.put("jobactivityid", JobServiceImpl.JOB_ACTIVITY_ID);
map.put("id", infoParams.getId()); map.put("id", infoParams.getId());
new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, map).run(); new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, map).run();
@ -1060,7 +1060,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
} }
if (checkRepeatNo(jobNo, JOB_TYPE, jobId)) { if (checkRepeatNo(jobNo, JOB_TYPE, jobId)) {
map.put("update_time", new Date()); map.put("update_time", new Date());
MapperProxyFactory.getProxy(ExtMapper.class).updateExt(ExtendInfoParams.builder().id(jobId).tableName("JCL_ORG_JOB").params(map).build()); MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(jobId).tableName("JCL_ORG_JOB").params(map).build());
map.put("jobactivityid", JobServiceImpl.JOB_ACTIVITY_ID); map.put("jobactivityid", JobServiceImpl.JOB_ACTIVITY_ID);
map.put("id", jobId); map.put("id", jobId);
new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, map).run(); new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, map).run();

@ -347,7 +347,7 @@ public class JobServiceImpl extends Service implements JobService {
JobPO oldJobPO = getJobMapper().getJobById(searchParam.getId()); JobPO oldJobPO = getJobMapper().getJobById(searchParam.getId());
String oldJobNo = oldJobPO.getJobNo(); String oldJobNo = oldJobPO.getJobNo();
String jobNo = searchParam.getJobNo(); String jobNo = searchParam.getJobNo();
if (!oldJobNo.equals(jobNo)) { if (!jobNo.equals(oldJobNo)) {
jobNo = repeatDetermine(jobNo); jobNo = repeatDetermine(jobNo);
params.put("job_no", jobNo); params.put("job_no", jobNo);
} }

@ -4,6 +4,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.service.OrgChartService; import com.engine.organization.service.OrgChartService;
import com.engine.organization.util.db.DBType;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.hrm.User; import weaver.hrm.User;
@ -31,7 +32,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
defaultItem.put("id", "0"); defaultItem.put("id", "0");
defaultItem.put("companyname", "行政维度"); defaultItem.put("companyname", "行政维度");
fclasslist.add(defaultItem); fclasslist.add(defaultItem);
while(rs.next()) { while (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
item.put("companyname", rs.getString("companyname")); item.put("companyname", rs.getString("companyname"));
@ -42,7 +43,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
List<Map<String, Object>> companylist = new ArrayList<>(); List<Map<String, Object>> companylist = new ArrayList<>();
Map<String, Object> defaultCompanyItem = new HashMap<>(); Map<String, Object> defaultCompanyItem = new HashMap<>();
companylist.add(defaultCompanyItem); companylist.add(defaultCompanyItem);
while(rs.next()) { while (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
item.put("fnumber", rs.getString("fnumber")); item.put("fnumber", rs.getString("fnumber"));
@ -57,26 +58,29 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
private String companyDateWhereSql(Map<String, Object> request2Map) { private String companyDateWhereSql(Map<String, Object> request2Map) {
String date = (String) request2Map.get("date"); // 数据日期 String date = (String) request2Map.get("date"); // 数据日期
if(StringUtils.isBlank(date)) { if (StringUtils.isBlank(date)) {
date = DateUtil.format( DateUtil.offset(new Date() , DateField.DAY_OF_MONTH, 1), "yyyy-MM-dd"); date = DateUtil.format(DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, 1), "yyyy-MM-dd");
} }
String fclass = (String) request2Map.get("fclass"); // 维度 String fclass = (String) request2Map.get("fclass"); // 维度
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织 String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
if(StringUtils.isBlank(fisvitual)) { if (StringUtils.isBlank(fisvitual)) {
fisvitual = "0"; fisvitual = "0";
} }
String whereSql = " where 1 = 1 "; String whereSql = " where 1 = 1 ";
whereSql += " and ((fdatebegin <= '"+ date +"' and fdateend >= '"+ date +"') or (fdatebegin <= '"+ date +"' and fdateend is null )) "; if (DBType.isOracle()) {
whereSql += " and fclass = " + fclass +" "; whereSql += " and ((fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and fdateend >= to_date('" + date + "','yyyy-MM-DD')) or (fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and fdateend is null )) ";
} else {
whereSql += " and ((fdatebegin <= '" + date + "' and fdateend >= '" + date + "') or (fdatebegin <= '" + date + "' and fdateend is null )) ";
}
whereSql += " and fclass = " + fclass + " ";
if("0".equals(fisvitual)) { if ("0".equals(fisvitual)) {
whereSql += " and fisvitual = 0 "; whereSql += " and fisvitual = 0 ";
}else { } else {
whereSql += " and fisvitual in (0, 1) "; whereSql += " and fisvitual in (0, 1) ";
} }
@ -89,16 +93,16 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
String root = (String) request2Map.get("root"); // 根节点 String root = (String) request2Map.get("root"); // 根节点
String level = (String) request2Map.get("level"); // 显示层级 String level = (String) request2Map.get("level"); // 显示层级
if(StringUtils.isBlank(level)) { if (StringUtils.isBlank(level)) {
level = "3"; level = "3";
} }
String whereSql = companyDateWhereSql(request2Map); String whereSql = companyDateWhereSql(request2Map);
String whereItemSql = " "; String whereItemSql = " ";
if("0".equals(root)) { // 集团的情况 if ("0".equals(root)) { // 集团的情况
whereItemSql += " and ftype = 0 "; whereItemSql += " and ftype = 0 ";
} else { } else {
whereItemSql += " and id = '" + root +"' "; whereItemSql += " and id = '" + root + "' ";
} }
// 获取根节点 // 获取根节点
@ -106,7 +110,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql + whereItemSql); rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql + whereItemSql);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
String id = null; String id = null;
if(rs.next()) { if (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
id = rs.getString("id"); id = rs.getString("id");
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
@ -120,7 +124,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
} }
int currentLevel = 1; int currentLevel = 1;
if(currentLevel + 1 <= Integer.parseInt(level)) { if (currentLevel + 1 <= Integer.parseInt(level)) {
findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true); findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
} }
@ -133,7 +137,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
private void findCompanyItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) { private void findCompanyItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) {
rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql + " and fparentid = " + id); rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql + " and fparentid = " + id);
List<Map<String, Object>> currentList = new ArrayList<>(); List<Map<String, Object>> currentList = new ArrayList<>();
while(rs.next()) { while (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname")); item.put("fname", rs.getString("fname"));
@ -148,9 +152,9 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
list.addAll(currentList); list.addAll(currentList);
for (Map<String, Object> stringObjectMap : currentList) { for (Map<String, Object> stringObjectMap : currentList) {
if(currentLevel + 1 <= Integer.parseInt(level)) { if (currentLevel + 1 <= Integer.parseInt(level)) {
findCompanyItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, true); findCompanyItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, true);
} else if(currentLevel == Integer.parseInt(level)) { } else if (currentLevel == Integer.parseInt(level)) {
findCompanyItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, false); findCompanyItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, false);
} }
} }
@ -159,25 +163,29 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
private String userWhereSql(Map<String, Object> request2Map) { private String userWhereSql(Map<String, Object> request2Map) {
String date = (String) request2Map.get("date"); // 数据日期 String date = (String) request2Map.get("date"); // 数据日期
if(StringUtils.isBlank(date)) { if (StringUtils.isBlank(date)) {
date = DateUtil.format( DateUtil.offset(new Date() , DateField.DAY_OF_MONTH, 1), "yyyy-MM-dd"); date = DateUtil.format(DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, 1), "yyyy-MM-dd");
} }
String fclass = (String) request2Map.get("fclass"); // 维度 String fclass = (String) request2Map.get("fclass"); // 维度
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织 String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
if(StringUtils.isBlank(fisvitual)) { if (StringUtils.isBlank(fisvitual)) {
fisvitual = "0"; fisvitual = "0";
} }
String whereSql = " where 1 = 1 "; String whereSql = " where 1 = 1 ";
whereSql += " and ((t.fdatebegin <= '"+ date +"' and t.fdateend >= '"+ date +"') or (t.fdatebegin <= '"+ date +"' and t.fdateend is null )) "; if (DBType.isOracle()) {
whereSql += " and t.fclass = " + fclass +" "; whereSql += " and ((t.fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and t.fdateend >= to_date('" + date + "','yyyy-MM-DD')) or (t.fdatebegin <= to_date('" + date + "','yyyy-MM-DD') and t.fdateend is null )) ";
} else {
whereSql += " and ((t.fdatebegin <= '" + date + "' and t.fdateend >= '" + date + "') or (t.fdatebegin <= '" + date + "' and t.fdateend is null )) ";
}
whereSql += " and t.fclass = " + fclass + " ";
if("0".equals(fisvitual)) { if ("0".equals(fisvitual)) {
whereSql += " and t.fisvitual = 0 "; whereSql += " and t.fisvitual = 0 ";
}else { } else {
whereSql += " and t.fisvitual in (0, 1) "; whereSql += " and t.fisvitual in (0, 1) ";
} }
return whereSql; return whereSql;
@ -187,17 +195,17 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
public Map<String, Object> getUserData(Map<String, Object> request2Map, User user) { public Map<String, Object> getUserData(Map<String, Object> request2Map, User user) {
String root = (String) request2Map.get("root"); // 根节点 String root = (String) request2Map.get("root"); // 根节点
String level = (String) request2Map.get("level"); // 显示层级 String level = (String) request2Map.get("level"); // 显示层级
if(StringUtils.isBlank(level)) { if (StringUtils.isBlank(level)) {
level = "3"; level = "3";
} }
String whereSql = userWhereSql(request2Map); String whereSql = userWhereSql(request2Map);
String whereItemSql = " "; String whereItemSql = " ";
if("0".equals(root)) { // 集团的情况 if ("0".equals(root)) { // 集团的情况
whereItemSql += " and t.ftype = 0 "; whereItemSql += " and t.ftype = 0 ";
} else { } else {
whereItemSql += " and t.id = '" + root +"' "; whereItemSql += " and t.id = '" + root + "' ";
} }
// 获取根节点 // 获取根节点
@ -205,7 +213,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader from jcl_org_map t " + whereSql + whereItemSql); rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader from jcl_org_map t " + whereSql + whereItemSql);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
String id = null; String id = null;
if(rs.next()) { if (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
id = rs.getString("id"); id = rs.getString("id");
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
@ -225,7 +233,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
} }
int currentLevel = 1; int currentLevel = 1;
if(currentLevel + 1 <= Integer.parseInt(level)) { if (currentLevel + 1 <= Integer.parseInt(level)) {
findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true); findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
} }
@ -240,12 +248,12 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
String ids = (String) request2Map.get("ids"); String ids = (String) request2Map.get("ids");
String whereSql = userWhereSql(request2Map); String whereSql = userWhereSql(request2Map);
whereSql += " and fparentid in (" +ids+ ") "; whereSql += " and fparentid in (" + ids + ") ";
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader from jcl_org_map t " + whereSql ); rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader from jcl_org_map t " + whereSql);
List<Map<String, Object>> currentList = new ArrayList<>(); List<Map<String, Object>> currentList = new ArrayList<>();
while(rs.next()) { while (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname")); item.put("fname", rs.getString("fname"));
@ -291,12 +299,12 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
String ids = (String) request2Map.get("ids"); String ids = (String) request2Map.get("ids");
String whereSql = companyDateWhereSql(request2Map); String whereSql = companyDateWhereSql(request2Map);
whereSql += " and fparentid in (" +ids+ ") "; whereSql += " and fparentid in (" + ids + ") ";
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql); rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql);
List<Map<String, Object>> currentList = new ArrayList<>(); List<Map<String, Object>> currentList = new ArrayList<>();
while(rs.next()) { while (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname")); item.put("fname", rs.getString("fname"));
@ -316,7 +324,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
private void findUserItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) { private void findUserItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) {
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber from jcl_org_map t " + whereSql + " and t.fparentid = " + id); rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber from jcl_org_map t " + whereSql + " and t.fparentid = " + id);
List<Map<String, Object>> currentList = new ArrayList<>(); List<Map<String, Object>> currentList = new ArrayList<>();
while(rs.next()) { while (rs.next()) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id")); item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname")); item.put("fname", rs.getString("fname"));
@ -334,9 +342,9 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
} }
for (Map<String, Object> stringObjectMap : currentList) { for (Map<String, Object> stringObjectMap : currentList) {
if("4".equals(stringObjectMap.get("ftype"))) { // 员工信息 if ("4".equals(stringObjectMap.get("ftype"))) { // 员工信息
rs.executeQuery("select id, mobile, homeaddress from hrmresource where id = ? ", stringObjectMap.get("fnumber")); rs.executeQuery("select id, mobile, homeaddress from hrmresource where id = ? ", stringObjectMap.get("fnumber"));
if(rs.next()) { if (rs.next()) {
stringObjectMap.put("mobile", rs.getString("mobile")); stringObjectMap.put("mobile", rs.getString("mobile"));
stringObjectMap.put("address", rs.getString("homeaddress")); stringObjectMap.put("address", rs.getString("homeaddress"));
} }
@ -344,14 +352,14 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
"left join hrmdepartment d\n" + "left join hrmdepartment d\n" +
"on hrm.departmentid = d.id\n" + "on hrm.departmentid = d.id\n" +
"where hrm.id = ? ", stringObjectMap.get("fnumber")); "where hrm.id = ? ", stringObjectMap.get("fnumber"));
if(rs.next()) { if (rs.next()) {
stringObjectMap.put("department", rs.getString("departmentname")); stringObjectMap.put("department", rs.getString("departmentname"));
} }
} }
if(currentLevel + 1 <= Integer.parseInt(level)) { if (currentLevel + 1 <= Integer.parseInt(level)) {
findUserItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, true); findUserItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, true);
} else if(currentLevel == Integer.parseInt(level) ) { // 多查一层 } else if (currentLevel == Integer.parseInt(level)) { // 多查一层
findUserItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, false); findUserItemByParantId((String) stringObjectMap.get("id"), currentLevel + 1, level, rs, list, whereSql, false);
} }
} }
@ -360,12 +368,12 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
private boolean hasChildren(String id, boolean isCompany) { private boolean hasChildren(String id, boolean isCompany) {
String whereSql = " where fparentid = " + id + " "; String whereSql = " where fparentid = " + id + " ";
if(isCompany) { if (isCompany) {
whereSql += " and ftype in (0, 1, 2) "; whereSql += " and ftype in (0, 1, 2) ";
} }
grs.executeQuery("select count(1) as count from jcl_org_map " + whereSql); grs.executeQuery("select count(1) as count from jcl_org_map " + whereSql);
String count = "0"; String count = "0";
if(grs.next()) { if (grs.next()) {
count = grs.getString("count"); count = grs.getString("count");
} }
return !"0".equals(count); return !"0".equals(count);

@ -436,7 +436,7 @@ public class OrganizationRunable implements Runnable {
departmentMap.put("uuid", uuid); departmentMap.put("uuid", uuid);
long jclTableId = Long.parseLong(Util.null2String(params.get("id"))); long jclTableId = Long.parseLong(Util.null2String(params.get("id")));
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(jclTableName).params(departmentMap).id(jclTableId).build(); ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName(jclTableName).params(departmentMap).id(jclTableId).build();
getExtMapper().updateExt(infoParams); getExtMapper().updateTable(infoParams);
} }
} }

@ -97,7 +97,7 @@ public class CusFieldDataTrigger {
hrmResourceMap.put("departmentid", ecBmId); hrmResourceMap.put("departmentid", ecBmId);
// 公司 // 公司
hrmResourceMap.put("subcompanyid1", ecGsId); hrmResourceMap.put("subcompanyid1", ecGsId);
MapperProxyFactory.getProxy(ExtMapper.class).updateExt(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build()); MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build());
updateFlag = true; updateFlag = true;
} }

Loading…
Cancel
Save