!227 分部、部门按钮;SQL脚本

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

@ -35,3 +35,5 @@ DROP TRIGGER IF EXISTS JCL_ORG_job_ed;
DROP TRIGGER IF EXISTS JCL_ORG_job_del;
DROP TRIGGER IF EXISTS hrmresource_ed;
DROP TRIGGER IF EXISTS cus_fielddata_jclgw;
update WORKFLOW_BROWSERURL set TYPEID = 2 where id ='666';

@ -122,4 +122,7 @@ if V_NUM > 0 then
execute immediate 'DROP TRIGGER cus_fielddata_jclgw';
end if;
END;
/
update WORKFLOW_BROWSERURL set TYPEID = 2 where id ='666'
/

@ -1,5 +1,7 @@
alter table JCL_ORG_STAFFS add description varchar(200)
GO
update WORKFLOW_BROWSERURL set TYPEID = 2 where id ='666'
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_ITEMCLASS]') AND type IN ('U'))
DROP TABLE [dbo].[JCL_ORG_ITEMCLASS]
@ -50,30 +52,3 @@ ALTER TABLE [dbo].[JCL_ORG_ITEM] ADD CONSTRAINT [JCL_ORG_ITEM_PK] PRIMARY KEY CL
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[HrmCompany_ed]') AND type IN ('TR'))
DROP TRIGGER [dbo].[HrmCompany_ed]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_COMP_ed]') AND type IN ('TR'))
DROP TRIGGER [dbo].[JCL_ORG_COMP_ed]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_COMP_del]') AND type IN ('TR'))
DROP TRIGGER [dbo].[JCL_ORG_COMP_del]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_dept_ed]') AND type IN ('TR'))
DROP TRIGGER [dbo].[JCL_ORG_dept_ed]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_dept_del]') AND type IN ('TR'))
DROP TRIGGER [dbo].[JCL_ORG_dept_del]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_job_ed]') AND type IN ('TR'))
DROP TRIGGER [dbo].[JCL_ORG_job_ed]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[JCL_ORG_job_del]') AND type IN ('TR'))
DROP TRIGGER [dbo].[JCL_ORG_job_del]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[hrmresource_ed]') AND type IN ('TR'))
DROP TRIGGER [dbo].[hrmresource_ed]
GO
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[cus_fielddata_jclgw]') AND type IN ('TR'))
DROP TRIGGER [dbo].[cus_fielddata_jclgw]
GO

@ -38,8 +38,8 @@ 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_info_no', '', 0, 1, uuid(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '名称', 'post_info_name', '', 1, 2, uuid(), 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, 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(), '');

@ -84,6 +84,7 @@ CREATE TABLE `jcl_org_comp` (
`comp_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`comp_name_short` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`parent_company` int(11) NULL DEFAULT NULL,
`ec_company` int(11) NULL DEFAULT NULL,
`org_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`industry` int(11) NULL DEFAULT NULL,
`comp_principal` int(11) NULL DEFAULT NULL,
@ -133,7 +134,9 @@ CREATE TABLE `jcl_org_dept` (
`dept_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`dept_name_short` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`parent_comp` int(11) NULL DEFAULT NULL,
`ec_company` int(11) NULL DEFAULT NULL,
`parent_dept` int(11) NULL DEFAULT NULL,
`ec_department` int(11) NULL DEFAULT NULL,
`dept_principal` int(11) NULL DEFAULT NULL,
`show_order` int(11) NULL DEFAULT NULL,
`description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
@ -482,7 +485,9 @@ CREATE TABLE `jcl_org_staff` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`plan_id` int(11) NULL DEFAULT NULL,
`comp_id` int(11) NULL DEFAULT NULL,
`ec_company` int(11) NULL DEFAULT NULL,
`dept_id` int(11) NULL DEFAULT NULL,
`ec_department` int(11) NULL DEFAULT NULL,
`job_id` int(11) NULL DEFAULT NULL,
`staff_num` int(11) NULL DEFAULT NULL,
`control_policy` int(11) NULL DEFAULT NULL,
@ -508,6 +513,7 @@ CREATE TABLE `jcl_org_staffplan` (
`time_start` date NULL DEFAULT NULL,
`time_end` date NULL DEFAULT NULL,
`company_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`ec_company` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`control_dimension` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`description` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`forbidden_tag` int(11) NULL DEFAULT NULL,

@ -104,6 +104,7 @@ CREATE TABLE JCL_ORG_COMP (
COMP_NAME NVARCHAR2(100) NULL,
COMP_NAME_SHORT NVARCHAR2(100) NULL,
PARENT_COMPANY NUMBER NULL,
EC_COMPANY NUMBER NULL,
ORG_CODE NVARCHAR2(100) NULL,
INDUSTRY NUMBER NULL,
COMP_PRINCIPAL NUMBER NULL,
@ -212,7 +213,9 @@ CREATE TABLE JCL_ORG_DEPT (
DEPT_NAME NVARCHAR2(100) NULL,
DEPT_NAME_SHORT NVARCHAR2(100) NULL,
PARENT_COMP NUMBER NULL,
EC_COMPANY NUMBER NULL,
PARENT_DEPT NUMBER NULL,
EC_DEPARTMENT NUMBER NULL,
DEPT_PRINCIPAL NUMBER NULL,
SHOW_ORDER NUMBER NULL,
DESCRIPTION NVARCHAR2(1000) NULL,
@ -427,6 +430,7 @@ CREATE TABLE JCL_ORG_STAFFPLAN (
TIME_START DATE NULL,
TIME_END DATE NULL,
COMPANY_ID NVARCHAR2(100) NULL,
EC_COMPANY NVARCHAR2(100) NULL,
CONTROL_DIMENSION NVARCHAR2(5) NULL,
DESCRIPTION NVARCHAR2(1000) NULL,
FORBIDDEN_TAG NUMBER NULL,
@ -444,7 +448,9 @@ CREATE TABLE JCL_ORG_STAFF (
ID NUMBER NOT NULL,
PLAN_ID NUMBER NULL,
COMP_ID NUMBER NULL,
EC_COMPANY NUMBER NULL,
DEPT_ID NUMBER NULL,
EC_DEPARTMENT NUMBER NULL,
JOB_ID NUMBER NULL,
STAFF_NUM NUMBER NULL,
CONTROL_POLICY NUMBER NULL,

@ -58,8 +58,8 @@ 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_info_no', '', 0, 1, newid(), NULL)
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(@datashowset_id, '名称', 'post_info_name', '', 1, 2, newid(), 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, 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(), '')

@ -109,6 +109,7 @@ CREATE TABLE [dbo].[JCL_ORG_COMP] (
[comp_name] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[comp_name_short] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[parent_company] int NULL,
[ec_company] int NULL,
[org_code] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[industry] int NULL,
[comp_principal] int NULL,
@ -170,7 +171,9 @@ CREATE TABLE [dbo].[JCL_ORG_DEPT] (
[dept_name] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[dept_name_short] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[parent_comp] int NULL,
[ec_company] int NULL,
[parent_dept] int NULL,
[ec_department] int NULL,
[dept_principal] int NULL,
[show_order] int NULL,
[description] varchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
@ -589,7 +592,9 @@ CREATE TABLE [dbo].[JCL_ORG_STAFF] (
[id] int IDENTITY(1,1) NOT NULL,
[plan_id] int NULL,
[comp_id] int NULL,
[ec_company] int NULL,
[dept_id] int NULL,
[ec_department] int NULL,
[job_id] int NULL,
[staff_num] int NULL,
[control_policy] int NULL,
@ -621,6 +626,7 @@ CREATE TABLE [dbo].[JCL_ORG_STAFFPLAN] (
[time_start] datetime NULL,
[time_end] datetime NULL,
[company_id] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ec_company] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[control_dimension] varchar(5) COLLATE Chinese_PRC_CI_AS NULL,
[description] varchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[forbidden_tag] int NULL,

@ -88,6 +88,7 @@ public class CompBO {
.compName(param.getCompName())
.compNameShort(param.getCompNameShort())
.parentCompany(param.getParentCompany())
.ecCompany(param.getEcCompany())
.orgCode(param.getOrgCode())
.industry(param.getIndustry())
.compPrincipal(param.getCompPrincipal())

@ -42,6 +42,7 @@ public class CompSearchParam extends BaseQueryParam {
*
*/
private Long parentCompany;
private Long ecCompany;
/**
*

@ -44,6 +44,8 @@ public class CompPO {
*/
private Long parentCompany;
private Long ecCompany;
/**
*
*/

@ -84,7 +84,9 @@ public class DepartmentBO {
.deptName(param.getDepartmentName())
.deptNameShort(param.getDeptNameShort())
.parentComp(null == param.getParentComp() ? param.getSubcompanyid1() : param.getParentComp())
.ecCompany(param.getEcCompany())
.parentDept(null == param.getParentDept() ? param.getDepartmentid() : param.getParentDept())
.ecDepartment(param.getEcDepartment())
.deptPrincipal(param.getDeptPrincipal())
.showOrder(param.getShowOrder())
.forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1)

@ -26,8 +26,10 @@ public class DeptSearchParam extends BaseQueryParam {
private String deptNameShort;
private Long parentComp;
private Long ecCompany;
private Long parentDept;
private Long ecDepartment;
private Long deptPrincipal;

@ -28,8 +28,10 @@ public class DepartmentPO {
private String deptNameShort;
private Long parentComp;
private Long ecCompany;
private Long parentDept;
private Long ecDepartment;
private Long deptPrincipal; //部门负责人

@ -20,7 +20,9 @@ public class StaffBO {
.id(param.getId())
.planId(param.getPlanId())
.compId(param.getCompId())
.ecCompany(param.getEcCompany())
.deptId(param.getDeptId())
.ecDepartment(param.getEcDepartment())
.jobId(param.getJobId())
.staffNum(param.getStaffNum())
.controlPolicy(param.getControlPolicy())

@ -26,6 +26,7 @@ public class StaffPlanBO {
.timeStart(StringUtil.isEmpty(param.getTimeStart()) ? null : DateUtil.parseToDateTime(param.getTimeStart()))
.timeEnd(StringUtil.isEmpty(param.getTimeEnd()) ? null : DateUtil.parseToDateTime(param.getTimeEnd()))
.companyId(param.getCompanyId())
.ecCompany(param.getEcCompany())
.controlDimension(param.getControlDimension())
.description(param.getDescription())
.forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1)

@ -44,6 +44,7 @@ public class StaffPlanSearchParam {
*
*/
private String companyId;
private String ecCompany;
/**
*
*/

@ -28,10 +28,12 @@ public class StaffSearchParam {
*
*/
private Long compId;
private Long ecCompany;
/**
*
*/
private Long deptId;
private Long ecDepartment;
/**
*
*/

@ -30,10 +30,12 @@ public class StaffPO {
*
*/
private Long compId;
private Long ecCompany;
/**
*
*/
private Long deptId;
private Long ecDepartment;
/**
*
*/

@ -46,6 +46,7 @@ public class StaffPlanPO {
*
*/
private String companyId;
private String ecCompany;
/**
*
*/

@ -7,6 +7,7 @@
<result column="comp_name" property="compName"/>
<result column="comp_name_short" property="compNameShort"/>
<result column="parent_company" property="parentCompany"/>
<result column="ec_company" property="ecCompany"/>
<result column="org_code" property="orgCode"/>
<result column="industry" property="industry"/>
<result column="comp_principal" property="compPrincipal"/>
@ -30,6 +31,7 @@
, t.comp_name
, t.comp_name_short
, t.parent_company
, t.ec_company
, t.org_code
, t.industry
, t.comp_principal
@ -98,6 +100,9 @@
<if test="parentCompany != null ">
parent_company,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null ">
org_code,
</if>
@ -140,6 +145,9 @@
<if test="parentCompany != null ">
#{parentCompany},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="orgCode != null ">
#{orgCode},
</if>
@ -160,7 +168,7 @@
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.company.po.CompPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_COMP_ID.currval from dual
</selectKey>
INSERT INTO jcl_org_comp
@ -189,6 +197,9 @@
<if test="parentCompany != null ">
parent_company,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null ">
org_code,
</if>
@ -228,8 +239,8 @@
<if test="compNameShort != null ">
#{compNameShort},
</if>
<if test="parentCompany != null ">
#{parentCompany},
<if test="ec_company != null ">
#{ecCompany},
</if>
<if test="orgCode != null ">
#{orgCode},
@ -300,8 +311,8 @@
jcl_org_comp t
WHERE t.delete_type = 0
<include refid="likeSQL"/>
<if test=" compPO.parentCompany != null ">
and t.parent_company = #{compPO.parentCompany}
<if test=" compPO.ecCompany != null ">
and t.ec_company = #{compPO.ecCompany}
</if>
<if test=" compPO.industry != null ">
and t.industry = #{compPO.industry}
@ -434,6 +445,7 @@
comp_name=#{compName},
comp_name_short=#{compNameShort},
parent_company=#{parentCompany},
ec_company=#{ecCompany},
org_code=#{orgCode},
industry=#{industry},
comp_principal=#{compPrincipal},

@ -7,7 +7,9 @@
<result column="dept_name" property="deptName"/>
<result column="dept_name_short" property="deptNameShort"/>
<result column="parent_comp" property="parentComp"/>
<result column="ec_company" property="ecCompany"/>
<result column="parent_dept" property="parentDept"/>
<result column="ec_department" property="ecDepartment"/>
<result column="dept_principal" property="deptPrincipal"/>
<result column="show_order" property="showOrder"/>
<result column="description" property="description"/>
@ -30,7 +32,9 @@
t.dept_name,
t.dept_name_short,
t.parent_comp,
t.ec_company,
t.parent_dept,
t.ec_department,
t.dept_principal,
t.show_order,
t.description,
@ -39,17 +43,19 @@
</sql>
<select id="getDeptListByCompId" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select t.id, t.dept_name, t.parent_dept, t.dept_principal, t.parent_dept, t.parent_comp
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
and parent_comp = #{parentComp}
and parent_comp = #{parentComp}
</select>
<select id="getDeptListByPId" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select t.id, t.dept_name, t.parent_dept, t.dept_principal
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
and parent_dept = #{PId}
and parent_dept = #{PId}
</select>
<select id="getDeptNameById" resultType="string">
@ -65,6 +71,12 @@
from jcl_org_dept t
where delete_type = 0
<include refid="likeSQL"/>
<if test=" departmentPO.ecCompany != null ">
and t.ec_company = #{departmentPO.ecCompany}
</if>
<if test=" departmentPO.ecDepartment != null ">
and t.ec_department = #{departmentPO.ecDepartment}
</if>
<if test=" departmentPO.parentComp != null ">
and t.parent_comp = #{departmentPO.parentComp}
</if>
@ -211,9 +223,15 @@
<if test="parentComp != null ">
parent_comp,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="parentDept != null ">
parent_dept,
</if>
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="deptPrincipal != null ">
dept_principal,
</if>
@ -253,9 +271,15 @@
<if test="parentComp != null ">
#{parentComp},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="parentDept != null ">
#{parentDept},
</if>
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="deptPrincipal != null ">
#{deptPrincipal},
</if>
@ -303,9 +327,15 @@
<if test="parentComp != null ">
parent_comp,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="parentDept != null ">
parent_dept,
</if>
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="deptPrincipal != null ">
dept_principal,
</if>
@ -345,9 +375,15 @@
<if test="parentComp != null ">
#{parentComp},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="parentDept != null ">
#{parentDept},
</if>
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="deptPrincipal != null ">
#{deptPrincipal},
</if>
@ -372,7 +408,9 @@
dept_name=#{deptName},
dept_name_short=#{deptNameShort},
parent_comp=#{parentComp},
ec_company=#{ecCompany},
parent_dept=#{parentDept},
ec_department=#{ecDepartment},
dept_principal=#{deptPrincipal},
show_order=#{showOrder},
description=#{description},

@ -5,7 +5,8 @@
<result column="id" property="id"/>
<result column="plan_id" property="planId"/>
<result column="comp_id" property="compId"/>
<result column="dept_id" property="deptId"/>
<result column="ec_company" property="ecCompany"/>
<result column="ec_department" property="ecDepartment"/>
<result column="job_id" property="jobId"/>
<result column="staff_num" property="staffNum"/>
<result column="control_policy" property="controlPolicy"/>
@ -27,7 +28,9 @@
id
, t.plan_id
, t.comp_id
, t.ec_company
, t.dept_id
, t.ec_department
, t.job_id
, t.staff_num
, t.control_policy
@ -82,7 +85,9 @@
update_time=#{updateTime},
plan_id=#{planId},
comp_id=#{compId},
ec_company=#{ecCompany},
dept_id=#{deptId},
ec_department=#{ecDepartment},
job_id=#{jobId},
staff_num=#{staffNum},
control_policy=#{controlPolicy},
@ -120,6 +125,12 @@
<if test="deptId != null ">
dept_id,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="jobId != null ">
job_id,
</if>
@ -168,6 +179,12 @@
<if test="deptId != null ">
#{deptId},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="jobId != null ">
#{jobId},
</if>
@ -196,7 +213,7 @@
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_STAFF_ID.currval from dual
</selectKey>
INSERT INTO jcl_org_staff
@ -222,6 +239,12 @@
<if test="deptId != null ">
dept_id,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="jobId != null ">
job_id,
</if>
@ -270,6 +293,12 @@
<if test="deptId != null ">
#{deptId},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="jobId != null ">
#{jobId},
</if>

@ -9,6 +9,7 @@
<result column="time_start" property="timeStart"/>
<result column="time_end" property="timeEnd"/>
<result column="company_id" property="companyId"/>
<result column="ec_company" property="ecCompany"/>
<result column="control_dimension" property="controlDimension"/>
<result column="description" property="description"/>
<result column="forbidden_tag" property="forbiddenTag"/>
@ -29,6 +30,7 @@
, t.time_start
, t.time_end
, t.company_id
, t.ec_company
, t.control_dimension
, t.description
, t.forbidden_tag
@ -88,6 +90,7 @@
time_start=#{timeStart},
time_end=#{timeEnd},
company_id=#{companyId},
ec_company=#{ecCompany},
control_dimension=#{controlDimension},
description=#{description},
</set>
@ -128,6 +131,9 @@
<if test="companyId != null ">
company_id,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="controlDimension != null ">
control_dimension,
</if>
@ -167,6 +173,9 @@
<if test="companyId != null ">
#{companyId},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="controlDimension != null ">
#{controlDimension},
</if>
@ -177,8 +186,9 @@
</trim>
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.staff.po.StaffPlanPO"
databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_STAFFPLAN_ID.currval from dual
</selectKey>
INSERT INTO jcl_org_staffplan
@ -213,6 +223,9 @@
<if test="companyId != null ">
company_id,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="controlDimension != null ">
control_dimension,
</if>
@ -252,6 +265,9 @@
<if test="companyId != null ">
#{companyId},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="controlDimension != null ">
#{controlDimension},
</if>

@ -37,6 +37,7 @@ 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 com.engine.organization.util.relation.EcHrmRelationUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil;
@ -161,6 +162,11 @@ public class CompServiceImpl extends Service implements CompService {
}
params.put("show_order", maxShowOrder + 1);
}
// 赋值上级分部
String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(ecCompany)) {
params.put("parent_company", EcHrmRelationUtil.getJclCompanyId(ecCompany).getId());
}
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, params).sync();
String ecCompanyID = Util.null2String(syncMap.get("id"));
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecCompanyID), syncMap.get("message").toString());
@ -196,6 +202,11 @@ public class CompServiceImpl extends Service implements CompService {
compNo = repeatDetermine(compNo);
params.put("comp_no", compNo);
}
// 上级分部
String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(ecCompany)) {
params.put("parent_company", EcHrmRelationUtil.getJclCompanyId(ecCompany).getId());
}
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
// 更新主表数据
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId());
@ -234,7 +245,7 @@ public class CompServiceImpl extends Service implements CompService {
// 简称
SearchConditionItem compNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "compNameShort");
// 上级公司
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "161", "parentCompany", "compBrowser");
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "164", "ecCompany", "");
// 组织机构代码
SearchConditionItem orgCodeItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "组织机构代码", "orgCode");
// 行业
@ -356,6 +367,8 @@ public class CompServiceImpl extends Service implements CompService {
OrganizationAssert.isFalse(disableIds.contains(targetCompanyId), "请勿选择当前分部本身及其子分部");
CompPO compPO = getCompMapper().listById(companyId);
compPO.setParentCompany(targetCompanyId);
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(targetCompanyId + "");
compPO.setEcCompany(StringUtils.isNotBlank(ecCompanyId) ? Long.parseLong(ecCompanyId) : null);
Map<String, Object> map = new HashMap<>();
map.put("id", compPO.getId());
map.put("parent_company", compPO.getParentCompany());
@ -379,7 +392,7 @@ public class CompServiceImpl extends Service implements CompService {
&& StringUtil.isEmpty(compPO.getCompNo())
&& StringUtil.isEmpty(compPO.getCompNameShort())
&& StringUtil.isEmpty(compPO.getOrgCode())
&& null == compPO.getParentCompany()
&& null == compPO.getEcCompany()
&& null == compPO.getIndustry()
&& null == compPO.getCompPrincipal()
&& null == compPO.getForbiddenTag());

@ -219,6 +219,26 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
}
params.put("show_order", maxShowOrder + 1);
}
// 上级分部
String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(ecCompany)) {
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(ecCompany);
if (null != jclCompanyId) {
params.put("parent_comp", jclCompanyId.getId());
}
}
// 上级部门
String ecDepartment = Util.null2String(params.get("ec_department"));
if (StringUtils.isNotBlank(ecDepartment)) {
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(ecDepartment);
if (null != jclDepartmentId) {
params.put("parent_dept", jclDepartmentId.getId());
// 部门不为空,自动指定所属分部
params.put("parent_comp", jclDepartmentId.getParentComp());
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(jclDepartmentId.getParentComp() + ""));
}
}
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, params).sync();
String ecCompanyID = Util.null2String(syncMap.get("id"));
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecCompanyID), syncMap.get("message").toString());
@ -254,10 +274,25 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
deptNo = repeatDetermine(deptNo);
params.put("dept_no", deptNo);
}
// 根据部门,自动获取正确分部
DepartmentPO parentDept = getDepartmentMapper().getDeptById(searchParam.getParentDept());
if (null != parentDept) {
params.put("parent_comp", parentDept.getParentComp());
// 上级分部
String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(ecCompany)) {
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(ecCompany);
if (null != jclCompanyId) {
params.put("parent_comp", jclCompanyId.getId());
}
}
// 上级部门
String ecDepartment = Util.null2String(params.get("ec_department"));
if (StringUtils.isNotBlank(ecDepartment)) {
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(ecDepartment);
if (null != jclDepartmentId) {
params.put("parent_dept", jclDepartmentId.getId());
// 部门不为空,自动指定所属分部
params.put("parent_comp", jclDepartmentId.getParentComp());
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(jclDepartmentId.getParentComp() + ""));
}
}
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
// 更新主表数据
@ -267,6 +302,13 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
Long parentComp = StringUtils.isNotEmpty(Util.null2String(params.get("parent_comp"))) ? Long.parseLong(Util.null2String(params.get("parent_comp"))) : null;
// 刷新岗位所属分部
refreshJobComp(searchParam.getId(), parentComp);
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(searchParam.getId());
forbiddenChildTag(parentComp, childList, false);
return searchParam.getId();
}
@ -299,9 +341,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 简称
SearchConditionItem deptNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "deptNameShort");
// 所属分部
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "161", "parentComp", "compBrowser");
SearchConditionItem parentCompBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "所属分部", "164", "ecCompany", "");
// 上级部门
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "161", "parentDept", "deptBrowser");
SearchConditionItem parentDeptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级部门", "4", "ecDepartment", "");
// 部门负责人
SearchConditionItem deptPrincipalBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门负责人", "1", "deptPrincipal", "");
// 显示顺序
@ -405,7 +447,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
public List<SearchConditionGroup> getCopyForm() {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> condition = new ArrayList<>();
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "复制到", "161", "company", "compBrowser");
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "复制到", "164", "company", "");
compBrowserItem.setRules("required|string");
List<SearchConditionOption> selectOptions = new ArrayList<>();
SearchConditionOption Option = new SearchConditionOption("1", "");
@ -426,6 +468,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
*/
@Override
public int copyDepartment(DeptCopyParam copyParam) {
// TODO 是否复制子部门信息,是否复制子部门岗位信息
HasRightUtil.hasRight(user, RIGHT_NAME, false);
OrganizationAssert.notBlank(copyParam.getCompany(), "请指定需要复制的公司/分部");
int insertCount = 0;
@ -434,11 +477,13 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
maxShowOrder = null == maxShowOrder ? 0 : maxShowOrder;
for (int i = 0; i < idList.size(); i++) {
DepartmentPO deptById = getDepartmentMapper().getDeptById(idList.get(i));
deptById.setDeptName(deptById.getDeptName() + "[复制]");
deptById.setDeptNameShort(deptById.getDeptNameShort() + "[复制]");
long timeMillis = System.currentTimeMillis();
deptById.setDeptName(deptById.getDeptName() + "_" + timeMillis);
deptById.setDeptNameShort(deptById.getDeptNameShort());
// 处理自动编号
deptById.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptById.getDeptNo(), false));
deptById.setParentComp(Long.parseLong(copyParam.getCompany()));
deptById.setDeptNo(CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptById.getDeptNo(), timeMillis));
deptById.setParentComp(EcHrmRelationUtil.getJclCompanyId(copyParam.getCompany()).getId());
deptById.setEcCompany(Long.parseLong(copyParam.getCompany()));
deptById.setParentDept(null);
// 显示顺序字段
deptById.setShowOrder(maxShowOrder + i + 1);
@ -461,7 +506,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
if (maxJobOrder == null) {
maxJobOrder = 0;
}
recursionCopyJob((long) user.getUID(), jobPOS, deptById.getParentComp(), deptById.getId(), maxJobOrder);
recursionCopyJob((long) user.getUID(), jobPOS, deptById.getParentComp(), deptById.getId(), maxJobOrder, timeMillis);
}
}
return insertCount;
@ -471,7 +516,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
public List<SearchConditionGroup> getMergeForm(Long id) {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> condition = new ArrayList<>();
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到部门", "161", "department", "deptBrowser");
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到部门", "4", "department", "");
deptBrowserItem.setRules("required|string");
SearchConditionItem mergeNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "合并后名称", "mergeName");
mergeNameItem.setRules("required|string");
@ -487,13 +532,15 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
@Override
public int mergeDepartment(DepartmentMergeParam mergeParam) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
int updateCount = 0;
OrganizationAssert.isFalse(mergeParam.getId().equals(mergeParam.getDepartment()), "所选部门与待合并部门一致,无需操作");
int updateCount;
Long ecParamDepartment = mergeParam.getDepartment();
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(ecParamDepartment + "");
Long jclParamDepartment = jclDepartmentId.getId();
OrganizationAssert.isFalse(mergeParam.getId().equals(jclParamDepartment), "所选部门与待合并部门一致,无需操作");
OrganizationAssert.notNull(mergeParam.getDepartment(), "请选择需要合并的部门");
OrganizationAssert.notBlank(mergeParam.getMergeName(), "请输入合并后的名称");
// 合并到的部门
DepartmentPO targetDepartment = getDepartmentMapper().getDeptById(mergeParam.getDepartment());
Long parentComp = targetDepartment.getParentComp();
DepartmentPO targetDepartment = getDepartmentMapper().getDeptById(jclParamDepartment);
Set<Long> disableIds = new HashSet<>();
disableIds.add(mergeParam.getId());
@ -507,8 +554,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
mergeDepartment.setDeptName(mergeParam.getMergeName());
mergeDepartment.setDeptNameShort(mergeParam.getMergeName());
mergeDepartment.setParentDept(mergeParam.getDepartment());
mergeDepartment.setParentComp(parentComp);
mergeDepartment.setParentDept(jclParamDepartment);
mergeDepartment.setEcDepartment(ecParamDepartment);
mergeDepartment.setParentComp(targetDepartment.getParentComp());
mergeDepartment.setEcCompany(targetDepartment.getEcCompany());
// 禁用
mergeDepartment.setForbiddenTag(1);
// 更新EC表部门
@ -523,7 +573,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
refreshJobComp(mergeDepartment.getId(), mergeDepartment.getParentComp());
// 合并后部门及子部门禁用
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
forbiddenChildTag(parentComp, deptList, true);
forbiddenChildTag(targetDepartment.getParentComp(), deptList, true);
return updateCount;
}
@ -531,8 +581,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
public List<SearchConditionGroup> getMoveForm() {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> condition = new ArrayList<>();
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择分部", "161", "company", "compBrowser");
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择部门", "161", "department", "deptBrowser");
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择分部", "164", "company", "");
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "选择部门", "4", "department", "");
List<SearchConditionOption> selectOptions = new ArrayList<>();
@ -560,20 +610,23 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
if ("0".equals(moveParam.getMoveType())) {
Long company = moveParam.getCompany();
OrganizationAssert.notNull(company, "请选择要转移到的分部");
deptById.setParentComp(company);
deptById.setEcCompany(company);
deptById.setParentComp(Objects.requireNonNull(EcHrmRelationUtil.getJclCompanyId(company + "")).getId());
deptById.setParentDept(null);
} else if ("1".equals(moveParam.getMoveType())) {
Long department = moveParam.getDepartment();
OrganizationAssert.notNull(department, "请选择要转移到的部门");
Long departmentId = Objects.requireNonNull(EcHrmRelationUtil.getJclDepartmentId(department + "")).getId();
OrganizationAssert.notNull(departmentId, "请选择要转移到的部门");
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(moveParam.getId());
Set<Long> disableIds = new HashSet<>();
disableIds.add(moveParam.getId());
if (CollectionUtils.isNotEmpty(deptListByPId)) {
addDisableIds(disableIds, deptListByPId);
}
OrganizationAssert.isFalse(disableIds.contains(department), "请勿选择当前部门本身及其子部门");
deptById.setParentDept(department);
DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(department);
OrganizationAssert.isFalse(disableIds.contains(departmentId), "请勿选择当前部门本身及其子部门");
deptById.setParentDept(departmentId);
deptById.setEcDepartment(department);
DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(departmentId);
deptById.setParentComp(parentDepartment.getParentComp());
}
// 更新EC部门
@ -599,6 +652,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
if (CollectionUtils.isNotEmpty(deptList)) {
for (DepartmentPO departmentPO : deptList) {
departmentPO.setParentComp(parentComp);
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(parentComp + "");
if (StringUtils.isNotBlank(ecCompanyId)) {
departmentPO.setEcCompany(Long.parseLong(ecCompanyId));
}
if (isForbidden) {
departmentPO.setForbiddenTag(1);
// 封存EC表部门
@ -625,7 +682,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
* @return
*/
private boolean isFilter(DepartmentPO departmentPO) {
return !(StringUtil.isEmpty(departmentPO.getDeptNo()) && StringUtil.isEmpty(departmentPO.getDeptName()) && StringUtil.isEmpty(departmentPO.getDeptNameShort()) && null == departmentPO.getParentComp() && null == departmentPO.getParentDept() && null == departmentPO.getDeptPrincipal() && null == departmentPO.getShowOrder() && null == departmentPO.getForbiddenTag());
return !(StringUtil.isEmpty(departmentPO.getDeptNo())
&& StringUtil.isEmpty(departmentPO.getDeptName())
&& StringUtil.isEmpty(departmentPO.getDeptNameShort())
&& null == departmentPO.getEcCompany()
&& null == departmentPO.getEcDepartment()
&& null == departmentPO.getParentComp()
&& null == departmentPO.getParentDept()
&& null == departmentPO.getDeptPrincipal()
&& null == departmentPO.getShowOrder()
&& null == departmentPO.getForbiddenTag());
}
@ -709,11 +775,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
* @param parentDeptId
* @param orderNum
*/
private void recursionCopyJob(Long creator, List<JobPO> jobPOS, Long parentCompId, Long parentDeptId, int orderNum) {
private void recursionCopyJob(Long creator, List<JobPO> jobPOS, Long parentCompId, Long parentDeptId, int orderNum, long timeMillis) {
for (JobPO jobPO : jobPOS) {
orderNum++;
// 处理自动编号
jobPO.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobPO.getJobNo(), false));
jobPO.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobPO.getJobNo(), timeMillis));
jobPO.setParentDept(parentDeptId);
jobPO.setCreator(creator);
jobPO.setCreateTime(new Date());
@ -725,7 +791,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 处理子级元素
List<JobPO> jobsByPid = MapperProxyFactory.getProxy(JobMapper.class).getJobsByPid(jobPO.getId());
if (CollectionUtils.isNotEmpty(jobsByPid)) {
recursionCopyJob(creator, jobsByPid, parentCompId, parentDeptId, orderNum);
recursionCopyJob(creator, jobsByPid, parentCompId, parentDeptId, orderNum, timeMillis);
}
}
}

@ -62,7 +62,7 @@ public class ExtServiceImpl extends Service implements ExtService {
// 2编辑 1查看
OrganizationAssert.notNull(groupId, "请选择对应的拓展页");
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ExtendInfoOperateType.EDIT.getValue(), "1");
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, 1 == viewAttr ? ExtendInfoOperateType.LIST.getValue() : ExtendInfoOperateType.EDIT.getValue(), "1");
String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(","));
if (StringUtils.isEmpty(fields)) {
return conditionItems;

@ -137,7 +137,7 @@ public class GradeServiceImpl extends Service implements GradeService {
SearchConditionItem schemeBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "等级方案", "161", "schemeId", "schemeBrowser");
schemeBrowserItem.setRules("required|string");
BrowserBean schemeBrowserBean = schemeBrowserItem.getBrowserConditionParam();
if (!"-1".equals(schemeId) && StringUtil.isEmpty(id)) {
if (StringUtils.isNotBlank(schemeId) && !"-1".equals(schemeId) && StringUtil.isEmpty(id)) {
schemeBrowserBean.setValue(schemeId);
List<Map<String, Object>> maps = getSchemeMapper().listSchemesByIds(DeleteParam.builder().ids(schemeId).build().getIds());
schemeBrowserBean.setReplaceDatas(maps);

@ -394,7 +394,7 @@ public class JobServiceImpl extends Service implements JobService {
orderNum++;
JobPO jobById = getJobMapper().getJobById(id);
// 处理自动编号
jobById.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobById.getJobNo(), false));
jobById.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobById.getJobNo(), System.currentTimeMillis()));
jobById.setParentDept(Long.parseLong(department));
jobById.setShowOrder(orderNum);
insertCount += getJobMapper().insertIgnoreNull(jobById);

@ -133,7 +133,7 @@ public class LevelServiceImpl extends Service implements LevelService {
SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description");
SearchConditionItem browserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "等级方案", "161", "schemeId", "schemeBrowser");
BrowserBean browserBean = browserItem.getBrowserConditionParam();
if (!"-1".equals(schemeId) && StringUtil.isEmpty(id)) {
if (StringUtils.isNotBlank(schemeId) && !"-1".equals(schemeId) && StringUtil.isEmpty(id)) {
browserItem.setValue(schemeId);
List<Map<String, Object>> maps = getSchemeMapper().listSchemesByIds(DeleteParam.builder().ids(schemeId).build().getIds());
browserBean.setReplaceDatas(maps);

@ -43,7 +43,8 @@ public class NonStandardOptServiceImpl extends Service implements NonStandardOpt
// 更新人员表系统字段
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=1,allowhide=-1 where fieldname='sex'");
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=-1 where fieldname='departmentid'");
rs.executeUpdate("update hrm_formfield set isuse=1,ismand=0,allowhide=-1 where fieldname='jobtitle'");
// 非标启用停用EC岗位字段
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='jobtitle'");
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='jobactivity'");
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='joblevel'");
rs.executeUpdate("update hrm_formfield set isuse=0,ismand=0,allowhide=-1 where fieldname='jobcall'");

@ -1,13 +1,12 @@
package com.engine.organization.service.impl;
import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.staff.bo.StaffPlanBO;
import com.engine.organization.entity.staff.param.StaffPlanSearchParam;
import com.engine.organization.entity.staff.po.StaffPlanPO;
@ -16,8 +15,10 @@ import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.staff.StaffPlanMapper;
import com.engine.organization.service.StaffPlanService;
import com.engine.organization.util.*;
import com.engine.organization.util.browser.OrganizationBrowserUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
@ -72,6 +73,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
OrganizationAssert.isEmpty(list, "编号不允许重复");
// 结束时间大于开始时间
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
// 多选赋值
staffPlanPO.setCompanyId(getJclCompanyIdsByEcIds(staffPlanPO.getEcCompany()));
String timeStart = param.getTimeStart();
String timeEnd = param.getTimeEnd();
Date startDate = DateUtil.parseToDate(timeStart);
@ -96,6 +99,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
Date startDate = DateUtil.parseToDate(timeStart);
Date endDate = DateUtil.parseToDate(timeEnd);
OrganizationAssert.isFalse(startDate.after(endDate), "开始时间不允许在结束时间之后");
// 多选赋值
staffPlanPO.setCompanyId(getJclCompanyIdsByEcIds(staffPlanPO.getEcCompany()));
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
}
@ -130,7 +135,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
// 时间结束
SearchConditionItem timeEndItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 2, "时间结束", "timeEnd");
// 适用公司
SearchConditionItem companyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "适用公司", "161", "companyId", "compBrowser");
SearchConditionItem companyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "适用公司", "164", "ecCompany", "");
// 说明
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
// 状态
@ -178,8 +183,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
SearchConditionItem timeEndItem = OrganizationFormItemUtil.datePickerItem(user, 2, 16, false, 3, "时间结束", "timeEnd");
timeEndItem.setRules("required|string");
// 适用公司
SearchConditionItem companyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "适用公司", "162", "companyId", "compBrowser");
companyIdtItem.setRules("required|string");
SearchConditionItem ecCompanyIdtItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "适用公司", "194", "ecCompany", "compBrowser");
ecCompanyIdtItem.setRules("required|string");
List<SearchConditionOption> selectOptions = new ArrayList<>();
SearchConditionOption option1 = new SearchConditionOption("1", "分部");
SearchConditionOption option2 = new SearchConditionOption("2", "部门");
@ -205,10 +210,11 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(), "yyyy-MM-dd"));
timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(), "yyyy-MM-dd"));
BrowserBean browserBean = companyIdtItem.getBrowserConditionParam();
List<Map<String, Object>> maps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPlanPO.getCompanyId()).build().getIds());
browserBean.setReplaceDatas(maps);
companyIdtItem.setBrowserConditionParam(browserBean);
String tmpFieldValue = staffPlanPO.getEcCompany();
if (StringUtils.isNotBlank(tmpFieldValue)) {
OrganizationBrowserUtil.assignBrowser(user, tmpFieldValue, 164, ecCompanyIdtItem);
}
dimensionItem.setValue(staffPlanPO.getControlDimension());
descriptionItem.setValue(staffPlanPO.getDescription());
@ -221,7 +227,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
selectItems.add(planYearItem);
selectItems.add(timeStartItem);
selectItems.add(timeEndItem);
selectItems.add(companyIdtItem);
selectItems.add(ecCompanyIdtItem);
selectItems.add(dimensionItem);
selectItems.add(descriptionItem);
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
@ -264,9 +270,9 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
if (null != timeEnd) {
sqlWhere += " AND t.time_end <= '" + timeEnd + "'";
}
String companyId = staffPlanPO.getCompanyId();
if (StringUtils.isNotBlank(companyId)) {
sqlWhere += " AND t.companyId = '" + companyId + "'";
String ecCompany = staffPlanPO.getEcCompany();
if (StringUtils.isNotBlank(ecCompany)) {
sqlWhere += " AND " + dbType.concat("t.ec_company") + " " + dbType.like("," + ecCompany + ",");
}
String description = staffPlanPO.getDescription();
@ -280,5 +286,17 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
return sqlWhere;
}
private String getJclCompanyIdsByEcIds(String ecIds) {
List<String> jclCompanyIds = new ArrayList<>();
String[] split = ecIds.split(",");
for (String s : split) {
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(s);
if (null != jclCompanyId) {
jclCompanyIds.add(jclCompanyId.getId().toString());
}
}
return StringUtils.join(jclCompanyIds, ",");
}
}

@ -10,6 +10,8 @@ import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.browser.po.CustomBrowserBean;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.staff.bo.StaffBO;
import com.engine.organization.entity.staff.param.StaffSearchParam;
import com.engine.organization.entity.staff.po.StaffPO;
@ -24,8 +26,10 @@ import com.engine.organization.mapper.staff.StaffPlanMapper;
import com.engine.organization.mapper.staff.StaffsMapper;
import com.engine.organization.service.StaffService;
import com.engine.organization.util.*;
import com.engine.organization.util.browser.OrganizationBrowserUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.StringUtil;
@ -89,6 +93,15 @@ public class StaffServiceImpl extends Service implements StaffService {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, "编制数不可小于0请更正");
// 赋值
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(staffPO.getEcCompany() + "");
if (null != jclCompanyId) {
staffPO.setCompId(jclCompanyId.getId());
}
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(staffPO.getEcDepartment() + "");
if (null != jclDepartmentId) {
staffPO.setDeptId(jclDepartmentId.getId());
}
checkRequired(staffPO);
return getStaffMapper().insertIgnoreNull(staffPO);
}
@ -98,6 +111,15 @@ public class StaffServiceImpl extends Service implements StaffService {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
StaffPO staffByID = getStaffMapper().getStaffByID(param.getId());
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
// 赋值
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(staffPO.getEcCompany() + "");
if (null != jclCompanyId) {
staffPO.setCompId(jclCompanyId.getId());
}
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(staffPO.getEcDepartment() + "");
if (null != jclDepartmentId) {
staffPO.setDeptId(jclDepartmentId.getId());
}
checkRequired(staffPO);
Integer changeNum = param.getChangeNum();
if (null == changeNum) {
@ -132,16 +154,13 @@ public class StaffServiceImpl extends Service implements StaffService {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = new ArrayList<>();
//// 方案
//SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "方案11", "161", "planId", "staffPlanBrowser");
//planIdItem.setHide(true);
//planIdItem.setDisplay("none");
// 分部
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "compId", "compBrowser");
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "164", "ecCompany", "");
// 部门
SearchConditionItem deptIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "161", "deptId", "deptBrowser");
SearchConditionItem deptIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "4", "ecDepartment", "");
// 岗位
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "161", "jobId", "jobBrowser");
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "666", "jobId", "");
// 编制数
SearchConditionItem staffNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "编制数", "staffNum");
// 在编
@ -188,14 +207,11 @@ public class StaffServiceImpl extends Service implements StaffService {
SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "方案", "161", "planId", "staffPlanBrowser");
planIdItem.setRules("required|string");
// 分部
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "compId", "compBrowser");
//compIdItem.setRules("required|string");
SearchConditionItem ecCompanyItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "164", "ecCompany", "compBrowser");
// 部门
SearchConditionItem deptIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "161", "deptId", "deptBrowser");
//deptIdItem.setRules("required|string");
SearchConditionItem ecDepartmentItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "4", "ecDepartment", "deptBrowser");
// 岗位
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "666", "jobId", "");
//jobIdItem.setRules("required|string");
BrowserBean browserBean = jobIdItem.getBrowserConditionParam();
String s = JSONObject.toJSONString(browserBean);
CustomBrowserBean customBrowserBean = JSONObject.parseObject(s, CustomBrowserBean.class);
@ -232,18 +248,12 @@ public class StaffServiceImpl extends Service implements StaffService {
planIdItemBean.setReplaceDatas(planIdMaps);
planIdItem.setBrowserConditionParam(planIdItemBean);
if (null != staffPO.getCompId()) {
BrowserBean compIdItemBean = compIdItem.getBrowserConditionParam();
List<Map<String, Object>> compIdMaps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPO.getCompId().toString()).build().getIds());
compIdItemBean.setReplaceDatas(compIdMaps);
compIdItem.setBrowserConditionParam(compIdItemBean);
if (null != staffPO.getEcCompany()) {
OrganizationBrowserUtil.assignBrowser(user, staffPO.getEcCompany().toString(), 164, ecCompanyItem);
}
if (null != staffPO.getDeptId()) {
BrowserBean deptIdItemBean = deptIdItem.getBrowserConditionParam();
List<Map<String, Object>> deptIdMaps = getDepartmentMapper().listDeptsByIds(DeleteParam.builder().ids(staffPO.getDeptId().toString()).build().getIds());
deptIdItemBean.setReplaceDatas(deptIdMaps);
deptIdItem.setBrowserConditionParam(deptIdItemBean);
if (null != staffPO.getEcDepartment()) {
OrganizationBrowserUtil.assignBrowser(user, staffPO.getEcDepartment().toString(), 4, ecDepartmentItem);
}
if (null != staffPO.getJobId()) {
@ -258,8 +268,8 @@ public class StaffServiceImpl extends Service implements StaffService {
descriptionItem.setValue(staffPO.getDescription());
}
selectItems.add(planIdItem);
selectItems.add(compIdItem);
selectItems.add(deptIdItem);
selectItems.add(ecCompanyItem);
selectItems.add(ecDepartmentItem);
selectItems.add(jobIdItem);
selectItems.add(staffNumItem);
selectItems.add(controlPolicyItem);
@ -323,6 +333,14 @@ public class StaffServiceImpl extends Service implements StaffService {
if (null != deptId) {
sqlWhere += " AND t.dept_id = '" + deptId + "'";
}
Long ecCompany = param.getEcCompany();
if (null != ecCompany) {
sqlWhere += " AND t.ec_company = '" + ecCompany + "'";
}
Long ecDepartment = param.getEcDepartment();
if (null != ecDepartment) {
sqlWhere += " AND t.ec_department = '" + ecDepartment + "'";
}
Long jobId = param.getJobId();
if (null != jobId) {
sqlWhere += " AND t.job_id = '" + jobId + "'";

@ -385,9 +385,9 @@ public class OrganizationSyncEc {
map.put("subcompanyname", Util.null2String(params.get("comp_name_short")));
// 上级分部通过UUID联查ec表ID
String parentCompany = Util.null2String(params.get("parent_company"));
if (StringUtils.isNotBlank(parentCompany)) {
map.put("supsubcomid", EcHrmRelationUtil.getEcCompanyId(parentCompany));
String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(ecCompany)) {
map.put("supsubcomid", ecCompany);
}
map.put("subcompanycode", params.get("comp_no").toString());

@ -0,0 +1,54 @@
package com.engine.organization.util.browser;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.util.BrowserInitUtil;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.definedfield.HrmFieldManager;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2022/09/06
* @version: 1.0
*/
public class OrganizationBrowserUtil {
/**
*
*
* @param user
* @param tmpFieldValue
* @param browserType
* @param searchConditionItem
*/
public static void assignBrowser(User user, String tmpFieldValue, int browserType, SearchConditionItem searchConditionItem) {
HrmFieldManager hrmFieldManager = new HrmFieldManager();
String fieldShowName = null;
try {
fieldShowName = hrmFieldManager.getFieldvalue(user, null, 0, 3, browserType, tmpFieldValue, 0);
} catch (Exception e) {
throw new RuntimeException(e);
}
String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
String[] fieldshownames = Util.splitString(fieldShowName, ",");
List<Map<String, Object>> replaceDatas = new ArrayList<>();
for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) {
if (fieldvalues.length != fieldshownames.length) {
break;
}
if (Util.null2String(fieldshownames[i]).length() == 0) {
continue;
}
Map<String, Object> replaceData = new HashMap<>();
replaceData.put("id", fieldvalues[i]);
replaceData.put("name", fieldshownames[i]);
replaceDatas.add(replaceData);
}
BrowserInitUtil.setConditionItemDefaultValue(searchConditionItem, replaceDatas, 2);
}
}

@ -2,6 +2,10 @@ package com.engine.organization.util.coderule;
import com.engine.hrm.entity.RuleCodeType;
import com.engine.hrm.util.CodeRuleManager;
import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import weaver.general.Util;
/**
* @description:
@ -30,14 +34,19 @@ public class CodeRuleUtil {
*
* @param ruleCodeType
* @param code
* @param isCopy
* @param timeMillis
* @return
*/
public static String generateCode(RuleCodeType ruleCodeType, String code, boolean isCopy) {
if (isCopy) {
return generateCode(ruleCodeType, code);
public static String generateCode(RuleCodeType ruleCodeType, String code, long timeMillis) {
if (isAutoCode(ruleCodeType)) {
return generateCode(ruleCodeType, "");
} else {
return generateCode(ruleCodeType, code + "_cp");
return generateCode(ruleCodeType, Util.null2String(code) + "_" + timeMillis);
}
}
private static boolean isAutoCode(RuleCodeType ruleCodeType) {
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(ruleCodeType.getValue());
return null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable());
}
}

@ -2,4 +2,6 @@ package com.engine.organization.util.db;
public interface DBOperateAdapter {
String like(String some);
String concat(String some);
}

@ -10,18 +10,33 @@ public enum DBType implements DBOperateAdapter {
public String like(String some) {
return "like '%" + some + "%'";
}
@Override
public String concat(String some) {
return "concat(','," + some + ",',')";
}
},
SQLSERVER("sqlserver") {
@Override
public String like(String some) {
return "like '%" + some + "%'";
}
@Override
public String concat(String some) {
return "','+" + some + "+','";
}
},
ORACLE("oracle") {
@Override
public String like(String some) {
return "'%'||" + some + "||'%'";
}
@Override
public String concat(String some) {
return "',' ||" + some + "|| ','";
}
};
private String dbtype;

Loading…
Cancel
Save