commit
e323d12394
|
|
@ -0,0 +1,28 @@
|
|||
update jcl_field_extendinfo set isrequired = 1 where table_name ='JCL_ORG_JOB' and field_name ='job_name';
|
||||
update jcl_field_extendinfo set isrequired = 1 where table_name ='JCL_ORG_JOB' and field_name ='ec_company';
|
||||
update jcl_field_extendinfo set custom_value='["browser",{"valueSpan":"行业","replaceDatas":[{"itemorderid":"63","name":"行业","id":"63","parenttitle":"客户","title":"客户-行业"}],"value":"63"}]' where table_name ='JCL_ORG_COMP' and field_name='industry' ;
|
||||
update jcl_field_extendinfo set custom_value='["browser",{"valueSpan":"人力资源","replaceDatas":[{"name":"人力资源","id":"1"}],"value":"1"}]' where table_name ='JCL_ORG_COMP' and field_name='comp_principal' ;
|
||||
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_COMP' and field_name='description' ;
|
||||
update jcl_field_extendinfo set custom_value='["browser",{"valueSpan":"人力资源","replaceDatas":[{"name":"人力资源","id":"1"}],"value":"1"}]' where table_name ='JCL_ORG_DEPT' and field_name='dept_principal' ;
|
||||
update jcl_field_extendinfo set custom_value='["input","int"]' where table_name ='JCL_ORG_DEPT' and field_name='show_order' ;
|
||||
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_DEPT' and field_name='description' ;
|
||||
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_JOB' and field_name='description' ;
|
||||
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_JOB' and field_name='work_duty' ;
|
||||
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_JOB' and field_name='work_authority';
|
||||
update jcl_field_extendinfo set browser_type='666', custom_value='["browser",{"valueSpan":"聚才林岗位","replaceDatas":[{"itemorderid":"0","name":"聚才林岗位","id":"666","parenttitle":"资产","title":"资产-聚才林岗位"}],"value":"666"}]' where table_name ='JCL_ORG_JOB' and field_name='parent_job';
|
||||
|
||||
|
||||
delete from SystemRightDetail where rightid =2714;
|
||||
delete from SystemRightsLanguage where id =2714;
|
||||
delete from SystemRights where id =2714;
|
||||
delete from SystemRightToGroup where rightid =2714;
|
||||
delete from SystemRightType where id =37;
|
||||
delete from SystemRightGroups where id =-23;
|
||||
insert into SystemRights (id,rightdesc,righttype,detachable) values (2714,'组织数据导入','37',0);
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2714,8,'Organization data import','Organization data import');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2714,9,'組織數據導入','組織數據導入');
|
||||
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2714,7,'组织数据导入','组织数据导入');
|
||||
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (43998,'组织数据导入权限','DataImport:All',2714);
|
||||
insert into SystemRightToGroup(rightid,groupid) values (2714,-23);
|
||||
insert into SystemRightGroups (id,rightgroupmark, rightgroupname, rightgroupremark) values(-23,'ORGANIZATION','组织管理权限组','组织管理');
|
||||
insert into SystemRightType(id,rightTypeName,rightTypeDesc) VALUES (37,'组织管理','组织管理');
|
||||
|
|
@ -40,7 +40,7 @@ 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 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(), '');
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ 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 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(), '')
|
||||
GO
|
||||
|
|
|
|||
|
|
@ -517,3 +517,30 @@ create table JCL_ORG_HRMRELATION (
|
|||
update_time datetime null,
|
||||
constraint JCL_ORG_HRMRELATION_PK primary key (id)
|
||||
);
|
||||
|
||||
|
||||
-- JCL_ORG_ITEMCLASS
|
||||
create table JCL_ORG_ITEMCLASS (
|
||||
fid int auto_increment not null,
|
||||
fno varchar(50) not null,
|
||||
fname varchar (50) not null,
|
||||
fmemo varchar (255) null ,
|
||||
creator int null,
|
||||
create_time date null,
|
||||
update_time date null,
|
||||
constraint JCL_ORG_ITEMCLASS_PK primary key (fid)
|
||||
);
|
||||
|
||||
-- JCL_ORG_ITEM
|
||||
create table JCL_ORG_ITEM (
|
||||
fid int auto_increment not null,
|
||||
fclassid int not null,
|
||||
fno varchar(50) not null,
|
||||
fname varchar (255) not null,
|
||||
fmemo varchar (255) null,
|
||||
fdelete int not null,
|
||||
creator int null,
|
||||
create_time date null,
|
||||
update_time date null,
|
||||
constraint JCL_ORG_ITEM_PK primary key (fid)
|
||||
);
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/23
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Path("/bs/hrmorganization/resourceBasicInfo")
|
||||
public class ResourceBasicInfoController extends com.engine.organization.web.ResourceBasicInfoController{
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ public class EmployeeTableVO {
|
|||
@OrganizationTableColumn(text = "姓名", width = "50%", column = "lastname")
|
||||
private String lastname;
|
||||
|
||||
@OrganizationTableColumn(text = "性别", width = "50%", column = "sex")
|
||||
@OrganizationTableColumn(text = "性别", width = "50%", column = "sex",transmethod = "com.engine.organization.transmethod.JobTransMethod.getSexName")
|
||||
private String sex;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class ExtendGroupBO {
|
|||
|
||||
|
||||
private static boolean isHasGroup(Long id) {
|
||||
List<ExtendTitlePO> titlesByGroupID = MapperProxyFactory.getProxy(ExtendTitleMapper.class).getTitlesByGroupID(id);
|
||||
List<ExtendTitlePO> titlesByGroupID = MapperProxyFactory.getProxy(ExtendTitleMapper.class).getTitlesByGroupID(id,null);
|
||||
return titlesByGroupID.size() > 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ public class ExtendInfoBO {
|
|||
.isenable("1".equals(infoFieldParam.getEnable()) ? 1 : 0)
|
||||
.isrequired("1".equals(infoFieldParam.getRequired()) ? 1 : 0)
|
||||
.listShow(1)
|
||||
.editShow("0".equals(infoFieldParam.getIsModify()) ? 0 : 1)
|
||||
// .editShow("0".equals(infoFieldParam.getIsModify()) ? 0 : 1)
|
||||
.editShow(1)
|
||||
.addShow(1)
|
||||
.browserShow(1)
|
||||
.customValue(convertSelectCustom(controlType, infoFieldParam.getFieldType().toString()))
|
||||
|
|
|
|||
|
|
@ -94,6 +94,11 @@ public class ExtendInfoFieldParam {
|
|||
String dbLength = "100";
|
||||
if (fieldType.size() > 2) {
|
||||
dbLength = fieldType.get(2).toString();
|
||||
if (Integer.parseInt(dbLength) == 0) {
|
||||
dbLength = "50";
|
||||
fieldType.set(2,"50");
|
||||
}
|
||||
|
||||
}
|
||||
fp.setSimpleText(Util.getIntValue(browserType, -1), dbLength);
|
||||
} else if (controlType.equals("2")) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.organization.entity.hrmresource.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/24
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ResourceItemClassPO {
|
||||
|
||||
private Integer fid;
|
||||
|
||||
private String fno;
|
||||
|
||||
private String fname;
|
||||
|
||||
private String fmemo;
|
||||
|
||||
private Long creator;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.organization.entity.hrmresource.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/24
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ResourceItemPO {
|
||||
|
||||
private Integer fid;
|
||||
|
||||
private Integer fclassid;
|
||||
|
||||
private String fno;
|
||||
|
||||
private String fname;
|
||||
|
||||
private String fmemo;
|
||||
|
||||
private Integer fdelete;
|
||||
|
||||
private Long creator;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.engine.organization.entity.hrmresource.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.OperatePopedom;
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/23
|
||||
* @Version V1.0
|
||||
**/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "516e81fb-65d4-4010-b916-9f6ab337b199",
|
||||
fields = "t.fid," +
|
||||
"t.fno," +
|
||||
"t.fname," +
|
||||
"t.fmemo,"+
|
||||
"t.fdelete",
|
||||
fromSql = "FROM jcl_org_item t ",
|
||||
orderby = "fno",
|
||||
sortway = "asc",
|
||||
primarykey = "fid",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "恢复")
|
||||
},
|
||||
tableType = WeaTableType.CHECKBOX,
|
||||
operatePopedom = @OperatePopedom(transmethod = "com.engine.organization.util.ConfigTrans.formatResourceOperates", otherpara = "column:fdelete"
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
public class ResourceBasicInfoVO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@OrganizationTableColumn(column = "fid", display = false)
|
||||
private Integer fId;
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@OrganizationTableColumn(text = "编号", width = "20%", column = "fno", orderkey = "fno")
|
||||
private String fNo;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@OrganizationTableColumn(text = "名称", width = "20%", column = "fname")
|
||||
private String fName;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@OrganizationTableColumn(text = "说明", width = "20%", column = "fmemo")
|
||||
private String fMemo;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@OrganizationTableColumn(text = "状态", width = "20%", column = "fdelete")
|
||||
private String fDelete;
|
||||
}
|
||||
|
|
@ -89,6 +89,10 @@ public class JobPO {
|
|||
*/
|
||||
private Integer showOrder;
|
||||
|
||||
private String gradeId;
|
||||
|
||||
private String levelId;
|
||||
|
||||
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ public enum OperateTypeEnum {
|
|||
MOVE("5", "转移"),
|
||||
MERGE("6", "合并"),
|
||||
COPY("7", "复制"),
|
||||
CANCELED("8", "封存");
|
||||
CANCELED("8", "封存"),
|
||||
RECOVER("9","恢复");
|
||||
|
||||
private String value;
|
||||
|
||||
|
|
|
|||
|
|
@ -223,6 +223,9 @@
|
|||
<if test="description != null ">
|
||||
description,
|
||||
</if>
|
||||
<if test="uuid != null ">
|
||||
uuid,
|
||||
</if>
|
||||
forbidden_tag,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -262,11 +265,15 @@
|
|||
<if test="description != null ">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="uuid != null ">
|
||||
#{uuid},
|
||||
</if>
|
||||
0,
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.department.po.DepartmentPO" databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.department.po.DepartmentPO"
|
||||
databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select JCL_ORG_DEPT_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO jcl_org_dept
|
||||
|
|
@ -308,6 +315,9 @@
|
|||
<if test="description != null ">
|
||||
description,
|
||||
</if>
|
||||
<if test="uuid != null ">
|
||||
uuid,
|
||||
</if>
|
||||
forbidden_tag,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -347,6 +357,9 @@
|
|||
<if test="description != null ">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="uuid != null ">
|
||||
#{uuid},
|
||||
</if>
|
||||
0,
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.organization.mapper.extend;
|
||||
|
||||
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -51,4 +52,6 @@ public interface ExtMapper {
|
|||
* @return
|
||||
*/
|
||||
int updateTable(ExtendInfoParams params);
|
||||
|
||||
int deleteByID(@Param("tableName") String tableName, @Param("id") long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@
|
|||
</foreach>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteByID">
|
||||
delete
|
||||
from ${tableName}
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="listExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams" resultType="map">
|
||||
select ${fields}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public interface ExtendGroupMapper {
|
|||
* @param extendType
|
||||
* @return
|
||||
*/
|
||||
List<ExtendGroupPO> listByType(@Param("extendType") Integer extendType);
|
||||
List<ExtendGroupPO> listByType(@Param("extendType") Integer extendType, @Param("isShow") String isShow);
|
||||
|
||||
/**
|
||||
* 根据ID 查询数据
|
||||
|
|
@ -38,7 +38,7 @@ public interface ExtendGroupMapper {
|
|||
* @param pid
|
||||
* @return
|
||||
*/
|
||||
List<ExtendGroupPO> listGroupByPid(@Param("pid") Long pid);
|
||||
List<ExtendGroupPO> listGroupByPid(@Param("pid") Long pid, @Param("isShow") String isShow);
|
||||
|
||||
/**
|
||||
* 根据ID查询分组名称
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@
|
|||
<if test=" extendType != null and extendType != '' ">
|
||||
and extend_type = #{extendType}
|
||||
</if>
|
||||
<if test=" isShow !=null">
|
||||
and is_show = #{isShow}
|
||||
</if>
|
||||
order by show_order
|
||||
</select>
|
||||
<select id="getGroupNameById" resultType="java.lang.String">
|
||||
|
|
@ -66,6 +69,9 @@
|
|||
from jcl_field_extendgroup t
|
||||
WHERE t.delete_type = 0
|
||||
and t.pid= #{pid}
|
||||
<if test=" isShow !=null">
|
||||
and is_show = #{isShow}
|
||||
</if>
|
||||
order by show_order
|
||||
</select>
|
||||
<select id="getGroupById" resultMap="BaseResultMap">
|
||||
|
|
@ -148,9 +154,10 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.extend.po.ExtendGroupPO" databaseId="oracle">
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.extend.po.ExtendGroupPO"
|
||||
databaseId="oracle">
|
||||
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select JCL_FIELD_GROUP_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO jcl_field_extendgroup
|
||||
|
|
|
|||
|
|
@ -197,8 +197,9 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertExtendInfo" parameterType="com.engine.organization.entity.extend.po.ExtendInfoPO" databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
<insert id="insertExtendInfo" parameterType="com.engine.organization.entity.extend.po.ExtendInfoPO"
|
||||
databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select JCL_FIELD_INFO_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO jcl_field_extendinfo
|
||||
|
|
@ -352,6 +353,7 @@
|
|||
isrequired=#{isrequired},
|
||||
edit_show=#{editShow},
|
||||
show_order=#{showOrder},
|
||||
custom_value=#{customValue},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -419,6 +421,7 @@
|
|||
<select id="listFieldsByTableName" resultType="java.lang.Object">
|
||||
select ${fieldName}
|
||||
from ${tableName}
|
||||
where delete_type = 0
|
||||
</select>
|
||||
<select id="getExtendInfosByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public interface ExtendTitleMapper {
|
|||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
List<ExtendTitlePO> getTitlesByGroupID(@Param("groupId") Long groupId);
|
||||
List<ExtendTitlePO> getTitlesByGroupID(@Param("groupId") Long groupId, @Param("isShow") String isShow);
|
||||
|
||||
/**
|
||||
* 根据ID查询数据
|
||||
|
|
|
|||
|
|
@ -95,9 +95,10 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.extend.po.ExtendTitlePO" databaseId="oracle">
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.extend.po.ExtendTitlePO"
|
||||
databaseId="oracle">
|
||||
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select JCL_FIELD_TITLE_ID.currval from dual
|
||||
</selectKey>
|
||||
|
||||
|
|
@ -194,6 +195,9 @@
|
|||
<if test=" groupId != null ">
|
||||
and group_id = #{groupId}
|
||||
</if>
|
||||
<if test=" isShow !=null">
|
||||
and is_show = #{isShow}
|
||||
</if>
|
||||
order by show_order
|
||||
</select>
|
||||
|
||||
|
|
@ -207,6 +211,7 @@
|
|||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
and is_show = '1'
|
||||
order by show_order
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package com.engine.organization.mapper.hrmresource;
|
||||
|
||||
|
||||
import com.engine.organization.entity.TreeData;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/24
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface ResourceBasicInfoMapper {
|
||||
|
||||
ArrayList<TreeData> getTreeData();
|
||||
|
||||
@MapKey("id")
|
||||
List<Map<String, Object>> browserDatas(@Param("ids") Collection<Long> ids);
|
||||
|
||||
|
||||
ResourceItemPO getResourceItemByFid(@Param("fid") Integer fid);
|
||||
|
||||
List<ResourceItemPO> selectItemByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
int recoverByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* delete语句,删除人员信息
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deleteItemByIds(@Param("ids") Collection<Integer> ids);
|
||||
|
||||
List<ResourceItemPO> selectItemByFNo(@Param("fno") String fno, @Param("fclassid") Integer fclassid);
|
||||
|
||||
int insertIgnoreNull(ResourceItemPO resourceItemPO);
|
||||
|
||||
int update(ResourceItemPO resourceItemPO);
|
||||
|
||||
ResourceItemClassPO getResourceItemClassByFid(@Param("fid") Integer fid);
|
||||
|
||||
List<ResourceItemClassPO> selectItemClassByFNo(@Param("fno") String fno, @Param("fid") Integer fid);
|
||||
|
||||
int saveResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
int updateResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
int deleteResourceItemClass(@Param("fid") Integer fid);
|
||||
|
||||
List<ResourceItemPO> getItemByClassId(@Param("fclassid") Integer fclassid, @Param("fdelete") Integer fdelete);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,291 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.hrmresource.ResourceBasicInfoMapper">
|
||||
|
||||
<resultMap id="ItemResultMap" type="com.engine.organization.entity.hrmresource.po.ResourceItemPO">
|
||||
<result column="fid" property="fid"/>
|
||||
<result column="fclassid" property="fclassid"/>
|
||||
<result column="fno" property="fno"/>
|
||||
<result column="fname" property="fname"/>
|
||||
<result column="fmemo" property="fmemo"/>
|
||||
<result column="fdelete" property="fdelete"/>
|
||||
</resultMap>
|
||||
<resultMap id="ItemClassResultMap" type="com.engine.organization.entity.hrmresource.po.ResourceItemClassPO">
|
||||
<result column="fid" property="fid"/>
|
||||
<result column="fno" property="fno"/>
|
||||
<result column="fname" property="fname"/>
|
||||
<result column="fmemo" property="fmemo"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="TreeResultMap" type="com.engine.organization.entity.TreeData">
|
||||
<result column="fid" property="key"/>
|
||||
<result column="fname" property="title"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getTreeData" resultMap="TreeResultMap">
|
||||
select fid, fname
|
||||
from jcl_org_itemclass
|
||||
</select>
|
||||
|
||||
<select id="browserDatas" resultType="java.util.Map">
|
||||
select
|
||||
fid as `id`,
|
||||
fname as `name`
|
||||
from jcl_org_itemclass
|
||||
where fid IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getResourceItemByFid" resultType="com.engine.organization.entity.hrmresource.po.ResourceItemPO">
|
||||
select fid,
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_item
|
||||
where fdelete = 0
|
||||
and fid = #{fid}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectItemByIds" resultMap="ItemResultMap">
|
||||
select fid,fclassid,fno,fname,fmemo,fdelete,creator,create_time,update_time
|
||||
from jcl_org_item
|
||||
where fdelete = 0
|
||||
AND fid IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectItemByFNo" resultMap="ItemResultMap">
|
||||
select fid,
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_item
|
||||
where fno = #{fno}
|
||||
and fclassid = #{fclassid}
|
||||
</select>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE jcl_org_item
|
||||
SET fdelete = 1
|
||||
WHERE fdelete = 0
|
||||
AND fid IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="recoverByIds">
|
||||
UPDATE jcl_org_item
|
||||
SET fdelete = 0
|
||||
WHERE fdelete = 1
|
||||
AND fid IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO"
|
||||
keyProperty="fid"
|
||||
keyColumn="fid" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fclassid != null">
|
||||
fclassid,
|
||||
</if>
|
||||
<if test="fno != null">
|
||||
fno,
|
||||
</if>
|
||||
<if test="fname != null">
|
||||
fname,
|
||||
</if>
|
||||
<if test="fmemo != null">
|
||||
fmemo,
|
||||
</if>
|
||||
<if test="fdelete != null">
|
||||
fdelete,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="fclassid != null">
|
||||
#{fclassid},
|
||||
</if>
|
||||
<if test="fno != null">
|
||||
#{fno},
|
||||
</if>
|
||||
<if test="fname != null">
|
||||
#{fname},
|
||||
</if>
|
||||
<if test="fmemo != null">
|
||||
#{fmemo},
|
||||
</if>
|
||||
<if test="fdelete != null">
|
||||
#{fdelete},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<!--oracle未处理-->
|
||||
<!--<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO"-->
|
||||
<!--databaseId="oracle">-->
|
||||
<!--</insert>-->
|
||||
|
||||
<update id="update" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO">
|
||||
update jcl_org_item
|
||||
<set>
|
||||
fname=#{fname},
|
||||
fmemo=#{fmemo},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE fid = #{fid} AND fdelete = 0
|
||||
</update>
|
||||
|
||||
<select id="getResourceItemClassByFid" resultMap="ItemClassResultMap">
|
||||
select fid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_itemclass
|
||||
where fid = #{fid}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="saveResourceItemClass">
|
||||
INSERT INTO jcl_org_itemclass
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fno != null">
|
||||
fno,
|
||||
</if>
|
||||
<if test="fname != null">
|
||||
fname,
|
||||
</if>
|
||||
<if test="fmemo != null">
|
||||
fmemo,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="fno != null">
|
||||
#{fno},
|
||||
</if>
|
||||
<if test="fname != null">
|
||||
#{fname},
|
||||
</if>
|
||||
<if test="fmemo != null">
|
||||
#{fmemo},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectItemClassByFNo" resultMap="ItemClassResultMap">
|
||||
select fid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_itemclass
|
||||
where fno = #{fno}
|
||||
<if test=" fid !=null ">
|
||||
and fid != #{fid}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getItemByClassId" resultMap="ItemResultMap">
|
||||
select fid,
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_item
|
||||
where fclassid = #{fclassid}
|
||||
<if test="fdelete!=null">
|
||||
and fdelete = #{fdelete}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="updateResourceItemClass">
|
||||
update jcl_org_itemclass
|
||||
<set>
|
||||
fname=#{fname},
|
||||
fmemo=#{fmemo},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE fid = #{fid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteResourceItemClass">
|
||||
delete
|
||||
from jcl_org_itemclass
|
||||
where fid = #{fid}
|
||||
</delete>
|
||||
<delete id="deleteItemByIds">
|
||||
delete
|
||||
from jcl_org_item
|
||||
where fid IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -19,6 +19,8 @@
|
|||
<result column="description" property="description"/>
|
||||
<result column="show_order" property="showOrder"/>
|
||||
<result column="forbidden_tag" property="forbiddenTag"/>
|
||||
<result column="grade_id" property="gradeId"/>
|
||||
<result column="level_id" property="levelId"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
|
|
@ -46,7 +48,9 @@
|
|||
t.work_duty,
|
||||
t.work_authority,
|
||||
t.show_order,
|
||||
t.forbidden_tag
|
||||
t.forbidden_tag,
|
||||
t.grade_id,
|
||||
t.level_id
|
||||
</sql>
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.job.po.JobPO"
|
||||
keyProperty="id"
|
||||
|
|
@ -165,7 +169,7 @@
|
|||
</insert>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.job.po.JobPO" databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select JCL_ORG_JOB_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO jcl_org_job
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
</select>
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select grade_id
|
||||
from JCL_ORG_JOBDT
|
||||
from JCL_ORG_JOB
|
||||
where delete_type = 0
|
||||
</select>
|
||||
<select id="getGradeNameByIds" resultType="java.lang.String">
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
where delete_type = 0
|
||||
union
|
||||
select level_id
|
||||
from JCL_ORG_JOBDT
|
||||
from JCL_ORG_JOB
|
||||
where delete_type = 0
|
||||
</select>
|
||||
<select id="getTreeData" resultMap="TreeResultMap">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,123 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/23
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface ResourceBasicInfoService {
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取左侧树
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<TypeTreeVO> getTreeData();
|
||||
|
||||
/**
|
||||
* 新增编辑表单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<SearchConditionGroup> getForm(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 删除/批量删除人员信息资料
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deletByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 恢复人员信息资料
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int recoverByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 保存人员信息资料
|
||||
*
|
||||
* @param resourceItemPO
|
||||
* @return
|
||||
*/
|
||||
int save(ResourceItemPO resourceItemPO);
|
||||
|
||||
/**
|
||||
* 根据id获取人员信息资料
|
||||
*
|
||||
* @param fid
|
||||
* @return
|
||||
*/
|
||||
ResourceItemPO selectById(Integer fid);
|
||||
|
||||
/**
|
||||
* 更新人员信息资料
|
||||
*
|
||||
* @param resourceItemPO
|
||||
* @return
|
||||
*/
|
||||
int update(ResourceItemPO resourceItemPO);
|
||||
|
||||
|
||||
/**
|
||||
* 分类,新增编辑表单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<SearchConditionGroup> getItemClassForm(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 新增分类
|
||||
*
|
||||
* @param itemClassPO
|
||||
* @return
|
||||
*/
|
||||
int saveResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
/**
|
||||
* 更新分类
|
||||
*
|
||||
* @param itemClassPO
|
||||
* @return
|
||||
*/
|
||||
int updateResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
/**
|
||||
* 删除分类
|
||||
*
|
||||
* @param fid
|
||||
* @return
|
||||
*/
|
||||
int deleteResourceItemClass(Integer fid);
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SearchConditionGroup> getSearchCondition();
|
||||
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ import com.engine.hrm.entity.RuleCodeType;
|
|||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.company.bo.CompBO;
|
||||
import com.engine.organization.entity.company.dto.CompListDTO;
|
||||
import com.engine.organization.entity.company.param.CompSearchParam;
|
||||
|
|
@ -23,10 +24,13 @@ import com.engine.organization.enums.LogModuleNameEnum;
|
|||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.extend.ExtDTMapper;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.service.CompService;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.thread.OrganizationRunable;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.*;
|
||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
|
|
@ -71,6 +75,8 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
private static final String RIGHT_NAME = "Company:All";
|
||||
|
||||
private static final String HRM_COMPANY = "hrmsubcompany";
|
||||
|
||||
/**
|
||||
* 公司/分部主表title指定ID
|
||||
*/
|
||||
|
|
@ -84,6 +90,10 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
|
||||
}
|
||||
|
||||
private SystemDataMapper getSystemDataMapper() {
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
private ExtService getExtService(User user) {
|
||||
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -151,10 +161,14 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
}
|
||||
params.put("show_order", maxShowOrder + 1);
|
||||
}
|
||||
Long id = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", null);
|
||||
params.put("id", id);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, params)).start();
|
||||
return id;
|
||||
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());
|
||||
// 查询UUID
|
||||
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_COMPANY, ecCompanyID);
|
||||
params.put("uuid", recordInfo.getUuid());
|
||||
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -164,7 +178,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", compPO.getId());
|
||||
map.put("forbiddenTag", compPO.getForbiddenTag());
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.CANCELED, map)).start();
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.CANCELED, map).sync();
|
||||
return getCompMapper().updateForbiddenTagById(compPO);
|
||||
}
|
||||
|
||||
|
|
@ -182,7 +196,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
compNo = repeatDetermine(compNo);
|
||||
params.put("comp_no", compNo);
|
||||
}
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params)).start();
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
|
||||
// 更新主表数据
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId());
|
||||
// 更新主表拓展表
|
||||
|
|
@ -198,8 +212,13 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", StringUtils.join(ids, ","));
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.CANCELED, map)).start();
|
||||
for (Long id : ids) {
|
||||
map.put("id", id);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.CANCELED, map).sync();
|
||||
// 删除拓展表、明细表
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_compext", id);
|
||||
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_compext_dt1", id);
|
||||
}
|
||||
return getCompMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
|
@ -266,7 +285,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId), "1");
|
||||
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
|
|
@ -298,7 +317,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendTitle.getId() + "", "comp_no", RuleCodeType.SUBCOMPANY.getValue());
|
||||
|
|
@ -344,7 +363,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
map.put("comp_name_short", compPO.getCompNameShort());
|
||||
map.put("comp_name", compPO.getCompName());
|
||||
map.put("show_order", compPO.getShowOrder());
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, map)).start();
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, map).sync();
|
||||
return getCompMapper().updateBaseComp(compPO);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.hrm.entity.RuleCodeType;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.company.bo.CompBO;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||
|
|
@ -29,11 +30,14 @@ import com.engine.organization.enums.OperateTypeEnum;
|
|||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.extend.ExtDTMapper;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.service.DepartmentService;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.thread.OrganizationRunable;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.*;
|
||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
|
|
@ -85,6 +89,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
*/
|
||||
private static final Long GROUP_ID = 2L;
|
||||
|
||||
private static final String HRM_DEPARTMENT = "hrmdepartment";
|
||||
|
||||
|
||||
private static DepartmentMapper getDepartmentMapper() {
|
||||
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
||||
|
|
@ -98,6 +104,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
|
||||
}
|
||||
|
||||
private SystemDataMapper getSystemDataMapper() {
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
private ExtService getExtService(User user) {
|
||||
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -202,10 +212,13 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
}
|
||||
params.put("show_order", maxShowOrder + 1);
|
||||
}
|
||||
Long departmentId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", null);
|
||||
params.put("id", departmentId);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, params)).start();
|
||||
return departmentId;
|
||||
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());
|
||||
// 查询UUID
|
||||
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_DEPARTMENT, ecCompanyID);
|
||||
params.put("uuid", recordInfo.getUuid());
|
||||
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -215,7 +228,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", departmentPO.getId());
|
||||
map.put("forbiddenTag", departmentPO.getForbiddenTag());
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map)).start();
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).sync();
|
||||
return getDepartmentMapper().updateForbiddenTagById(departmentPO);
|
||||
}
|
||||
|
||||
|
|
@ -234,9 +247,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
deptNo = repeatDetermine(deptNo);
|
||||
params.put("dept_no", deptNo);
|
||||
}
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
|
||||
// 更新主表数据
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId());
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params)).start();
|
||||
// 更新主表拓展表
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId());
|
||||
//更新明细表
|
||||
|
|
@ -250,8 +263,15 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", StringUtils.join(ids, ","));
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map)).start();
|
||||
|
||||
for (Long id : ids) {
|
||||
map.put("id", id);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).sync();
|
||||
// 删除拓展表、明细表
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_deptext", id);
|
||||
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_deptext_dt1", id);
|
||||
}
|
||||
|
||||
return getDepartmentMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
|
@ -319,7 +339,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId), "1");
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_DEPT : JCL_ORG_DEPTEXT, viewAttr, id, extendTitle.getId().toString(), "");
|
||||
|
|
@ -350,7 +370,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
||||
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
|
|
@ -398,7 +418,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
OrganizationAssert.notBlank(copyParam.getCompany(), "请指定需要复制的公司/分部");
|
||||
int insertCount = 0;
|
||||
List<Long> idList = Arrays.stream(copyParam.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
int maxShowOrder = getDepartmentMapper().getMaxShowOrder();
|
||||
Integer maxShowOrder = getDepartmentMapper().getMaxShowOrder();
|
||||
maxShowOrder = null == maxShowOrder ? 0 : maxShowOrder;
|
||||
for (int i = 0; i < idList.size(); i++) {
|
||||
DepartmentPO deptById = getDepartmentMapper().getDeptById(idList.get(i));
|
||||
deptById.setDeptName(deptById.getDeptName() + "[复制]");
|
||||
|
|
@ -409,9 +430,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
deptById.setParentDept(null);
|
||||
// 显示顺序字段
|
||||
deptById.setShowOrder(maxShowOrder + i + 1);
|
||||
insertCount += getDepartmentMapper().insertIgnoreNull(deptById);
|
||||
deptById.setCreateTime(new Date());
|
||||
// 新增EC表部门
|
||||
addEcDepartment(deptById);
|
||||
Map<String, Object> syncMap = addEcDepartment(deptById);
|
||||
String ecDepartmentID = Util.null2String(syncMap.get("id"));
|
||||
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecDepartmentID), syncMap.get("message").toString());
|
||||
// 查询UUID
|
||||
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_DEPARTMENT, ecDepartmentID);
|
||||
deptById.setUuid(recordInfo.getUuid());
|
||||
insertCount += getDepartmentMapper().insertIgnoreNull(deptById);
|
||||
|
||||
// 新增岗位信息
|
||||
if ("1".equals(copyParam.getCopyJob())) {
|
||||
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listJobsByDepartmentId(idList.get(i));
|
||||
|
|
@ -453,6 +481,14 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
DepartmentPO targetDepartment = getDepartmentMapper().getDeptById(mergeParam.getDepartment());
|
||||
Long parentComp = targetDepartment.getParentComp();
|
||||
|
||||
Set<Long> disableIds = new HashSet<>();
|
||||
disableIds.add(mergeParam.getId());
|
||||
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
|
||||
if (CollectionUtils.isNotEmpty(deptListByPId)) {
|
||||
addDisableIds(disableIds, deptListByPId);
|
||||
}
|
||||
OrganizationAssert.isFalse(disableIds.contains(targetDepartment.getId()), "请勿选择当前部门本身及其子部门");
|
||||
|
||||
// 所选部门
|
||||
DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
|
||||
mergeDepartment.setDeptName(mergeParam.getMergeName());
|
||||
|
|
@ -461,11 +497,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
mergeDepartment.setParentComp(parentComp);
|
||||
// 禁用
|
||||
mergeDepartment.setForbiddenTag(1);
|
||||
updateCount += getDepartmentMapper().updateBaseDept(mergeDepartment);
|
||||
// 更新EC表部门
|
||||
updateEcDepartment(mergeDepartment);
|
||||
// 封存EC表部门
|
||||
cancelEcDepartment(mergeDepartment.getId());
|
||||
|
||||
updateCount = getDepartmentMapper().updateBaseDept(mergeDepartment);
|
||||
// 合并后部门及子部门禁用
|
||||
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
|
||||
forbiddenChildTag(parentComp, deptList);
|
||||
|
|
@ -508,7 +545,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
deptById.setParentComp(company);
|
||||
deptById.setParentDept(null);
|
||||
} else if ("1".equals(moveParam.getMoveType())) {
|
||||
// TODO 判断是否选择子部门
|
||||
Long department = moveParam.getDepartment();
|
||||
OrganizationAssert.notNull(department, "请选择要转移到的部门");
|
||||
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(moveParam.getId());
|
||||
|
|
@ -522,10 +558,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
DepartmentPO parentDepartment = getDepartmentMapper().getDeptById(department);
|
||||
deptById.setParentComp(parentDepartment.getParentComp());
|
||||
}
|
||||
int updateBaseDept = getDepartmentMapper().updateBaseDept(deptById);
|
||||
// 更新EC部门
|
||||
updateEcDepartment(deptById);
|
||||
return updateBaseDept;
|
||||
|
||||
return getDepartmentMapper().updateBaseDept(deptById);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -539,11 +575,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
for (DepartmentPO departmentPO : deptList) {
|
||||
departmentPO.setParentComp(parentComp);
|
||||
departmentPO.setForbiddenTag(1);
|
||||
getDepartmentMapper().updateBaseDept(departmentPO);
|
||||
// 更新EC表部门
|
||||
updateEcDepartment(departmentPO);
|
||||
// 封存EC表部门
|
||||
cancelEcDepartment(departmentPO.getId());
|
||||
|
||||
getDepartmentMapper().updateBaseDept(departmentPO);
|
||||
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(departmentPO.getId());
|
||||
forbiddenChildTag(parentComp, childList);
|
||||
}
|
||||
|
|
@ -675,15 +712,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
map.put("dept_no", departmentPO.getDeptNo());
|
||||
map.put("dept_principal", departmentPO.getDeptPrincipal());
|
||||
map.put("id", departmentPO.getId());
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, map)).start();
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, map).sync();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增EC表部门
|
||||
*
|
||||
* @param departmentPO
|
||||
* @return
|
||||
*/
|
||||
private void addEcDepartment(DepartmentPO departmentPO) {
|
||||
private Map<String, Object> addEcDepartment(DepartmentPO departmentPO) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("dept_name_short", departmentPO.getDeptNameShort());
|
||||
map.put("dept_name", departmentPO.getDeptName());
|
||||
|
|
@ -693,7 +731,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
map.put("dept_no", departmentPO.getDeptNo());
|
||||
map.put("dept_principal", departmentPO.getDeptPrincipal());
|
||||
map.put("id", departmentPO.getId());
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, map)).start();
|
||||
return new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, map).sync();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -704,7 +742,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
private void cancelEcDepartment(Long id) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", id);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map)).start();
|
||||
map.put("forbiddenTag", 1);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).sync();
|
||||
}
|
||||
|
||||
private void addDisableIds(Set<Long> disableIds, List<DepartmentPO> deptListByPId) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
List<Map<String, Object>> tables = new ArrayList<>();
|
||||
List<ExtendInfoPO> infoPOList = new ArrayList<>();
|
||||
// 查询明细表
|
||||
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listGroupByPid(groupId);
|
||||
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listGroupByPid(groupId, "1");
|
||||
for (ExtendGroupPO extendGroup : extendGroupList) {
|
||||
infoPOList.addAll(getExtendInfoMapper().listFields(extendType, extendGroup.getId() + "", tableName, "", "1"));
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByIds(ids);
|
||||
Set<Long> groupIds = extendTitles.stream().map(ExtendTitlePO::getGroupId).collect(Collectors.toSet());
|
||||
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listByType(Integer.parseInt(extendType));
|
||||
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listByType(Integer.parseInt(extendType), "1");
|
||||
|
||||
// 拓展信息
|
||||
if (CollectionUtils.isNotEmpty(extendGroupList) && CollectionUtils.isNotEmpty(groupIds)) {
|
||||
|
|
@ -207,6 +207,7 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|||
Map<String, Object> map = new HashMap<>();
|
||||
// 遍历Map
|
||||
Map<String, ExtendInfoPO> collect = extInfoPOList.stream().collect(Collectors.toMap(ExtendInfoPO::getFieldName, item -> item));
|
||||
collect.put("uuid", new ExtendInfoPO());
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (collect.containsKey(key)) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
@Override
|
||||
public List<TypeTreeVO> getTree(ModuleTypeEnum moduleTypeEnum) {
|
||||
Integer extendType = moduleTypeEnum.getValue();
|
||||
List<ExtendGroupPO> extendGroupPOS = MapperProxyFactory.getProxy(ExtendGroupMapper.class).listByType(extendType);
|
||||
List<ExtendGroupPO> extendGroupPOS = MapperProxyFactory.getProxy(ExtendGroupMapper.class).listByType(extendType, null);
|
||||
return ExtendGroupBO.buildTypeTree(extendGroupPOS);
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
Map<String, Object> datas = new HashMap<>();
|
||||
Long groupId = Long.parseLong(groupType);
|
||||
String tableName = ExtendGroupBO.getTableNameByGroupPO(getExtendGroupMapper().getGroupById(groupId));
|
||||
List<ExtendTitlePO> extendTitleList = getExtendTitleMapper().getTitlesByGroupID(groupId);
|
||||
List<ExtendTitlePO> extendTitleList = getExtendTitleMapper().getTitlesByGroupID(groupId, null);
|
||||
List<Map<String, Object>> tabs = new ArrayList<>();
|
||||
int idx = 1;
|
||||
for (ExtendTitlePO extendTitle : extendTitleList) {
|
||||
|
|
@ -116,9 +116,9 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
Long maxId = getExtendInfoMapper().getMaxId();
|
||||
extendInfo.setFieldName("field" + (maxId + 1));
|
||||
extendInfo.setIsSystemDefault(1);
|
||||
updateCount += getExtendInfoMapper().insertExtendInfo(extendInfo);
|
||||
// 新增表结构
|
||||
getExtendInfoMapper().addTableColumn(extendInfo.getTableName(), extendInfo.getFieldName(), extendInfo.getFieldType());
|
||||
updateCount += getExtendInfoMapper().insertExtendInfo(extendInfo);
|
||||
// 明细表且为浏览按钮字段,添加span字段
|
||||
if (null != extendGroup.getPid() && 3 == extendInfo.getControlType()) {
|
||||
String dbType = infoFieldParam.getDbType("2", "");
|
||||
|
|
@ -135,7 +135,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
Map<String, Object> datas = new HashMap<>();
|
||||
Long groupType = param.getGroupType();
|
||||
Set<Long> lsDelGroupId = new HashSet<>();
|
||||
List<ExtendTitlePO> extendTitleList = getExtendTitleMapper().getTitlesByGroupID(groupType);
|
||||
List<ExtendTitlePO> extendTitleList = getExtendTitleMapper().getTitlesByGroupID(groupType, null);
|
||||
extendTitleList.forEach(item -> lsDelGroupId.add(item.getId()));
|
||||
String data = param.getData();
|
||||
JSONObject jsonObject = JSON.parseObject(data);
|
||||
|
|
@ -178,7 +178,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
public Map<String, Object> saveTitle(ExtendTitleSaveParam param) {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
|
||||
List<ExtendTitlePO> titlesByGroupID = getExtendTitleMapper().getTitlesByGroupID(param.getGroupType());
|
||||
List<ExtendTitlePO> titlesByGroupID = getExtendTitleMapper().getTitlesByGroupID(param.getGroupType(), null);
|
||||
ExtendTitlePO extendTitlePO = titlesByGroupID.stream().max(Comparator.comparing(ExtendTitlePO::getShowOrder)).orElse(ExtendTitlePO.builder().showOrder(1).build());
|
||||
Set<Long> ids = titlesByGroupID.stream().map(ExtendTitlePO::getId).collect(Collectors.toSet());
|
||||
ExtendTitlePO extendTitle = new ExtendTitlePO();
|
||||
|
|
@ -201,7 +201,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
@Override
|
||||
public void changeTree(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam) {
|
||||
if (fieldTypeTreeParam.getId() == null) {
|
||||
List<ExtendGroupPO> extendGroupPOList = MapperProxyFactory.getProxy(ExtendGroupMapper.class).listByType(moduleTypeEnum.getValue());
|
||||
List<ExtendGroupPO> extendGroupPOList = MapperProxyFactory.getProxy(ExtendGroupMapper.class).listByType(moduleTypeEnum.getValue(), null);
|
||||
ExtendGroupPO extendGroup = extendGroupPOList.stream().max(Comparator.comparing(ExtendGroupPO::getShowOrder)).get();
|
||||
ExtendGroupPO extendGroupPO = buildExtendGroupType(moduleTypeEnum, fieldTypeTreeParam, extendGroup.getShowOrder());
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).insertIgnoreNull(extendGroupPO);
|
||||
|
|
@ -217,7 +217,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
@Override
|
||||
public int deleteTitle(ExtendTitleSaveParam param) {
|
||||
getExtendTitleMapper().deleteExtendTitleByIds(DeleteParam.builder().ids(param.getId().toString()).build().getIds());
|
||||
List<ExtendTitlePO> titlesByGroupID = getExtendTitleMapper().getTitlesByGroupID(param.getGroupType());
|
||||
List<ExtendTitlePO> titlesByGroupID = getExtendTitleMapper().getTitlesByGroupID(param.getGroupType(), null);
|
||||
|
||||
if (CollectionUtils.isEmpty(titlesByGroupID)) {
|
||||
// 删除整个分组
|
||||
|
|
@ -457,8 +457,22 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
public void deleteTree(Long id) {
|
||||
//明细表删除字段信息、删除表结构
|
||||
ExtendGroupPO extendGroupPO = getExtendGroupMapper().getGroupById(id);
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).delete(id);
|
||||
List<ExtendInfoPO> extendInfoList = getExtendInfoMapper().listFields(extendGroupPO.getExtendType().toString(), extendGroupPO.getId().toString(), ExtendGroupBO.getTableNameByGroupPO(extendGroupPO), "", "");
|
||||
String msg = "";
|
||||
for (ExtendInfoPO extendInfoPO : extendInfoList) {
|
||||
// 判断字段是否使用
|
||||
boolean isUsed = ExtendInfoBO.fieldIsUsed(extendInfoPO.getTableName(), extendInfoPO.getFieldName());
|
||||
if (isUsed) {
|
||||
msg = extendInfoPO.getFieldNameDesc() + "字段已被使用,不可删除";
|
||||
break;
|
||||
}
|
||||
if (extendInfoPO.getIsSystemDefault() == 0) {
|
||||
msg = extendInfoPO.getFieldNameDesc() + "字段为系统必须字段,不可删除";
|
||||
break;
|
||||
}
|
||||
}
|
||||
OrganizationAssert.isBlank(msg, msg);
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).delete(id);
|
||||
List<Long> ids = extendInfoList.stream().map(ExtendInfoPO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
// 删除数据
|
||||
|
|
@ -469,16 +483,12 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
@Override
|
||||
public void saveTree(ModuleTypeEnum moduleTypeEnum, FieldTypeTreeParam fieldTypeTreeParam) {
|
||||
Set<Long> collect = MapperProxyFactory.getProxy(ExtendGroupMapper.class)
|
||||
.listGroupByPid(fieldTypeTreeParam.getParentId()).stream().map(ExtendGroupPO::getId).collect(Collectors.toSet());
|
||||
.listGroupByPid(fieldTypeTreeParam.getParentId(), null).stream().map(ExtendGroupPO::getId).collect(Collectors.toSet());
|
||||
Integer extendType = moduleTypeEnum.getValue();
|
||||
List<ExtendGroupPO> extendGroupPOS = JSONArray.parseArray(fieldTypeTreeParam.getData(), ExtendGroupPO.class);
|
||||
|
||||
List<Long> collect1 = extendGroupPOS.stream().map(ExtendGroupPO::getId).collect(Collectors.toList());
|
||||
collect1.forEach(e -> {
|
||||
if (collect.contains(e)) {
|
||||
collect.remove(e);
|
||||
}
|
||||
});
|
||||
collect1.forEach(collect::remove);
|
||||
if (CollectionUtils.isNotEmpty(collect)) {
|
||||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).batchDelete(collect);
|
||||
}
|
||||
|
|
@ -525,7 +535,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
|
||||
if (StringUtils.isNotEmpty(fieldids) && null != groupid) {
|
||||
// 更新extendInfo表的extend_group_id
|
||||
List<Long> ids = Arrays.asList(fieldids.split(",")).stream().map(item -> Long.parseLong(item)).collect(Collectors.toList());
|
||||
List<Long> ids = Arrays.stream(fieldids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
getExtendInfoMapper().updateExtendGroupId(groupid, ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ public class GroupServiceImpl extends Service implements GroupService {
|
|||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
SearchConditionItem companyNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "总部名称", "companyname");
|
||||
SearchConditionItem companyDescItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "总部全称", "companydesc");
|
||||
companyDescItem.setRules("required|string");
|
||||
SearchConditionItem companyWebItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 1, 60, "公司网站", "companyweb");
|
||||
SearchConditionItem companyNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "总部名称", "companyname");
|
||||
companyNameItem.setRules("required|string");
|
||||
SearchConditionItem companyDescItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "总部全称", "companydesc");
|
||||
SearchConditionItem companyWebItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "公司网站", "companyweb");
|
||||
|
||||
// 赋值
|
||||
String id = Util.null2String(params.get("id"));
|
||||
|
|
@ -58,11 +58,10 @@ public class GroupServiceImpl extends Service implements GroupService {
|
|||
|
||||
|
||||
// 设置编辑属性
|
||||
if (!StringUtil.isEmpty(Util.null2String(params.get("viewattr")))) {
|
||||
int viewAttr = Integer.parseInt(params.get("viewattr").toString());
|
||||
companyNameItem.setViewAttr(viewAttr);
|
||||
companyDescItem.setViewAttr(viewAttr);
|
||||
companyWebItem.setViewAttr(viewAttr);
|
||||
if ("1".equals(Util.null2String(params.get("viewattr")))) {
|
||||
companyNameItem.setViewAttr(1);
|
||||
companyDescItem.setViewAttr(1);
|
||||
companyWebItem.setViewAttr(1);
|
||||
}
|
||||
|
||||
selectItems.add(companyNameItem);
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
public Map<String, Object> getSaveForm() {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID,"1");
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_HRM, 2, extendTitle.getId() + "", null, null)));
|
||||
|
|
@ -203,7 +203,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId),"1");
|
||||
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.hrm.entity.FieldSelectOptionBean;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.SelectOptionParam;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
|
||||
|
|
@ -29,7 +30,7 @@ import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
|
|||
import com.engine.organization.mapper.jclimport.JclImportHistoryMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.service.ImportCommonService;
|
||||
import com.engine.organization.thread.OrganizationRunable;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
|
|
@ -75,6 +76,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
private static final Long JOB_TYPE = 3L;
|
||||
|
||||
private static final String RIGHT_NAME = "DataImport:All";
|
||||
private static final String HRM_COMPANY = "hrmsubcompany";
|
||||
private static final String HRM_DEPARTMENT = "hrmdepartment";
|
||||
|
||||
|
||||
private ExtendInfoMapper getExtendInfoMapper() {
|
||||
|
|
@ -554,6 +557,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
int lastRow = sheetAt.getLastRowNum();
|
||||
List<ExtendInfoPO> extendInfoPOS = new ArrayList<>();
|
||||
OrganizationAssert.isTrue(lastRow > 0, "导入数据为空");
|
||||
short lastCellNum = sheetAt.getRow(0).getLastCellNum();
|
||||
|
||||
|
||||
// 遍历每一行数据
|
||||
|
|
@ -568,11 +572,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
String companyName = "";
|
||||
|
||||
historyDetailPO.setRowNums(String.valueOf(i + 1));
|
||||
for (int cellIndex = 0; cellIndex < row.getLastCellNum(); cellIndex++) {
|
||||
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
|
||||
XSSFCell cell = row.getCell((short) cellIndex);
|
||||
if (cell == null) {
|
||||
continue;
|
||||
}
|
||||
String cellValue = getCellValue(cell).trim();
|
||||
if (i == 0) {
|
||||
// 首行 初始化字段信息
|
||||
|
|
@ -607,7 +608,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
if ("comp_name".equals(infoPO.getFieldName())) {
|
||||
historyDetailPO.setRelatedName(cellValue);
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 1) {
|
||||
if (split.length > 0) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
|
|
@ -653,12 +654,21 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
if (StringUtils.isBlank(Util.null2String(map.get("forbidden_tag")))) {
|
||||
map.put("forbidden_tag", 0);
|
||||
}
|
||||
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build();
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
|
||||
map.put("id", infoParams.getId());
|
||||
new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, map).run();
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, map, false).sync();
|
||||
if (isThrowError(syncMap)) {
|
||||
// 查询UUID
|
||||
String ecCompanyID = Util.null2String(syncMap.get("id"));
|
||||
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_COMPANY, ecCompanyID);
|
||||
map.put("uuid", recordInfo.getUuid());
|
||||
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build();
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
||||
historyDetailPO.setStatus("0");
|
||||
}
|
||||
saveImportDetailLog(historyDetailPO);
|
||||
} else if ("update".equals(operateType)) {
|
||||
// 查询对应ID
|
||||
|
|
@ -672,9 +682,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
map.put("update_time", new Date());
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(companyId).tableName("JCL_ORG_COMP").params(map).build());
|
||||
map.put("id", companyId);
|
||||
new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, map).run();
|
||||
historyDetailPO.setOperateDetail("更新成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, map, false).sync();
|
||||
if (isThrowError(syncMap)) {
|
||||
historyDetailPO.setOperateDetail("更新成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
||||
historyDetailPO.setStatus("0");
|
||||
}
|
||||
saveImportDetailLog(historyDetailPO);
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(compNo + "编号已存在");
|
||||
|
|
@ -711,6 +726,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
int lastRow = sheetAt.getLastRowNum();
|
||||
List<ExtendInfoPO> extendInfoPOS = new ArrayList<>();
|
||||
OrganizationAssert.isTrue(lastRow > 0, "导入数据为空");
|
||||
short lastCellNum = sheetAt.getRow(0).getLastCellNum();
|
||||
|
||||
|
||||
// 遍历每一行数据
|
||||
|
|
@ -726,11 +742,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
String departmentName = "";
|
||||
|
||||
historyDetailPO.setRowNums(String.valueOf(i + 1));
|
||||
for (int cellIndex = 0; cellIndex < row.getLastCellNum(); cellIndex++) {
|
||||
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
|
||||
XSSFCell cell = row.getCell((short) cellIndex);
|
||||
if (cell == null) {
|
||||
continue;
|
||||
}
|
||||
String cellValue = getCellValue(cell).trim();
|
||||
if (i == 0) {
|
||||
// 首行 初始化字段信息
|
||||
|
|
@ -765,7 +778,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
// 上级分部
|
||||
if ("parent_comp".equals(infoPO.getFieldName())) {
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 1) {
|
||||
if (split.length > 0) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
|
|
@ -793,7 +806,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
historyDetailPO.setRelatedName(cellValue);
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 1) {
|
||||
if (split.length > 0) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("部门层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
|
|
@ -840,12 +853,22 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
if (StringUtils.isBlank(Util.null2String(map.get("forbidden_tag")))) {
|
||||
map.put("forbidden_tag", 0);
|
||||
}
|
||||
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_DEPT").params(map).build();
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
|
||||
map.put("id", infoParams.getId());
|
||||
new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, map).run();
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.ADD, map, false).sync();
|
||||
if (isThrowError(syncMap)) {
|
||||
// 查询UUID
|
||||
String ecDepartmentID = Util.null2String(syncMap.get("id"));
|
||||
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_DEPARTMENT, ecDepartmentID);
|
||||
map.put("uuid", recordInfo.getUuid());
|
||||
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_DEPT").params(map).build();
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
|
||||
map.put("id", infoParams.getId());
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
||||
historyDetailPO.setStatus("0");
|
||||
}
|
||||
saveImportDetailLog(historyDetailPO);
|
||||
} else if ("update".equals(operateType)) {
|
||||
// 查询对应ID
|
||||
|
|
@ -859,9 +882,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
map.put("update_time", new Date());
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(departmentId).tableName("JCL_ORG_DEPT").params(map).build());
|
||||
map.put("id", departmentId);
|
||||
new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, map).run();
|
||||
historyDetailPO.setOperateDetail("更新成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, map, false).sync();
|
||||
if (isThrowError(syncMap)) {
|
||||
historyDetailPO.setOperateDetail("更新成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
||||
historyDetailPO.setStatus("0");
|
||||
}
|
||||
saveImportDetailLog(historyDetailPO);
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(deptNo + "编号已存在");
|
||||
|
|
@ -898,7 +926,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
int lastRow = sheetAt.getLastRowNum();
|
||||
List<ExtendInfoPO> extendInfoPOS = new ArrayList<>();
|
||||
OrganizationAssert.isTrue(lastRow > 0, "导入数据为空");
|
||||
|
||||
short lastCellNum = sheetAt.getRow(0).getLastCellNum();
|
||||
|
||||
// 遍历每一行数据
|
||||
nextRow:
|
||||
|
|
@ -914,11 +942,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
String jobName = "";
|
||||
|
||||
historyDetailPO.setRowNums(String.valueOf(i + 1));
|
||||
for (int cellIndex = 0; cellIndex < row.getLastCellNum(); cellIndex++) {
|
||||
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
|
||||
XSSFCell cell = row.getCell((short) cellIndex);
|
||||
if (cell == null) {
|
||||
continue;
|
||||
}
|
||||
String cellValue = getCellValue(cell).trim();
|
||||
if (i == 0) {
|
||||
// 首行 初始化字段信息
|
||||
|
|
@ -953,7 +978,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
// 上级分部
|
||||
if ("ec_company".equals(infoPO.getFieldName())) {
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 1) {
|
||||
if (split.length > 0) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
|
|
@ -975,7 +1000,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
|
||||
if ("ec_department".equals(infoPO.getFieldName())) {
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 1) {
|
||||
if (split.length > 0) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("部门层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
|
|
@ -1003,7 +1028,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
historyDetailPO.setRelatedName(cellValue);
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 1) {
|
||||
if (split.length > 0) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("岗位层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
|
|
@ -1059,9 +1084,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
|
||||
map.put("jobactivityid", JobServiceImpl.JOB_ACTIVITY_ID);
|
||||
map.put("id", infoParams.getId());
|
||||
new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, map).run();
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, map, false).sync();
|
||||
if (isThrowError(syncMap)) {
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
||||
historyDetailPO.setStatus("0");
|
||||
}
|
||||
saveImportDetailLog(historyDetailPO);
|
||||
} else if ("update".equals(operateType)) {
|
||||
// 查询对应ID
|
||||
|
|
@ -1076,9 +1106,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
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("id", jobId);
|
||||
new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, map).run();
|
||||
historyDetailPO.setOperateDetail("更新成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, map, false).sync();
|
||||
if (isThrowError(syncMap)) {
|
||||
historyDetailPO.setOperateDetail("更新成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
||||
historyDetailPO.setStatus("0");
|
||||
}
|
||||
saveImportDetailLog(historyDetailPO);
|
||||
} else {
|
||||
historyDetailPO.setOperateDetail(jobNo + "编号已存在");
|
||||
|
|
@ -1282,4 +1317,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
return excelPath;
|
||||
}
|
||||
|
||||
private boolean isThrowError(Map<String, Object> resultMap) {
|
||||
return "1".equals(Util.null2String(resultMap.get("status"))) || "1".equals(Util.null2String(resultMap.get("sign")));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.engine.organization.entity.job.dto.JobListDTO;
|
|||
import com.engine.organization.entity.job.param.JobMergeParam;
|
||||
import com.engine.organization.entity.job.param.JobSearchParam;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.scheme.po.GradePO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
|
|
@ -31,12 +32,15 @@ import com.engine.organization.enums.OperateTypeEnum;
|
|||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.extend.ExtDTMapper;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.service.JobService;
|
||||
import com.engine.organization.thread.OrganizationRunable;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.*;
|
||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
|
|
@ -246,7 +250,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendTitle.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue(), "scheme_id", "parent_comp");
|
||||
|
|
@ -276,7 +280,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId), "1");
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_JOB : JCL_ORG_JOBEXT, viewAttr, id, extendTitle.getId().toString(), "scheme_id", "parent_comp");
|
||||
|
|
@ -299,6 +303,14 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
|
||||
apiDatas.put("result", resultMap);
|
||||
// 返回职等信息
|
||||
JobPO jobById = getJobMapper().getJobById(id);
|
||||
if (null != jobById && StringUtils.isNotBlank(jobById.getGradeId())) {
|
||||
GradePO gradeByID = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(Long.parseLong(jobById.getGradeId()));
|
||||
if (null != gradeByID) {
|
||||
apiDatas.put("levelIds", gradeByID.getLevelId());
|
||||
}
|
||||
}
|
||||
|
||||
return apiDatas;
|
||||
}
|
||||
|
|
@ -328,11 +340,9 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
params.put("show_order", maxShowOrder + 1);
|
||||
}
|
||||
Long jobId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
|
||||
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
params.put("id", jobId);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, params)).start();
|
||||
return jobId;
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, params).sync();
|
||||
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -362,7 +372,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(jclDepartment.getParentComp() + ""));
|
||||
}
|
||||
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO)).start();
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO).sync();
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
|
||||
// 更新主表拓展表
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
|
||||
|
|
@ -377,7 +387,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
OrganizationAssert.notBlank(department, "请指定需要复制的部门");
|
||||
int insertCount = 0;
|
||||
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
int orderNum = getJobMapper().getMaxShowOrder();
|
||||
Integer orderNum = getJobMapper().getMaxShowOrder();
|
||||
orderNum = null == orderNum ? 0 : orderNum;
|
||||
for (Long id : idList) {
|
||||
orderNum++;
|
||||
JobPO jobById = getJobMapper().getJobById(id);
|
||||
|
|
@ -395,7 +406,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
public int updateForbiddenTagById(JobSearchParam params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
JobPO jobPO = JobPO.builder().id(params.getId()).forbiddenTag(params.getForbiddenTag() ? 0 : 1).jobName(getJobMapper().getJobById(params.getId()).getJobName()).build();
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobPO)).start();
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobPO).sync();
|
||||
return getJobMapper().updateForbiddenTagById(jobPO.getId(), jobPO.getForbiddenTag());
|
||||
}
|
||||
|
||||
|
|
@ -404,11 +415,14 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
List<JobPO> jobsByIds = getJobMapper().getJobsByIds(ids);
|
||||
int delete = getJobMapper().deleteByIds(ids);
|
||||
for (JobPO jobsById : jobsByIds) {
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById)).start();
|
||||
jobsById.setForbiddenTag(1);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById).sync();
|
||||
// 删除拓展表、明细表
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_jobext", jobsById.getId());
|
||||
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_jobext_dt1", jobsById.getId());
|
||||
}
|
||||
return delete;
|
||||
return getJobMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -424,7 +438,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
public List<SearchConditionGroup> getMergeForm() {
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> condition = new ArrayList<>();
|
||||
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到岗位", "161", "targetJob", "jobBrowser");
|
||||
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到岗位", "666", "targetJob", "");
|
||||
deptBrowserItem.setRules("required");
|
||||
condition.add(deptBrowserItem);
|
||||
addGroups.add(new SearchConditionGroup("", true, condition));
|
||||
|
|
@ -434,7 +448,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
@Override
|
||||
public int mergeJob(JobMergeParam mergeParam) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
int updateCount = 0;
|
||||
int updateCount;
|
||||
OrganizationAssert.notNull(mergeParam.getTargetJob(), "请选择需要合并的部门");
|
||||
Set<Long> disableIds = new HashSet<>();
|
||||
disableIds.add(mergeParam.getId());
|
||||
|
|
@ -452,8 +466,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
// 原岗位禁用
|
||||
JobPO mergeJob = getJobMapper().getJobById(mergeParam.getId());
|
||||
mergeJob.setForbiddenTag(1);
|
||||
updateCount += getJobMapper().updateBaseJob(mergeJob);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, mergeJob)).start();
|
||||
mergeJob.setParentComp(targetJob.getParentComp());
|
||||
mergeJob.setParentDept(targetJob.getParentDept());
|
||||
mergeJob.setParentJob(targetJob.getId());
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, mergeJob).sync();
|
||||
|
||||
updateCount = getJobMapper().updateBaseJob(mergeJob);
|
||||
//TODO 合并该刚岗位下的人员
|
||||
|
||||
// 合并后岗位及子岗位禁用
|
||||
|
|
@ -629,8 +647,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
job.setParentDept(parentDept);
|
||||
job.setParentJob(parentJob);
|
||||
job.setForbiddenTag(1);
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, job).sync();
|
||||
getJobMapper().updateBaseJob(job);
|
||||
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, job)).start();
|
||||
List<JobPO> childJobs = getJobMapper().getJobsByPid(job.getId());
|
||||
forbiddenChildTag(parentComp, parentDept, job.getId(), childJobs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,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) {
|
||||
rs.executeQuery("select id, fname, ftype, fparentid, fnumber from jcl_org_map " + whereSql + " and fparentid = " + id);
|
||||
rs.executeQuery("select id, fname, ftype, fparentid,fobjid,fecid,fnumber from jcl_org_map " + whereSql + " and fparentid = " + id);
|
||||
List<Map<String, Object>> currentList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
|
|
@ -153,6 +153,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
item.put("ftype", rs.getString("ftype"));
|
||||
item.put("parentId", rs.getString("fparentid"));
|
||||
item.put("fnumber", rs.getString("fnumber"));
|
||||
item.put("fobjid", rs.getString("fobjid"));
|
||||
item.put("fecid", rs.getString("fecid"));
|
||||
item.put("expand", expand ? "1" : "0");
|
||||
item.put("hasChildren", hasChildren(rs.getString("id"), true));
|
||||
currentList.add(item);
|
||||
|
|
@ -203,7 +205,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
@Override
|
||||
public Map<String, Object> getUserData(Map<String, Object> request2Map, User user) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, USER_RIGHT, true);
|
||||
boolean hasRight = HasRightUtil.hasRight(user, USER_RIGHT, true);
|
||||
result.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return result;
|
||||
|
|
@ -244,6 +246,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
item.put("expand", "1");
|
||||
item.put("fnumber", rs.getString("fnumber"));
|
||||
item.put("fleader", rs.getString("fleader"));
|
||||
item.put("fobjid",rs.getString("fobjid"));
|
||||
list.add(item);
|
||||
}
|
||||
|
||||
|
|
@ -337,7 +340,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) {
|
||||
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,t.fobjid,fecid from jcl_org_map t " + whereSql + " and t.fparentid = " + id);
|
||||
List<Map<String, Object>> currentList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
|
|
@ -352,6 +355,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
item.put("fonjob", rs.getString("fonjob"));
|
||||
item.put("fnumber", rs.getString("fnumber"));
|
||||
item.put("expand", expand ? "1" : "0");
|
||||
item.put("fobjid", rs.getString("fobjid"));
|
||||
item.put("fecid", rs.getString("fecid"));
|
||||
item.put("hasChildren", hasChildren(rs.getString("id"), false));
|
||||
currentList.add(item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,240 @@
|
|||
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.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.TreeData;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import com.engine.organization.entity.hrmresource.vo.ResourceBasicInfoVO;
|
||||
import com.engine.organization.mapper.hrmresource.ResourceBasicInfoMapper;
|
||||
import com.engine.organization.service.ResourceBasicInfoService;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/23
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ResourceBasicInfoServiceImpl extends Service implements ResourceBasicInfoService {
|
||||
|
||||
private static final String RIGHT_NAME = "ResourceBasicInfo:All";
|
||||
|
||||
private ResourceBasicInfoMapper getResourceBasicInfoMapper() {
|
||||
return MapperProxyFactory.getProxy(ResourceBasicInfoMapper.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
resultMap.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return resultMap;
|
||||
}
|
||||
OrganizationWeaTable<ResourceBasicInfoVO> table = new OrganizationWeaTable<>(user, ResourceBasicInfoVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypeTreeVO> getTreeData() {
|
||||
ArrayList<TreeData> treeDataList = getResourceBasicInfoMapper().getTreeData();
|
||||
TypeTreeVO build = TypeTreeVO.builder()
|
||||
.childs(treeDataList.stream().map(e ->
|
||||
TypeTreeVO.builder()
|
||||
.domid(e.getKey())
|
||||
.key(Long.parseLong(e.getKey()))
|
||||
.name(e.getTitle())
|
||||
.build()).collect(Collectors.toList()))
|
||||
.haschild(true)
|
||||
.domid("-1")
|
||||
.key(-1L)
|
||||
.name("全部类型").build();
|
||||
List<TypeTreeVO> typeTreeVOS = new ArrayList<>();
|
||||
typeTreeVOS.add(build);
|
||||
return typeTreeVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SearchConditionGroup> getForm(Map<String, Object> params) {
|
||||
|
||||
String id = Util.null2String(params.get("fid"));
|
||||
String fClassId = Util.null2String(params.get("fclassid"));
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
SearchConditionItem resourceTypeItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "类型", "161", "fclassid", "resourceTypeBrowser");
|
||||
resourceTypeItem.setRules("required|string");
|
||||
if (StringUtils.isNotBlank(fClassId) && !"-1".equals(fClassId)) {
|
||||
BrowserBean browserBean = resourceTypeItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> maps = getResourceBasicInfoMapper().browserDatas(DeleteParam.builder().ids(fClassId).build().getIds());
|
||||
browserBean.setReplaceDatas(maps);
|
||||
resourceTypeItem.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
|
||||
SearchConditionItem fNo = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "fno");
|
||||
fNo.setRules("required|string");
|
||||
SearchConditionItem fName = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "fname");
|
||||
fName.setRules("required|string");
|
||||
SearchConditionItem fMemo = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "说明", "fmemo");
|
||||
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
ResourceItemPO resourceItemPO = getResourceBasicInfoMapper().getResourceItemByFid(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(resourceItemPO, "选择的数据不存在");
|
||||
BrowserBean browserBean = resourceTypeItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> maps = getResourceBasicInfoMapper().browserDatas(DeleteParam.builder().ids(resourceItemPO.getFclassid().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(maps);
|
||||
resourceTypeItem.setBrowserConditionParam(browserBean);
|
||||
|
||||
fNo.setValue(resourceItemPO.getFno());
|
||||
fNo.setViewAttr(1);
|
||||
fName.setValue(resourceItemPO.getFname());
|
||||
fMemo.setValue(resourceItemPO.getFmemo());
|
||||
}
|
||||
|
||||
selectItems.add(resourceTypeItem);
|
||||
selectItems.add(fNo);
|
||||
selectItems.add(fName);
|
||||
selectItems.add(fMemo);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
return addGroups;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
return getResourceBasicInfoMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recoverByIds(Collection<Long> ids) {
|
||||
OrganizationAssert.notEmpty(ids, "请选择要恢复的数据");
|
||||
return getResourceBasicInfoMapper().recoverByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(ResourceItemPO resourceItemPO) {
|
||||
List<ResourceItemPO> list = getResourceBasicInfoMapper().selectItemByFNo(resourceItemPO.getFno(), resourceItemPO.getFclassid());
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
return getResourceBasicInfoMapper().insertIgnoreNull(resourceItemPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceItemPO selectById(Integer fid) {
|
||||
return getResourceBasicInfoMapper().getResourceItemByFid(fid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(ResourceItemPO resourceItemPO) {
|
||||
return getResourceBasicInfoMapper().update(resourceItemPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SearchConditionGroup> getItemClassForm(Map<String, Object> params) {
|
||||
String id = Util.null2String(params.get("fid"));
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
SearchConditionItem fNo = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "fno");
|
||||
fNo.setRules("required|string");
|
||||
SearchConditionItem fName = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "fname");
|
||||
fName.setRules("required|string");
|
||||
SearchConditionItem fMemo = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "说明", "fmemo");
|
||||
|
||||
if (!"-1".equals(id) && StringUtils.isNotBlank(id)) {
|
||||
ResourceItemClassPO resourceItemClassPO = getResourceBasicInfoMapper().getResourceItemClassByFid(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(resourceItemClassPO, "选择的数据不存在");
|
||||
fNo.setValue(resourceItemClassPO.getFno());
|
||||
fNo.setViewAttr(1);
|
||||
fName.setValue(resourceItemClassPO.getFname());
|
||||
fMemo.setValue(resourceItemClassPO.getFmemo());
|
||||
}
|
||||
selectItems.add(fNo);
|
||||
selectItems.add(fName);
|
||||
selectItems.add(fMemo);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
return addGroups;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveResourceItemClass(ResourceItemClassPO itemClassPO) {
|
||||
List<ResourceItemClassPO> list = getResourceBasicInfoMapper().selectItemClassByFNo(itemClassPO.getFno(), null);
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
itemClassPO.setCreator((long) user.getUID());
|
||||
itemClassPO.setCreateTime(new Date());
|
||||
return getResourceBasicInfoMapper().saveResourceItemClass(itemClassPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateResourceItemClass(ResourceItemClassPO itemClassPO) {
|
||||
itemClassPO.setUpdateTime(new Date());
|
||||
return getResourceBasicInfoMapper().updateResourceItemClass(itemClassPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteResourceItemClass(Integer fid) {
|
||||
OrganizationAssert.notNull(fid, "选择的数据不存在");
|
||||
// 判断该分类下是否有数据
|
||||
List<ResourceItemPO> itemByClassId = getResourceBasicInfoMapper().getItemByClassId(fid, 0);
|
||||
OrganizationAssert.isTrue(CollectionUtils.isEmpty(itemByClassId), "当前分类下存在数据,无法删除");
|
||||
List<ResourceItemPO> deleteItems = getResourceBasicInfoMapper().getItemByClassId(fid, 1);
|
||||
// 级联删除已停用数据
|
||||
if (CollectionUtils.isNotEmpty(deleteItems)) {
|
||||
getResourceBasicInfoMapper().deleteItemByIds((deleteItems.stream().map(ResourceItemPO::getFid).collect(Collectors.toList())));
|
||||
}
|
||||
return getResourceBasicInfoMapper().deleteResourceItemClass(fid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SearchConditionGroup> getSearchCondition() {
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
SearchConditionItem schemeNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "fname");
|
||||
SearchConditionItem schemeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "fno");
|
||||
conditionItems.add(schemeNameCondition);
|
||||
conditionItems.add(schemeNoCondition);
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
return addGroups;
|
||||
}
|
||||
|
||||
private String buildSqlWhere(Map<String, Object> params) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where 1 = 1 ";
|
||||
String fclassid = (String) params.get("fclassid");
|
||||
if (StringUtils.isNotBlank(fclassid) && !"-1".equals(fclassid)) {
|
||||
sqlWhere += " AND t.fclassid = '" + fclassid + "'";
|
||||
}
|
||||
String fno = (String) params.get("fno");
|
||||
if (StringUtils.isNotBlank(fno)) {
|
||||
sqlWhere += " AND t.fno = '" + fno + "'";
|
||||
}
|
||||
String fname = (String) params.get("fname");
|
||||
if (StringUtils.isNotBlank(fname)) {
|
||||
sqlWhere += " AND t.fname " + dbType.like(fname);
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
}
|
||||
|
|
@ -178,7 +178,8 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
*/
|
||||
private String buildSqlWhere(Map<String, Object> params) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where delete_type ='0' ";
|
||||
//String sqlWhere = " where delete_type ='0' ";
|
||||
String sqlWhere = " where 1 = 1 ";
|
||||
String name = (String) params.get("schemeName");
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sqlWhere += " AND scheme_name " + dbType.like(name);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,13 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(param.getPlanNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
// 结束时间大于开始时间
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
|
||||
String timeStart = param.getTimeStart();
|
||||
String timeEnd = param.getTimeEnd();
|
||||
Date startDate = DateUtil.parseToDate(timeStart);
|
||||
Date endDate = DateUtil.parseToDate(timeEnd);
|
||||
OrganizationAssert.isFalse(startDate.after(endDate), "开始时间不允许在结束时间之后");
|
||||
return getStaffPlanMapper().insertIgnoreNull(staffPlanPO);
|
||||
}
|
||||
|
||||
|
|
@ -84,6 +90,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(staffPlanPO.getPlanNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
}
|
||||
// 结束时间大于开始时间
|
||||
String timeStart = param.getTimeStart();
|
||||
String timeEnd = param.getTimeEnd();
|
||||
Date startDate = DateUtil.parseToDate(timeStart);
|
||||
Date endDate = DateUtil.parseToDate(timeEnd);
|
||||
OrganizationAssert.isFalse(startDate.after(endDate), "开始时间不允许在结束时间之后");
|
||||
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
|
||||
}
|
||||
|
||||
|
|
@ -178,6 +190,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
// 控制维度
|
||||
SearchConditionItem dimensionItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, true, "控制维度", "controlDimension");
|
||||
dimensionItem.setViewAttr(3);
|
||||
dimensionItem.setRules("required|string");
|
||||
// 说明
|
||||
SearchConditionItem descriptionItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "说明", "description");
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,14 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.hrm.service.impl.HrmJobServiceImpl;
|
||||
import com.engine.hrm.service.impl.OrganizationServiceImpl;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
|
|
@ -313,17 +317,33 @@ public class OrganizationRunable implements Runnable {
|
|||
String forbiddenTag = Util.null2String(params.get("forbiddenTag"));
|
||||
List<String> idList = new ArrayList<>();
|
||||
String[] split = departmentIds.split(",");
|
||||
for (String s : split) {
|
||||
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
||||
if (StringUtils.isBlank(forbiddenTag)) {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
for (String s : split) {
|
||||
DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(Long.parseLong(s));
|
||||
params.put("dept_name_short", departmentPO.getDeptNameShort() + currentTimeMillis);
|
||||
params.put("dept_name", departmentPO.getDeptName() + currentTimeMillis);
|
||||
params.put("parent_comp", departmentPO.getParentComp());
|
||||
params.put("parent_dept", departmentPO.getParentDept());
|
||||
params.put("show_order", departmentPO.getShowOrder());
|
||||
params.put("dept_no", departmentPO.getDeptNo());
|
||||
params.put("dept_principal", departmentPO.getDeptPrincipal());
|
||||
updateDepartment();
|
||||
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
||||
}
|
||||
} else {
|
||||
for (String s : split) {
|
||||
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", StringUtils.join(idList, ","));
|
||||
if (StringUtils.isBlank(forbiddenTag) || "1".equals(forbiddenTag)) {
|
||||
// 封存
|
||||
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentCancel(map, user);
|
||||
} else {
|
||||
if ("0".equals(forbiddenTag)) {
|
||||
// 解封
|
||||
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentISCanceled(map, user);
|
||||
} else {
|
||||
// 封存
|
||||
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentCancel(map, user);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -407,17 +427,33 @@ public class OrganizationRunable implements Runnable {
|
|||
String forbiddenTag = Util.null2String(params.get("forbiddenTag"));
|
||||
List<String> idList = new ArrayList<>();
|
||||
String[] split = companyIds.split(",");
|
||||
for (String s : split) {
|
||||
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
|
||||
if (StringUtils.isBlank(forbiddenTag)) {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
for (String s : split) {
|
||||
// 更新名称为:名称+时间戳
|
||||
CompPO comp = MapperProxyFactory.getProxy(CompMapper.class).listById(Long.parseLong(s));
|
||||
params.put("parent_company", comp.getParentCompany());
|
||||
params.put("comp_no", comp.getCompNo());
|
||||
params.put("comp_name", comp.getCompName() + currentTimeMillis);
|
||||
params.put("comp_name_short", comp.getCompNameShort() + currentTimeMillis);
|
||||
params.put("show_order", comp.getShowOrder());
|
||||
updateCompany();
|
||||
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
|
||||
}
|
||||
} else {
|
||||
for (String s : split) {
|
||||
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", StringUtils.join(idList, ","));
|
||||
if (StringUtils.isBlank(forbiddenTag) || "1".equals(forbiddenTag)) {
|
||||
// 封存
|
||||
ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyCancel(map, user);
|
||||
} else {
|
||||
|
||||
if ("0".equals(forbiddenTag)) {
|
||||
// 解封
|
||||
ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyISCanceled(map, user);
|
||||
} else {
|
||||
// 删除封存、禁用封存
|
||||
ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyCancel(map, user);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,458 @@
|
|||
package com.engine.organization.thread;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.hrm.service.impl.HrmJobServiceImpl;
|
||||
import com.engine.hrm.service.impl.OrganizationServiceImpl;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/08/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class OrganizationSyncEc {
|
||||
private LogModuleNameEnum moduleName;
|
||||
private OperateTypeEnum operateType;
|
||||
private Map<String, Object> params;
|
||||
private User user;
|
||||
private JobPO oldJobPO;
|
||||
Map<String, Object> resultMap;
|
||||
private boolean throwException = true;
|
||||
|
||||
private SystemDataMapper getSystemDataMapper() {
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
public OrganizationSyncEc(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params) {
|
||||
this.moduleName = moduleName;
|
||||
this.operateType = operateType;
|
||||
this.params = params;
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public OrganizationSyncEc(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params, boolean throwException) {
|
||||
this.moduleName = moduleName;
|
||||
this.operateType = operateType;
|
||||
this.params = params;
|
||||
this.user = user;
|
||||
this.throwException = throwException;
|
||||
}
|
||||
|
||||
public OrganizationSyncEc(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params, JobPO oldJobPO) {
|
||||
this.moduleName = moduleName;
|
||||
this.operateType = operateType;
|
||||
this.params = params;
|
||||
this.user = user;
|
||||
this.oldJobPO = oldJobPO;
|
||||
}
|
||||
|
||||
public Map<String, Object> sync() {
|
||||
switch (moduleName) {
|
||||
case COMPANY:
|
||||
refreshCompany();
|
||||
break;
|
||||
case DEPARTMENT:
|
||||
refreshDepartment();
|
||||
break;
|
||||
case JOB:
|
||||
refreshJob();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (throwException) {
|
||||
OrganizationAssert.isTrue("1".equals(Util.null2String(resultMap.get("status"))) || "1".equals(Util.null2String(resultMap.get("sign"))), Util.null2String(resultMap.get("message")));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新HrmSubCompany表数据
|
||||
*/
|
||||
private void refreshCompany() {
|
||||
switch (operateType) {
|
||||
case ADD:
|
||||
addCompany();
|
||||
break;
|
||||
case UPDATE:
|
||||
updateCompany();
|
||||
break;
|
||||
case CANCELED:
|
||||
cancelCompany();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新HrmDepartment表数据
|
||||
*/
|
||||
private void refreshDepartment() {
|
||||
switch (operateType) {
|
||||
case ADD:
|
||||
addDepartment();
|
||||
break;
|
||||
case UPDATE:
|
||||
updateDepartment();
|
||||
break;
|
||||
case CANCELED:
|
||||
cancelDepartment();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshJob() {
|
||||
switch (operateType) {
|
||||
case ADD:
|
||||
addJob();
|
||||
break;
|
||||
case UPDATE:
|
||||
updateJob();
|
||||
break;
|
||||
case CANCELED:
|
||||
cancelJob();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增岗位
|
||||
*
|
||||
* <p>
|
||||
* 1、EC表HrmJobTitles
|
||||
* <p>
|
||||
* 2、系统中新建“聚才林”、“默认职务”(sql写入)
|
||||
* <p>
|
||||
* 3、检索岗位名称jobtitlename,如果已存在,判断是否封存,对已封存数据解封操作
|
||||
* <p>
|
||||
* 4、如果不存在,在“聚才林--默认职务”下新建岗位
|
||||
*/
|
||||
private void addJob() {
|
||||
// 判断是否存在同名岗位、存在不做处理,不存在,在“默认职务分类--默认职务”下新建岗位
|
||||
String jobName = Util.null2String(params.get("job_name"));
|
||||
RecordInfo hrmJobActivity = getSystemDataMapper().getHrmJobTitleByName(jobName);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//存在且已封存,对岗位解封
|
||||
if (null != hrmJobActivity) {
|
||||
map.put("ids", hrmJobActivity.getId());
|
||||
map.put("canceled", "docanceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
} else {
|
||||
// 不存在则新建职务
|
||||
map.put("operateIp", Util.null2String(user.getLoginip()));
|
||||
map.put("jobtitlemark", jobName);
|
||||
map.put("jobtitlename", jobName);
|
||||
map.put("jobactivityid", Util.null2String(params.get("jobactivityid")));
|
||||
map.put("jobresponsibility", Util.null2String(params.get("work_duty")));
|
||||
map.put("jobcompetency", Util.null2String(params.get("work_authority")));
|
||||
map.put("jobtitleremark", Util.null2String(params.get("description")));
|
||||
map.put("jobtitlecode", Util.null2String(params.get("job_no")));
|
||||
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).addJobTitle(map, user);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新岗位
|
||||
*/
|
||||
private void updateJob() {
|
||||
Long jclJobId = oldJobPO.getId();
|
||||
String oldName = oldJobPO.getJobName();
|
||||
|
||||
String newName = Util.null2String(params.get("job_name"));
|
||||
RecordInfo oldHrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(oldName);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 修改前不存在共用
|
||||
if (EcHrmRelationUtil.isNotExistJob(oldName, jclJobId)) {
|
||||
// 修改后不存在共用、直接修改EC岗位表数据
|
||||
if (EcHrmRelationUtil.isNotExistJob(newName, jclJobId)) {
|
||||
// 查询ec表ID
|
||||
RecordInfo hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(oldName);
|
||||
map.put("id", Util.null2String(hrmJobTitle.getId()));
|
||||
map.put("operateIp", Util.null2String(user.getLoginip()));
|
||||
map.put("jobtitlemark", newName);
|
||||
map.put("jobtitlename", newName);
|
||||
map.put("jobactivityid", Util.null2String(params.get("jobactivityid")));
|
||||
map.put("jobresponsibility", Util.null2String(params.get("work_duty")));
|
||||
map.put("jobcompetency", Util.null2String(params.get("work_authority")));
|
||||
map.put("jobtitleremark", Util.null2String(params.get("description")));
|
||||
map.put("jobtitlecode", Util.null2String(params.get("job_no")));
|
||||
// 修改岗位表数据
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).editJobTitle(map, user);
|
||||
} else {
|
||||
// 修改后存在共用、不修改岗位表数据,更新对应人员的岗位信息为当前岗位的ID
|
||||
RecordInfo hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
// 查询原分部、原岗位下的人员,并更新岗位ID
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getId());
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.getId()), hrmResourceIds);
|
||||
// 封存原名称岗位
|
||||
map.put("ids", oldHrmJobTitle.getId());
|
||||
map.put("canceled", "canceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
}
|
||||
} else {
|
||||
// 修改前存在共用,不对原有数据进行操作。
|
||||
|
||||
// 修改后不存在共用、新建岗位,更新原有岗位下人员的岗位ID
|
||||
if (EcHrmRelationUtil.isNotExistJob(newName, jclJobId)) {
|
||||
// 不存在则新建职务
|
||||
map.put("operateIp", Util.null2String(user.getLoginip()));
|
||||
map.put("jobtitlemark", newName);
|
||||
map.put("jobtitlename", newName);
|
||||
map.put("jobactivityid", Util.null2String(params.get("jobactivityid")));
|
||||
map.put("jobresponsibility", Util.null2String(params.get("work_duty")));
|
||||
map.put("jobcompetency", Util.null2String(params.get("work_authority")));
|
||||
map.put("jobtitleremark", Util.null2String(params.get("description")));
|
||||
map.put("jobtitlecode", Util.null2String(params.get("job_no")));
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).addJobTitle(map, user);
|
||||
} else {
|
||||
this.resultMap = new HashMap<>();
|
||||
this.resultMap.put("sign", "1");
|
||||
}
|
||||
// 查询原分部、原岗位下的人员,并更新岗位ID
|
||||
RecordInfo hrmJobTitle = getSystemDataMapper().getHrmJobTitleByName(newName);
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getId());
|
||||
if (CollectionUtils.isNotEmpty(hrmResourceIds)) {
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.getId()), hrmResourceIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 封存、解封岗位
|
||||
*/
|
||||
private void cancelJob() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
RecordInfo hrmJobTitleByName = getSystemDataMapper().getHrmJobTitleByName(oldJobPO.getJobName());
|
||||
if (0 == oldJobPO.getForbiddenTag()) {
|
||||
// 启用
|
||||
map.put("ids", hrmJobTitleByName.getId());
|
||||
map.put("canceled", "docanceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
} else {
|
||||
// 禁用
|
||||
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listByNameExceptId(oldJobPO.getJobName(), oldJobPO.getId());
|
||||
// 不存在共用
|
||||
if (CollectionUtils.isEmpty(jobPOS)) {
|
||||
map.put("ids", hrmJobTitleByName.getId());
|
||||
map.put("canceled", "canceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
} else {
|
||||
List<JobPO> collect = jobPOS.stream().filter(item -> 0 == item.getForbiddenTag()).collect(Collectors.toList());
|
||||
// 不存在非禁用
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
map.put("ids", hrmJobTitleByName.getId());
|
||||
map.put("canceled", "canceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门
|
||||
*/
|
||||
private void addDepartment() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("departmentmark", Util.null2String(params.get("dept_name_short")));
|
||||
map.put("departmentname", Util.null2String(params.get("dept_name")));
|
||||
|
||||
// 上级分部通过UUID联查ec表ID
|
||||
String parentCompany = Util.null2String(params.get("parent_comp"));
|
||||
if (StringUtils.isNotBlank(parentCompany)) {
|
||||
map.put("subcompanyid1", EcHrmRelationUtil.getEcCompanyId(parentCompany));
|
||||
}
|
||||
|
||||
// 上级部门通过UUID联查ec表ID
|
||||
String parentDepartment = Util.null2String(params.get("parent_dept"));
|
||||
if (StringUtils.isNotBlank(parentDepartment)) {
|
||||
map.put("supdepid", EcHrmRelationUtil.getEcDepartmentId(parentDepartment));
|
||||
}
|
||||
|
||||
map.put("showorder", Util.null2String(params.get("show_order")));
|
||||
map.put("departmentcode", Util.null2String(params.get("dept_no")));
|
||||
map.put("coadjutant", Util.null2String(params.get("dept_principal")));
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).addDepartment(map, user);
|
||||
// 更新jcl_org_dept表 uuid字段
|
||||
//if ("1".equals(Util.null2String(resultMap.get("status"))) && null != resultMap.get("id")) {
|
||||
// updateJclUUID(Util.null2String(resultMap.get("id")), HRM_DEPARTMENT, JCL_DEPARTMENT);
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
* 封存、解封部门
|
||||
*/
|
||||
private void cancelDepartment() {
|
||||
String departmentIds = Util.null2String(params.get("id"));
|
||||
String forbiddenTag = Util.null2String(params.get("forbiddenTag"));
|
||||
List<String> idList = new ArrayList<>();
|
||||
String[] split = departmentIds.split(",");
|
||||
if (StringUtils.isBlank(forbiddenTag)) {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
for (String s : split) {
|
||||
DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(Long.parseLong(s));
|
||||
params.put("dept_name_short", departmentPO.getDeptNameShort() + currentTimeMillis);
|
||||
params.put("dept_name", departmentPO.getDeptName() + currentTimeMillis);
|
||||
params.put("parent_comp", departmentPO.getParentComp());
|
||||
params.put("parent_dept", departmentPO.getParentDept());
|
||||
params.put("show_order", departmentPO.getShowOrder());
|
||||
params.put("dept_no", departmentPO.getDeptNo());
|
||||
params.put("dept_principal", departmentPO.getDeptPrincipal());
|
||||
updateDepartment();
|
||||
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
||||
}
|
||||
} else {
|
||||
for (String s : split) {
|
||||
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", StringUtils.join(idList, ","));
|
||||
if ("0".equals(forbiddenTag)) {
|
||||
// 解封
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentISCanceled(map, user);
|
||||
} else {
|
||||
// 封存
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentCancel(map, user);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新部门
|
||||
*/
|
||||
private void updateDepartment() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 获取ec表ID
|
||||
map.put("id", EcHrmRelationUtil.getEcDepartmentId(Util.null2String(params.get("id"))));
|
||||
map.put("departmentmark", Util.null2String(params.get("dept_name_short")));
|
||||
map.put("departmentname", Util.null2String(params.get("dept_name")));
|
||||
|
||||
// 上级分部通过UUID联查ec表ID
|
||||
String parentCompany = Util.null2String(params.get("parent_comp"));
|
||||
if (StringUtils.isNotBlank(parentCompany)) {
|
||||
map.put("subcompanyid1", EcHrmRelationUtil.getEcCompanyId(parentCompany));
|
||||
}
|
||||
|
||||
// 上级部门通过UUID联查ec表ID
|
||||
String parentDepartment = Util.null2String(params.get("parent_dept"));
|
||||
if (StringUtils.isNotBlank(parentDepartment)) {
|
||||
map.put("supdepid", EcHrmRelationUtil.getEcDepartmentId(parentDepartment));
|
||||
}
|
||||
|
||||
map.put("showorder", Util.null2String(params.get("show_order")));
|
||||
map.put("departmentcode", Util.null2String(params.get("dept_no")));
|
||||
map.put("coadjutant", Util.null2String(params.get("dept_principal")));
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).editDepartment(map, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分部
|
||||
*/
|
||||
private void addCompany() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
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));
|
||||
}
|
||||
|
||||
map.put("subcompanycode", params.get("comp_no").toString());
|
||||
map.put("subcompanydesc", params.get("comp_name").toString());
|
||||
map.put("showorder", Util.null2String(params.get("show_order")));
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).addSubCompany(map, user);
|
||||
//
|
||||
//// 更新jcl_org_comp表 uuid字段
|
||||
//if ("1".equals(Util.null2String(resultMap.get("status"))) && null != resultMap.get("id")) {
|
||||
// updateJclUUID(Util.null2String(resultMap.get("id")), HRM_COMPANY, JCL_COMPANY);
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新分部
|
||||
*/
|
||||
private void updateCompany() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 获取ec表ID
|
||||
map.put("id", EcHrmRelationUtil.getEcCompanyId(Util.null2String(params.get("id"))));
|
||||
|
||||
// 上级分部通过UUID联查ec表ID
|
||||
String parentCompany = Util.null2String(params.get("parent_company"));
|
||||
if (StringUtils.isNotBlank(parentCompany)) {
|
||||
map.put("supsubcomid", EcHrmRelationUtil.getEcCompanyId(parentCompany));
|
||||
}
|
||||
map.put("subcompanycode", Util.null2String(params.get("comp_no")));
|
||||
map.put("subcompanyname", Util.null2String(params.get("comp_name_short")));
|
||||
map.put("subcompanydesc", Util.null2String(params.get("comp_name")));
|
||||
map.put("showorder", Util.null2String(params.get("show_order")));
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).editSubCompany(map, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 封存、解封分部
|
||||
*/
|
||||
private void cancelCompany() {
|
||||
String companyIds = Util.null2String(params.get("id"));
|
||||
String forbiddenTag = Util.null2String(params.get("forbiddenTag"));
|
||||
List<String> idList = new ArrayList<>();
|
||||
String[] split = companyIds.split(",");
|
||||
if (StringUtils.isBlank(forbiddenTag)) {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
for (String s : split) {
|
||||
// 更新名称为:名称+时间戳
|
||||
CompPO comp = MapperProxyFactory.getProxy(CompMapper.class).listById(Long.parseLong(s));
|
||||
params.put("parent_company", comp.getParentCompany());
|
||||
params.put("comp_no", comp.getCompNo());
|
||||
params.put("comp_name", comp.getCompName() + currentTimeMillis);
|
||||
params.put("comp_name_short", comp.getCompNameShort() + currentTimeMillis);
|
||||
params.put("show_order", comp.getShowOrder());
|
||||
updateCompany();
|
||||
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
|
||||
}
|
||||
} else {
|
||||
for (String s : split) {
|
||||
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", StringUtils.join(idList, ","));
|
||||
|
||||
if ("0".equals(forbiddenTag)) {
|
||||
// 解封
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyISCanceled(map, user);
|
||||
} else {
|
||||
// 删除封存、禁用封存
|
||||
this.resultMap = ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyCancel(map, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -57,4 +57,12 @@ public class JobTransMethod {
|
|||
}
|
||||
}
|
||||
|
||||
public static String getSexName(String sexValue) {
|
||||
String sexName = "男";
|
||||
if ("1".equals(sexValue)) {
|
||||
sexName = "女";
|
||||
}
|
||||
return sexName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,4 +42,18 @@ public class ConfigTrans {
|
|||
return list;
|
||||
}
|
||||
|
||||
public static List<Object> formatResourceOperates(String id,String isDefault) {
|
||||
List list = Lists.newArrayList();
|
||||
if ("0".equals(isDefault)) {
|
||||
list.add(true);
|
||||
list.add(true);
|
||||
list.add(false);
|
||||
} else {
|
||||
list.add(false);
|
||||
list.add(false);
|
||||
list.add(true);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,199 @@
|
|||
package com.engine.organization.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.ResourceBasicInfoWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/23
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ResourceBasicInfoController {
|
||||
|
||||
private ResourceBasicInfoWrapper getResourceBasicInfoWrapper(User user) {
|
||||
return ServiceUtil.getService(ResourceBasicInfoWrapper.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getHasRight")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getHasRight());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getTable")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getResourceBasicInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getResourceBasicInfo(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getTreeData")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getTreeData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getTreeData());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getForm(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeleteParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).deleteByIds(param.getIds()));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/recover")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult recover(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeleteParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).recoverByIds(param.getIds()));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ResourceItemPO resourceItemPO) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).save(resourceItemPO));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ResourceItemPO resourceItemPO) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).update(resourceItemPO));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getItemClassForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getItemClassForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getItemClassForm(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/saveResourceItemClass")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveResourceItemClass(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ResourceItemClassPO resourceItemClassPO) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).saveResourceItemClass(resourceItemClassPO));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/updateResourceItemClass")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult updateResourceItemClass(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ResourceItemClassPO resourceItemClassPO) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).updateResourceItemClass(resourceItemClassPO));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/deleteResourceItemClass")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult deleteResourceItemClass(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Integer fid) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).deleteResourceItemClass(fid));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getSearchCondition")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getSearchCondition());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.annotation.Log;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import com.engine.organization.enums.DeleteTypeEnum;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.hrmresource.ResourceBasicInfoMapper;
|
||||
import com.engine.organization.service.ResourceBasicInfoService;
|
||||
import com.engine.organization.service.impl.ResourceBasicInfoServiceImpl;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/8/23
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ResourceBasicInfoWrapper extends OrganizationWrapper {
|
||||
|
||||
private ResourceBasicInfoService getResourceBasicInfoService(User user) {
|
||||
return ServiceUtil.getService(ResourceBasicInfoServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private ResourceBasicInfoMapper getResourceBasicInfoMapper() {
|
||||
return MapperProxyFactory.getProxy(ResourceBasicInfoMapper.class);
|
||||
}
|
||||
|
||||
public Map<String, Object> getResourceBasicInfo(Map<String, Object> params) {
|
||||
return getResourceBasicInfoService(user).listPage(params);
|
||||
}
|
||||
|
||||
public List<TypeTreeVO> getTreeData() {
|
||||
return getResourceBasicInfoService(user).getTreeData();
|
||||
}
|
||||
|
||||
|
||||
public List<SearchConditionGroup> getForm(Map<String, Object> params) {
|
||||
return getResourceBasicInfoService(user).getForm(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getHasRight() {
|
||||
Map<String, Object> btnDatas = new HashMap<>();
|
||||
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
||||
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||||
// 新增
|
||||
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("addItemClass").menuIcon("icon-coms-New-Flow").menuName("新增类型").type("BTN_AddItemClass").build());
|
||||
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("editItemClass").menuIcon("icon-coms-edit").menuName("修改类型").type("BTN_EditItemClass").build());
|
||||
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("delItemClass").menuIcon("icon-coms-Delete").menuName("删除类型").type("BTN_DelItemClass").build());
|
||||
topMenuList.add(MenuBtn.topMenu_addNew());
|
||||
// 批量删除
|
||||
topMenuList.add(MenuBtn.topMenu_batchDelete());
|
||||
btnDatas.put("topMenu", topMenuList);
|
||||
// 新增
|
||||
rightMenuList.add(MenuBtn.rightMenu_addNew());
|
||||
// 日志
|
||||
rightMenuList.add(MenuBtn.rightMenu_btnLog());
|
||||
// 显示列定制
|
||||
rightMenuList.add(MenuBtn.rightMenu_btnColumn());
|
||||
btnDatas.put("rightMenu", rightMenuList);
|
||||
return btnDatas;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.DELETE, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "删除人员信息资料")
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
List<ResourceItemPO> resourceItemPOS = getResourceBasicInfoMapper().selectItemByIds(ids);
|
||||
int result = getResourceBasicInfoService(user).deletByIds(ids);
|
||||
for (ResourceItemPO resourceItemPO : resourceItemPOS) {
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemPO.getFname(), JSON.toJSONString(ids), "删除人员信息资料");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Log(operateType = OperateTypeEnum.RECOVER, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "恢复人员信息资料")
|
||||
public int recoverByIds(Collection<Long> ids) {
|
||||
List<ResourceItemPO> resourceItemPOS = getResourceBasicInfoMapper().selectItemByIds(ids);
|
||||
int result = getResourceBasicInfoService(user).recoverByIds(ids);
|
||||
for (ResourceItemPO resourceItemPO : resourceItemPOS) {
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemPO.getFname(), JSON.toJSONString(ids), "恢复人员信息资料");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.ADD, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "新增人员信息资料")
|
||||
public int save(ResourceItemPO resourceItemPO) {
|
||||
resourceItemPO.setCreateTime(new Date());
|
||||
resourceItemPO.setCreator((long) user.getUID());
|
||||
resourceItemPO.setFdelete(DeleteTypeEnum.NOT_DELETED.getValue());
|
||||
int result = getResourceBasicInfoService(user).save(resourceItemPO);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemPO.getFname(), JSON.toJSONString(resourceItemPO), "新增人员信息资料");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "更新人员信息资料")
|
||||
public int update(ResourceItemPO resourceItemPO) {
|
||||
resourceItemPO.setUpdateTime(new Date());
|
||||
ResourceItemPO resourceItem = getResourceBasicInfoService(user).selectById(resourceItemPO.getFid());
|
||||
int result = getResourceBasicInfoService(user).update(resourceItemPO);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItem.getFname(), JSON.toJSONString(resourceItemPO), resourceItem,
|
||||
getResourceBasicInfoService(user).selectById(resourceItemPO.getFid()));
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<SearchConditionGroup> getItemClassForm(Map<String, Object> params) {
|
||||
return getResourceBasicInfoService(user).getItemClassForm(params);
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.ADD, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "新增人员信息分类")
|
||||
public int saveResourceItemClass(ResourceItemClassPO resourceItemClassPO) {
|
||||
int result = getResourceBasicInfoService(user).saveResourceItemClass(resourceItemClassPO);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemClassPO.getFname(), JSON.toJSONString(resourceItemClassPO), "新增人员信息分类");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "更新人员信息分类")
|
||||
public int updateResourceItemClass(ResourceItemClassPO resourceItemClassPO) {
|
||||
ResourceItemClassPO resourceItemClass = getResourceBasicInfoMapper().getResourceItemClassByFid(resourceItemClassPO.getFid());
|
||||
int result = getResourceBasicInfoService(user).updateResourceItemClass(resourceItemClassPO);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemClassPO.getFname(), JSON.toJSONString(resourceItemClassPO), resourceItemClass,
|
||||
getResourceBasicInfoMapper().getResourceItemClassByFid(resourceItemClassPO.getFid()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.DELETE, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "删除人员信息分类")
|
||||
public int deleteResourceItemClass(Integer fid) {
|
||||
ResourceItemClassPO resourceItemClass = getResourceBasicInfoMapper().getResourceItemClassByFid(fid);
|
||||
int result = getResourceBasicInfoService(user).deleteResourceItemClass(fid);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemClass.getFname(), JSON.toJSONString(fid), "删除人员信息分类");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<SearchConditionGroup> getSearchCondition() {
|
||||
return getResourceBasicInfoService(user).getSearchCondition();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue