Merge remote-tracking branch 'origin/develop' into feature/ml

# Conflicts:
#	src/com/engine/organization/service/impl/OrgChartServiceImpl.java
pull/39/head
‘ml’ 3 years ago
commit 1992c1375d

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"></setting>
<setting name="jdbcTypeForNull" value="NULL"/>
</settings>
<plugins>
<plugin interceptor="weaver.conn.mybatis.MyBatisCachePlugin"></plugin>
<plugin interceptor="com.github.pagehelper.PageInterceptor"></plugin>
</plugins>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="weaver.conn.mybatis.MyBatisDataSourceFactory">
</dataSource>
</environment>
</environments>
<databaseIdProvider type="weaver.conn.mybatis.DatabaseIdProvider">
</databaseIdProvider>
<mappers>
<!--mapper resource="MyBatis/mapper/WorkflowBaseMapper.xml"/-->
<!--package name="*.mapper"></package 不可行Mybatis不支持通配符这是spring的ant匹配模式提供的-->
<package name="weaver.conn.mybatis.mapper"></package><!-- 示例Mapper -->
<!-- 项目Mapper -->
<package name="com.weaver.mapper"></package>
<package name="weaver.general.mapper"></package>
<package name="weaver.hrm.mapper"></package>
<package name="weaver.workflow.mapper"></package>
<package name="weaver.interfaces.mapper"></package>
<package name="weaver.portal.mapper"></package>
<package name="com.api.formmode.mybatis.mapper"></package>
<package name="com.cloudstore.dev.api.mapper"></package>
<package name="com.engine.integration.mapper"></package>
<package name="com.engine.salary.mapper"></package>
<package name="com.engine.organization.mapper"></package>
<!-- 需要把现在的配置文件都调整到WEB-INF/config/mapper目录下 -->
<!-- 在WEB-INF/config/mapper目录下配置的xml文件也不必加入这里的package -->
</mappers>
</configuration>

Binary file not shown.

@ -0,0 +1,74 @@
hrmresource_online=hrmresource_online
sequenceindex=sequenceindex
system_default_col=system_default_col
worktask_requestbase=worktask_requestbase
indexupdatelog=indexupdatelog
uplogs=uplogs
dellogs=dellogs
ldapsetting=ldapsetting
ldapset=ldapset
workflowactionview=workflowactionview
picture=picture
slideElement=slideElement
hpOutDataTabSetting=hpOutDataTabSetting
hpoutdatasettingaddr=hpoutdatasettingaddr
wfex_view=wfex_view
hpOutDataSettingDef=hpOutDataSettingDef
hpOutDataSettingField=hpOutDataSettingField
view_workflowForm_selectAll=view_workflowForm_selectAll
QRCodeComInfo=QRCodeComInfo
emobileLoginKey=emobileLoginKey
rule_base=rule_base
rule_expressions=rule_expressions
rule_expressionbase=rule_expressionbase
rule_maplist=rule_maplist
uf_ShopCheckPlanbat=uf_ShopCheckPlanbat
uf_problemRegister=uf_problemRegister
uf_checkDataSave=uf_checkDataSave
uf_ShopCheckPlan=uf_ShopCheckPlan
uf_ShopCheckExam=uf_ShopCheckExam
uf_shopinfo=uf_shopinfo
uf_shopCheck=uf_shopCheck
uf_boroughinfo=uf_boroughinfo
View_ShopCheck=View_ShopCheck
user_tables=user_tables
sys.objects=sys.objects
USER_TAB_COLUMNS=USER_TAB_COLUMNS
syscolumns=syscolumns
blog_discuss=blog_discuss
kq_format_pool=kq_format_pool
kq_report_check=kq_report_check
license=license
ecologyuplist=ecologyuplist
kq_flow_split_leave=kq_flow_split_leave
kq_flow_split_evection=kq_flow_split_evection
kq_flow_split_out=kq_flow_split_out
kq_flow_split_overtime=kq_flow_split_overtime
kq_flow_split_other=kq_flow_split_other
kq_flow_split_leaveback=kq_flow_split_leaveback
KQ_ATT_VACATION=KQ_ATT_VACATION
kq_shiftschedule=kq_shiftschedule
kq_settings=kq_settings
dual=dual
user_tab_columns=user_tab_columns
syscolumns=syscolumns
Information_schema.columns=Information_schema.columns
ofs_todo_data=ofs_todo_data
SYSIBM.SYSTABLES=SYSIBM.SYSTABLES
Information_schema.columns=Information_schema.columns
ofs_todo_data=ofs_todo_data
information_schema.Tables=information_schema.Tables
sysobjects=sysobjects
hrmresourcemanager=hrmresourcemanager
QRTZ_TRIGGERS=QRTZ_TRIGGERS
fullsearch_schemaInfo=fullsearch_schemaInfo
Int_WhiteList=Int_WhiteList
Int_WhiteList_Mapping=Int_WhiteList_Mapping
#kq_format_detail
kq_format_detail=kq_format_detail
#hrmschedulesign
hrmschedulesign=hrmschedulesign
#聚才林
jcl_org_map=jcl_org_map
v_jcl_zdzj=v_jcl_zdzj
v_jcl_post=v_jcl_post

@ -0,0 +1,2 @@
defaultCloseNonStandard151=true
detach=true

@ -698,4 +698,20 @@ BEGIN;
INSERT INTO `JCL_INFO` (`id`, `fname`, `fvalue`) VALUES (1, '董事长人员i', '36');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE `jcl_org_detach` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`manager_type` int(11) NULL DEFAULT NULL,
`ec_manager` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`jcl_manager` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`ec_rolelevel` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`jcl_rolelevel` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`manage_module` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`creator` int(11) NULL DEFAULT NULL,
`delete_type` int(11) NULL DEFAULT NULL,
`create_time` date NULL DEFAULT NULL,
`update_time` date NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

@ -73,7 +73,7 @@ INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, d
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '名称', 'grade_name', '', 1, 2, SYS_GUID(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '描述方案', 'description', '', 0, 3, SYS_GUID(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '等级方案', 'scheme_id', 'select scheme_name from jcl_org_scheme where id={?currentvalue}', 0, 4, SYS_GUID(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '职等', 'level_id', 'select group_concat(level_name) from jcl_org_level where id in ( {?currentvalue})', 0, 5, SYS_GUID(), NULL);
INSERT INTO datashowparam (MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) VALUES(datashowset_id, '职等', 'level_id', 'select wm_concat(to_char(level_name)) from jcl_org_level where id in ( {?currentvalue})', 0, 5, SYS_GUID(), NULL);
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '编号', 'grade_no', '2', '', 1, SYS_GUID(), '');
INSERT INTO datasearchparam (MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) VALUES(datashowset_id, '名称', 'grade_name', '2', '', 2, SYS_GUID(), '');

@ -1215,4 +1215,6 @@ INSERT INTO jcl_field_extendinfo (id, extend_type, table_name, field_name, field
INSERT INTO jcl_field_extendinfo (id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(102, 2, 'JCL_ORG_DEPT', 'ec_company', '所属分部', 'int', 3, 2, 1, 1, 1, 1, 1, 1, 1, 4, 1, 0, SYSDATE, NULL, '164', '["browser",{"valueSpan":"分部","replaceDatas":[{"name":"分部","id":"164"}],"value":"164"}]', 0)
/
INSERT INTO jcl_field_extendinfo (id, extend_type, table_name, field_name, field_name_desc, field_type, control_type, extend_group_id, isenable, isrequired, list_show, search_show, edit_show, add_show, browser_show, show_order, creator, delete_type, create_time, update_time, browser_type, custom_value, is_system_default) VALUES(103, 2, 'JCL_ORG_DEPT', 'ec_department', '上级部门', 'int', 3, 2, 1, 0, 1, 1, 1, 1, 1, 5, 1, 0, SYSDATE, NULL, '4', '["browser",{"valueSpan":"部门","replaceDatas":[{"name":"部门","id":"4"}],"value":"4"}]', 0)
/
/
INSERT INTO JCL_INFO (id, fname, fvalue) VALUES (1, '董事长人员id', '36')

@ -1087,4 +1087,29 @@ GO
ALTER TABLE [dbo].[jcl_info] ADD CONSTRAINT [PK_jcl_info] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
GO
CREATE TABLE [dbo].[JCL_ORG_DETACH] (
[id] int IDENTITY(1,1) NOT NULL,
[manager_type] int NULL,
[ec_manager] int NOT NULL,
[jcl_manager] int NOT NULL,
[ec_rolelevel] varchar(4000) COLLATE Chinese_PRC_CI_AS NOT NULL,
[jcl_rolelevel] varchar(4000) COLLATE Chinese_PRC_CI_AS NOT NULL,
[manage_module] varchar(4000) COLLATE Chinese_PRC_CI_AS NOT NULL,
[creator] int NULL,
[delete_type] int NULL,
[create_time] date NULL,
[update_time] date NULL
)
GO
ALTER TABLE [dbo].[JCL_ORG_DETACH] SET (LOCK_ESCALATION = TABLE)
GO
ALTER TABLE [dbo].[JCL_ORG_DETACH] ADD CONSTRAINT [JCL_ORG_DETACH_PK] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO

@ -548,13 +548,32 @@ create table JCL_ORG_ITEM (
-- JCL_ORG_DETACH
create table JCL_ORG_DETACH (
id int auto_increment not null,
type int null,
manger text not null,
rolelevel text not null,
module text not null,
manager_type int null,
ec_manager int not null,
jcl_manager int not null,
ec_rolelevel text not null,
jcl_rolelevel text not null,
manage_module text not null,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
constraint JCL_ORG_DETACH_PK primary key (id)
);
-- JCL_ORG_CARDACCESS
create table JCL_ORG_CARDACCESS (
id int auto_increment not null,
type_id int not null,
type_name int not null,
status int null,
all_people int null,
superior int null,
all_superior int null,
custom text null ,
delete_type int null,
creator int null,
create_time date null,
update_time date null,
constraint JCL_ORG_CARDACCESS_PK primary key (id)
);

@ -490,10 +490,12 @@ CREATE TABLE JCL_ORG_HRMRELATION (
-- JCL_ORG_DETACH
create table JCL_ORG_DETACH (
id number not null,
type number null,
manger clob not null,
rolelevel clob not null,
module clob not null,
manager_type number null,
ec_manager NUMBER not null,
jcl_manager NUMBER not null,
ec_rolelevel varchar(4000) not null,
jcl_rolelevel varchar(4000) not null,
manage_module varchar(4000) not null,
creator number null,
delete_type number null,
create_time date null,
@ -502,3 +504,4 @@ create table JCL_ORG_DETACH (
);

@ -521,10 +521,12 @@ CREATE TABLE JCL_ORG_MAP (
-- JCL_ORG_DETACH
create table JCL_ORG_DETACH (
id int IDENTITY(1,1) not null,
type int null,
manger text not null,
rolelevel text not null,
module text not null,
manager_type int null,
ec_manager int not null,
jcl_manager int not null,
ec_rolelevel varchar(4000) not null,
jcl_rolelevel varchar(4000) not null,
manage_module varchar(4000) not null,
creator int null,
delete_type int null,
create_time date null,

@ -0,0 +1,13 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/1
* @Version V1.0
**/
@Path("/bs/hrmorganization/cardAccess")
public class CardAccessController extends com.engine.organization.web.CardAccessController {
}

@ -0,0 +1,13 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/21
* @Version V1.0
**/
@Path("/bs/hrmorganization/detach")
public class ManagerDetachController extends com.engine.organization.web.ManagerDetachController {
}

@ -33,8 +33,15 @@ public class SelectOptionParam {
int size = datas.size();
for (int i = 0; i < size; i++) {
JSONObject jsonObject = (JSONObject) datas.get(i);
SearchConditionOption option = new SearchConditionOption(StringUtils.isEmpty(jsonObject.getString("key")) ? i + "" : jsonObject.getString("key"), jsonObject.getString("option"));
selectOptions.add(option);
// 只显示未封存的数据
if (!"1".equals(jsonObject.getString("unuse"))) {
SearchConditionOption option = new SearchConditionOption(StringUtils.isEmpty(jsonObject.getString("key")) ? i + "" : jsonObject.getString("key"), jsonObject.getString("option"));
selectOptions.add(option);
// 设置默认数据
if ("1".equals(jsonObject.getString("default"))) {
option.setSelected(true);
}
}
}
}
return selectOptions;

@ -48,8 +48,10 @@ public class CompBO {
// 兼容MySQL
usedIds.addAll(MapperProxyFactory.getProxy(CompMapper.class).listUsedIds());
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
return dtoList.stream().peek(e -> {
Set<Long> leafs = new HashSet<>();
List<CompListDTO> collectTree = dtoList.stream().peek(e -> {
List<CompListDTO> childList = collects.get(e.getId());
leafs.add(e.getId());
if (CollectionUtils.isNotEmpty(childList)) {
e.setChildren(childList);
e.setIsUsed(1);
@ -60,7 +62,8 @@ public class CompBO {
e.setIsUsed(0);
}
}
}).filter(item -> null == item.getParentCompany() || 0 == item.getParentCompany()).collect(Collectors.toList());
}).collect(Collectors.toList());
return collectTree.stream().filter(item->!leafs.contains(item.getParentCompany())).collect(Collectors.toList());
}
public static List<CompListDTO> buildCompDTOList(Collection<CompPO> list, List<CompPO> filterList) {

@ -0,0 +1,34 @@
package com.engine.organization.entity.detach.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/25
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ManagerDetachParam {
private Integer id;
private Integer managerType;
private Integer ecManager;
private Integer jclManager;
private String ecRolelevel;
private String jclRolelevel;
private String manageModule;
}

@ -0,0 +1,66 @@
package com.engine.organization.entity.detach.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/21
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ManagerDetachPO {
/**
*
*/
private Integer id;
/**
*
*/
private Integer managerType;
/**
* ec
*/
private Integer ecManager;
/**
* jcl
*/
private Integer jclManager;
/**
* ec
*/
private String ecRolelevel;
/**
* jcl
*/
private String jclRolelevel;
/**
*
*/
private String manageModule;
/**
*
*/
private Long creator;
/**
*
*/
private int deleteType;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
}

@ -0,0 +1,59 @@
package com.engine.organization.entity.detach.vo;
import com.cloudstore.eccom.pc.table.WeaTableType;
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/10/21
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "0bf9b7bc-c8b0-4225-bf28-4cd015d96e98",
fields = "t.id," +
"t.ec_manager," +
"t.ec_rolelevel," +
"t.manage_module," +
"t.creator," +
"t.delete_type," +
"t.create_time," +
"t.update_time",
fromSql = "FROM jcl_org_detach t ",
orderby = "id",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "编辑"),
@OrganizationTableOperate(index = "1", text = "删除")
},
tableType = WeaTableType.CHECKBOX
)
public class ManagerDetachVO {
@OrganizationTableColumn(column = "id", display = false)
private Long id;
@OrganizationTableColumn(text = "管理员", width = "20%", column = "ec_manager", transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getManagerName")
private Integer ecManager;
@OrganizationTableColumn(text = "可管理组织机构", width = "40%", column = "ec_rolelevel",transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getRoleLevel")
private String ecRolelevel;
@OrganizationTableColumn(text = "可管理模块", width = "40%", column = "manage_module")
private String manageModule;
}

@ -41,6 +41,31 @@ public class ExtendInfoParams {
private String sequenceName;
public String getSequenceName() {
return this.tableName + "_ID";
// 处理ORACLE表名过长未与序列对应情况
String sequenceName;
switch (this.tableName) {
case "JCL_ORG_HRMRESOURCE":
sequenceName = "JCL_ORG_HRM_ID";
break;
case "JCL_ORG_HRMRESOURCEEXT_DT1":
sequenceName = "JCL_ORG_HRMEXT_DT1_ID";
break;
case "JCL_FIELD_EXTENDGROUP":
sequenceName = "JCL_FIELD_GROUP_ID";
break;
case "JCL_FIELD_EXTENDTITLE":
sequenceName = "JCL_FIELD_TITLE_ID";
break;
case "JCL_FIELD_EXTENDINFO":
sequenceName = "JCL_FIELD_INFO_ID";
break;
case "JCL_IMPORT_HISTORY_DETAIL":
sequenceName = "JCL_IMPORT_DETAIL_ID";
break;
default:
sequenceName = this.tableName + "_ID";
break;
}
return sequenceName;
}
}

@ -140,9 +140,9 @@ public class HrmResourcePO {
private String jobGrade;
private Integer schemeId;
private String schemeId;
private Integer sequenceId;
private String sequenceId;
private String baseFieldsValue;

@ -89,8 +89,8 @@ public class JobBO {
.deptName(e.getDeptName())
.sequenceName(e.getSequenceName())
.schemeName(e.getSchemeName())
.parentJob(e.getParentJob())
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
//.parentJob(e.getParentJob())
//.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
.isKey(JobTransMethod.getIsKeySpan(e.getIsKey()))
.showOrder(e.getShowOrder())
.forbiddenTag(e.getForbiddenTag())

@ -64,9 +64,11 @@ public class JobListDTO {
/**
*
*/
@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName")
// 上级岗位,暂不使用
//@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName")
private String parentJobName;
private Long parentJob;
private Long parentComp;
/**
*
*/

@ -0,0 +1,46 @@
package com.engine.organization.entity.personnelcard.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/1
* @Version V1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CardAccessPO {
private Integer id;
private Integer typeId;
private Integer typeName;
private Integer status;
private Integer allPeople;
private Integer superior;
private String allSuperior;
private String custom;
private Long creator;
private int deleteType;
private Date createTime;
private Date updateTime;
}

@ -0,0 +1,21 @@
package com.engine.organization.entity.personnelcard.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/1
* @Version V1.0
**/
public class CardAccessVO {
}

@ -37,19 +37,19 @@ public class SchemePO {
*/
private int isUsed;
/**
*
*
*/
private Long creator;
/**
*
*
*/
private int deleteType;
/**
*
*
*/
private Date createTime;
/**
*
*
*/
private Date updateTime;

@ -3,6 +3,8 @@ package com.engine.organization.entity.searchtree;
import com.api.hrm.bean.TreeNode;
import lombok.Data;
import java.util.Objects;
/**
* @description:
* @author:dxfeng
@ -19,4 +21,17 @@ public class SearchTree extends TreeNode {
private String requestParams;
private String parentComp;
private Integer orderNum;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SearchTree that = (SearchTree) o;
return isCanceled == that.isCanceled && Objects.equals(this.getId(), that.getId()) &&Objects.equals(companyid, that.companyid) && Objects.equals(isVirtual, that.isVirtual) && Objects.equals(psubcompanyid, that.psubcompanyid) && Objects.equals(displayType, that.displayType) && Objects.equals(requestParams, that.requestParams) && Objects.equals(parentComp, that.parentComp) && Objects.equals(orderNum, that.orderNum);
}
@Override
public int hashCode() {
return Objects.hash(this.getId(),companyid, isVirtual, psubcompanyid, displayType, isCanceled, requestParams, parentComp, orderNum);
}
}

@ -18,6 +18,7 @@ public enum LogModuleNameEnum {
RESOURCE("人员管理", 11),
STAFFPLAN("编制方案", 12),
STAFF("编制上报", 13),
DETACH("模块管理分权", 14),
OTHER("其他模块", 99);
private String name;

@ -77,7 +77,7 @@ public interface CompMapper {
* @param id
* @return
*/
CompPO listById(@Param("id") long id);
CompPO listById(@Param("id") Long id);
/**
* UUID
@ -174,4 +174,6 @@ public interface CompMapper {
CompPO getCompanyByNo(@Param("companyNo") String companyNo);
List<Long> getCompanyIdsByUuid(@Param("uuids") List<String> uuids);
}

@ -435,6 +435,13 @@
where forbidden_tag = 0
and delete_type = 0
</select>
<select id="getCompanyIdsByUuid" resultType="java.lang.Long">
select id from jcl_org_comp
where delete_type = 0 and uuid in
<foreach collection="uuids" open="(" item="uuid" separator="," close=")">
#{uuid}
</foreach>
</select>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
update jcl_org_comp

@ -0,0 +1,28 @@
package com.engine.organization.mapper.detach;
import com.engine.organization.entity.detach.po.ManagerDetachPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/24
* @Version V1.0
**/
public interface ManagerDetachMapper {
int insertIgnoreNull(ManagerDetachPO managerDetachPO);
int updateDetach(ManagerDetachPO managerDetachPO);
int deleteByIds(@Param("ids") Collection<Long> ids);
List<ManagerDetachPO> selectByIds(@Param("ids")Collection<Long> ids);
ManagerDetachPO getDetachById(@Param("id") Integer id);
List<ManagerDetachPO> getDetachListById(@Param("ecManager") Integer ecManager);
}

@ -0,0 +1,224 @@
<?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.detach.ManagerDetachMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.detach.po.ManagerDetachPO">
<result column="id" property="id"/>
<result column="manager_type" property="managerType"/>
<result column="ec_manager" property="ecManager"/>
<result column="jcl_manager" property="jclManager"/>
<result column="ec_rolelevel" property="ecRolelevel"/>
<result column="jcl_rolelevel" property="jclRolelevel"/>
<result column="manage_module" property="manageModule"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.manager_type
, t.ec_manager
, t.jcl_manager
, t.ec_rolelevel
, t.jcl_rolelevel
, t.manage_module
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.detach.po.ManagerDetachPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_detach
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="managerType != null ">
manager_type,
</if>
<if test="ecManager != null ">
ec_manager,
</if>
<if test="jclManager != null ">
jcl_manager,
</if>
<if test="ecRolelevel != null ">
ec_rolelevel,
</if>
<if test="jclRolelevel != null ">
jcl_rolelevel,
</if>
<if test="manageModule != null ">
manage_module,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="managerType != null ">
#{managerType},
</if>
<if test="ecManager != null ">
#{ecManager},
</if>
<if test="jclManager != null ">
#{jclManager},
</if>
<if test="ecRolelevel != null ">
#{ecRolelevel},
</if>
<if test="jclRolelevel != null ">
#{jclRolelevel},
</if>
<if test="manageModule != null ">
#{manageModule},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.detach.po.ManagerDetachPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_DETACH_ID.currval from dual
</selectKey>
INSERT INTO jcl_org_detach
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="managerType != null ">
manager_type,
</if>
<if test="ecManager != null ">
ec_manager,
</if>
<if test="jclManager != null ">
jcl_manager,
</if>
<if test="ecRolelevel != null ">
ec_rolelevel,
</if>
<if test="jclRolelevel != null ">
jcl_rolelevel,
</if>
<if test="manageModule != null ">
manage_module,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="managerType != null ">
#{managerType},
</if>
<if test="ecManager != null ">
#{ecManager},
</if>
<if test="jclManager != null ">
#{jclManager},
</if>
<if test="ecRolelevel != null ">
#{ecRolelevel},
</if>
<if test="jclRolelevel != null ">
#{jclRolelevel},
</if>
<if test="manageModule != null ">
#{manageModule},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<update id="updateDetach" parameterType="com.engine.organization.entity.detach.po.ManagerDetachPO">
update jcl_org_detach
<set>
ec_manager=#{ecManager},
jcl_Manager=#{jclManager},
ec_rolelevel=#{ecRolelevel},
jcl_rolelevel=#{jclRolelevel}
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="deleteByIds">
UPDATE jcl_org_detach
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<select id="selectByIds" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_detach t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="getDetachById" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_detach t
WHERE delete_type = 0
AND id = #{id}
</select>
<select id="getDetachListById" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_detach t
WHERE delete_type = 0
and ec_manager = #{ecManager}
</select>
</mapper>

@ -2,6 +2,10 @@ package com.engine.organization.mapper.employee;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @Author weaver_cl
@ -12,4 +16,8 @@ import org.apache.ibatis.annotations.Param;
public interface EmployeeMapper {
String getEmployeeNameById(@Param("employeeId") Long id);
List<Long> getResourceIds(@Param("lastName") String lastName);
List<Map<String,Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
}

@ -2,10 +2,46 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.employee.EmployeeMapper">
<sql id="likeSql">
<if test="lastName != null and lastName != ''">
AND t.lastname like CONCAT('%',#{lastName},'%')
</if>
</sql>
<sql id="likeSql" databaseId="oracle">
<if test="lastName != null and lastName != ''">
AND t.lastname like '%'||#{lastName}||'%'
</if>
</sql>
<sql id="likeSql" databaseId="sqlserver">
<if test="lastName != null and lastName != ''">
AND t.lastname like '%'+#{lastName}+'%'
</if>
</sql>
<select id="getEmployeeNameById" resultType="string">
select t.lastname
from hrmresource t
where id = #{employeeId}
</select>
<select id="getResourceIds" resultType="long">
select t.id
from hrmresource t
where 1 = 1
<include refid="likeSql"/>
</select>
<select id="getBrowserDatas" resultType="java.util.Map">
select
lastname as "name",
id as "id"
from hrmresource
WHERE id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>

@ -161,6 +161,65 @@
</trim>
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO" databaseId="oracle">
<selectKey keyProperty="fid" resultType="int" order="AFTER">
select JCL_ORG_ITEM_ID.currval from dual
</selectKey>
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"-->

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
@ -18,6 +19,8 @@ public interface SystemDataMapper {
String getScCompanyNameById(@Param("companyId") String companyId);
List<Map<String,Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
String getScDepartmentNameById(@Param("departmentId") String departmentId);
String getScHrmResourceNameById(@Param("managerId") String managerId);
@ -56,4 +59,6 @@ public interface SystemDataMapper {
Long getHrmResourceMaxId();
List<String> getBatchUuidByIds(@Param("tableName") String tableName,@Param("ecIds") List<String> ecIds);
}

@ -40,6 +40,19 @@
from hrmsubcompany
where id = #{companyId}
</select>
<select id="getBrowserDatas" resultType="java.util.Map">
select
subcompanyname as "name",
id as "id"
from hrmsubcompany
where id in
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="getScDepartmentNameById" resultType="java.lang.String">
select departmentname
from hrmdepartment
@ -146,5 +159,12 @@
where department_id = #{departmentId}
</select>
<select id="getBatchUuidByIds" resultType="java.lang.String">
select uuid from ${tableName} where id in
<foreach collection="ecIds" open="(" item="ecId" separator="," close=")">
#{ecId}
</foreach>
</select>
</mapper>

@ -0,0 +1,25 @@
package com.engine.organization.mapper.personnelcard;
import com.engine.organization.entity.detach.po.ManagerDetachPO;
import com.engine.organization.entity.personnelcard.po.CardAccessPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/24
* @Version V1.0
**/
public interface CardAccessMapper {
int insertIgnoreNull(CardAccessPO cardAccessPO);
int updateCardAccess(CardAccessPO cardAccessPO);
int deleteByIds(@Param("ids") Collection<Long> ids);
ManagerDetachPO selectById(@Param("id") Integer id);
}

@ -0,0 +1,225 @@
<?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.personnelcard.CardAccessMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.personnelcard.po.CardAccessPO">
<result column="id" property="id"/>
<result column="type_id" property="typeId"/>
<result column="type_name" property="typeName"/>
<result column="status" property="status"/>
<result column="all_people" property="allPeople"/>
<result column="superior" property="superior"/>
<result column="all_superior" property="allSuperior"/>
<result column="custom" property="custom"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.type_id
, t.type_name
, t.status
, t.all_people
, t.superior
, t.all_superior
, t.custom
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_cardaccess
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeId != null ">
type_id,
</if>
<if test="typeName != null ">
type_name,
</if>
<if test="status != null ">
status,
</if>
<if test="allPeople != null ">
all_people,
</if>
<if test="superior != null ">
superior,
</if>
<if test="allSuperior != null ">
all_superior,
</if>
<if test="custom != null">
custom,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="typeId != null ">
#{typeId},
</if>
<if test="typeName != null ">
#{typeName},
</if>
<if test="status != null ">
#{status},
</if>
<if test="allPeople != null ">
#{allPeople},
</if>
<if test="superior != null ">
#{superior},
</if>
<if test="allSuperior != null ">
#{allSuperior},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="custom != null">
#{custom},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_CARDACCESS_ID.currval from dual
</selectKey>
INSERT INTO jcl_org_cardaccess
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeId != null ">
type_id,
</if>
<if test="typeName != null ">
type_name,
</if>
<if test="status != null ">
status,
</if>
<if test="allPeople != null ">
all_people,
</if>
<if test="superior != null ">
superior,
</if>
<if test="allSuperior != null ">
all_superior,
</if>
<if test="custom != null">
custom,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="typeId != null ">
#{typeId},
</if>
<if test="typeName != null ">
#{typeName},
</if>
<if test="status != null ">
#{status},
</if>
<if test="allPeople != null ">
#{allPeople},
</if>
<if test="superior != null ">
#{superior},
</if>
<if test="allSuperior != null ">
#{allSuperior},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="custom != null">
#{custom},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<update id="updateCardAccess" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO">
update jcl_org_cardaccess
<set>
type_id=#{typeId},
type_name=#{typeName},
status=#{status},
all_people=#{allPeople},
all_superior=#{allSuperior},
custom=#{custom},
update_time=#{updateTime},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="deleteByIds">
UPDATE jcl_org_cardaccess
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_cardaccess t
WHERE delete_type = 0
AND id = #{id}
</select>
</mapper>

@ -22,4 +22,6 @@ public interface ResourceMapper {
int updateResourceJob(@Param("originalJobId") Long originalJobId, @Param("targetJobId") Long targetJobId, @Param("parentComp") Long parentComp, @Param("parentDept") Long parentDept, @Param("ecCompany") Long ecCompany, @Param("ecDepartment") Long ecDepartment);
HrmResourcePO getResourceById(@Param("id") String id);
List<HrmResourcePO> listByNo(@Param("workCode") String workCode);
}

@ -102,6 +102,11 @@
<include refid="baseColumns"/>
from jcl_org_hrmresource t where delete_type = 0 and id = #{id}
</select>
<select id="listByNo" resultMap="HrmResourceMap">
select
<include refid="baseColumns"/>
from jcl_org_hrmresource t where delete_type = 0 and work_code = #{workCode}
</select>
<sql id="likeSql">
<if test="param.lastName != null and param.lastName != ''">

@ -340,14 +340,14 @@
select sum(a.staff_num) as staff_num from jcl_org_staff a
inner join jcl_org_staffplan b on a.plan_id = b.id
WHERE a.delete_type = 0 and b.control_dimension = #{ftype}
<if test="compId != null">
and a.comp_id = #{compId}
</if>
<if test="deptId != null">
and a.dept_id = #{deptId}
</if>
<if test="jobId != null">
and a.job_id = #{jobId}
</if>
<if test="compId != null">
and a.comp_id = #{compId}
</if>
<if test="deptId != null">
and a.dept_id = #{deptId}
</if>
<if test="jobId != null">
and a.job_id = #{jobId}
</if>
</select>
</mapper>

@ -12,7 +12,7 @@ import java.sql.Date;
**/
public interface GroupTriggerMapper {
int getInfoValue(@Param("id") Integer id);
Integer getInfoValue(@Param("id") Integer id);
Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin);

@ -3,6 +3,7 @@ package com.engine.organization.mapper.trigger;
import org.apache.ibatis.annotations.Param;
import weaver.hrm.passwordprotection.domain.HrmResource;
import java.sql.Date;
import java.util.List;
/**
@ -13,8 +14,8 @@ import java.util.List;
public interface HrmResourceTriggerMapper {
HrmResource getHrmResource(@Param("id") Long id);
List<Long> getFidsByFleader(@Param("fLeader") String fLeader, @Param("currentDate") String currentDate);
List<Long> getFidsByFleader(@Param("fLeader") String fLeader, @Param("currentDate") Date currentDate);
int updateLeaders(@Param("currentDate") String currentDate,@Param("fLeader") String fLeader, @Param("fLeaderImg") String fLeaderImg, @Param("fLeaderName") String fLeaderName, @Param("fLeaderJobId") Integer fLeaderJobId, @Param("fLeaderJob") String fLeaderJob, @Param("fLeaderLv") String fLeaderLv, @Param("fLeaderSt") String fLeaderSt);
int updateLeaders(@Param("currentDate") Date currentDate,@Param("fLeader") String fLeader, @Param("fLeaderImg") String fLeaderImg, @Param("fLeaderName") String fLeaderName, @Param("fLeaderJobId") Integer fLeaderJobId, @Param("fLeaderJob") String fLeaderJob, @Param("fLeaderLv") String fLeaderLv, @Param("fLeaderSt") String fLeaderSt);
}

@ -0,0 +1,10 @@
package com.engine.organization.service;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/1
* @Version V1.0
**/
public interface CardAccessService {
}

@ -0,0 +1,56 @@
package com.engine.organization.service;
import com.engine.organization.entity.detach.param.ManagerDetachParam;
import java.util.Collection;
import java.util.Map;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/21
* @Version V1.0
**/
public interface ManagerDetachService {
/**
* table
* @param params
* @return
*/
Map<String, Object> listPage(Map<String, Object> params);
/**
*
* @param id
* @return
*/
Map<String, Object> getForm(Integer id);
/**
*
* @param ids
* @return
*/
int deleteByIds(Collection<Long> ids);
/**
*
* @param param
* @return
*/
int save(ManagerDetachParam param);
/**
*
* @param param
* @return
*/
int updateDetach(ManagerDetachParam param);
/**
*
* @param isDetach
*/
String doDetach(String isDetach);
}

@ -0,0 +1,10 @@
package com.engine.organization.service.impl;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/1
* @Version V1.0
**/
public class CardAccessServiceImpl {
}

@ -34,6 +34,7 @@ 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;
import com.engine.organization.util.detach.DetachUtil;
import com.engine.organization.util.page.Column;
import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
@ -113,10 +114,13 @@ public class CompServiceImpl extends Service implements CompService {
PageInfo<CompListDTO> pageInfos;
String orderSql = PageInfoSortUtil.getSortSql(params.getSortParams());
List<CompPO> allList = getCompMapper().list(orderSql);
new DetachUtil(user.getUID()).filterCompanyList(allList);
// 通过子级遍历父级元素
if (filter) {
// 根据条件获取元素
List<CompPO> filterCompPOs = getCompMapper().listByFilter(compPO, orderSql);
new DetachUtil(user.getUID()).filterCompanyList(filterCompPOs);
// 添加父级元素
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(allList, filterCompPOs);
List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);

@ -48,6 +48,7 @@ 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;
import com.engine.organization.util.detach.DetachUtil;
import com.engine.organization.util.page.Column;
import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
@ -177,10 +178,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
PageInfo<DepartmentListDTO> pageInfos;
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
List<DepartmentPO> allList = getDepartmentMapper().list(orderSql);
new DetachUtil(user.getUID()).filterDepartmentList(allList);
// 通过子级遍历父级元素
if (filter) {
// 根据条件获取元素
List<DepartmentPO> filterDeptPOs = getDepartmentMapper().listByFilter(departmentPO, orderSql);
new DetachUtil(user.getUID()).filterDepartmentList(filterDeptPOs);
// 添加父级元素
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList, filterDeptPOs);
List<DepartmentListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS);
@ -282,9 +285,9 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
groupId = GROUP_ID.toString();
}
String oldDeptNo = getDepartmentMapper().getDeptById(searchParam.getId()).getDeptNo();
DepartmentPO oldDept = getDepartmentMapper().getDeptById(searchParam.getId());
String deptNo = searchParam.getDeptNo();
if (!deptNo.equals(oldDeptNo)) {
if (!deptNo.equals(oldDept.getDeptNo())) {
deptNo = repeatDetermine(deptNo);
params.put("dept_no", deptNo);
}
@ -320,6 +323,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
DepartmentPO newDeptById = getDepartmentMapper().getDeptById(searchParam.getId());
new DepartmentTriggerRunnable(oldDept, newDeptById).run();
Long parentComp = StringUtils.isNotEmpty(Util.null2String(params.get("parent_comp"))) ? Long.parseLong(Util.null2String(params.get("parent_comp"))) : null;
// 刷新岗位所属分部
@ -553,7 +558,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
deptById.setUuid(recordInfo.getUuid());
getDepartmentMapper().insertIgnoreNull(deptById);
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(deptById.getId())).start();
new DepartmentTriggerRunnable(deptById.getId()).run();
// 复制当前部门岗位信息
if ("1".equals(copyJob)) {
@ -637,7 +642,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
updateEcDepartment(departmentPO);
getDepartmentMapper().updateBaseDept(departmentPO);
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(departmentPO.getId())).start();
new DepartmentTriggerRunnable(departmentPO.getId()).run();
}
// 查询该部门一级岗位、更新岗位所属分部、所属部门
List<JobPO> firstChildJobList = getJobMapper().listJobsByDepartmentId(mergeParam.getId());
@ -650,7 +655,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 更新岗位组织架构图
for (JobPO jobPO : firstChildJobList) {
// 刷新组织架构图
new Thread(new JobTriggerRunnable(jobPO.getId())).start();
new JobTriggerRunnable(jobPO.getId()).run();
}
// 更新当前部门下的人员
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIdsByDept(mergeParam.getId().toString());
@ -658,7 +663,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
new RecordSet().executeUpdate("update jcl_org_hrmresource set company_id =? ,ec_company = ? ,department_id = ?, ec_department = ?where department_id =?", targetDepartment.getParentComp(), targetDepartment.getEcCompany(), targetDepartment.getId(), targetEcDeptId, mergeParam.getId());
// 更新人员组织架构图
for (Long hrmResourceId : hrmResourceIds) {
new Thread(new HrmResourceTriggerRunnable(hrmResourceId)).start();
new HrmResourceTriggerRunnable(hrmResourceId).run();
}
// 更新子部门下岗位的所属分部
for (DepartmentPO departmentPO : firstChildDeptList) {
@ -675,14 +680,14 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_deptext_dt1", mergeParam.getId());
getDepartmentMapper().deleteByIds(DeleteParam.builder().ids(mergeParam.getId().toString()).build().getIds());
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(mergeDepartment)).run();
new DepartmentTriggerRunnable(mergeDepartment).run();
// 更新部门合并后名称
targetDepartment.setDeptName(mergeParam.getMergeName());
targetDepartment.setDeptNameShort(mergeParam.getMergeName());
updateEcDepartment(targetDepartment);
getDepartmentMapper().updateBaseDept(targetDepartment);
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(oldFParentId,targetDepartment.getId())).run();
new DepartmentTriggerRunnable(oldFParentId,targetDepartment.getId()).run();
return 0;
}
@ -725,7 +730,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
deptById.setEcDepartment(null);
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(company.toString(),deptById)).run();
new DepartmentTriggerRunnable(company.toString(),deptById).run();
} else if ("1".equals(moveParam.getMoveType())) {
Long department = moveParam.getDepartment();
Long departmentId = Objects.requireNonNull(EcHrmRelationUtil.getJclDepartmentId(Util.null2String(department))).getId();
@ -744,7 +749,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
deptById.setEcCompany(parentDepartment.getEcCompany());
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(Integer.toString(100000000+department.intValue()),deptById)).run();
new DepartmentTriggerRunnable(Integer.toString(100000000+department.intValue()),deptById).run();
}
// 更新EC部门
updateEcDepartment(deptById);
@ -761,7 +766,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
new RecordSet().executeUpdate("update jcl_org_hrmresource set company_id =? ,ec_company = ? where department_id =?", deptById.getParentComp(), ecCompanyId, deptById.getId());
// 更新人员组织架构图
for (Long hrmResourceId : hrmResourceIds) {
new Thread(new HrmResourceTriggerRunnable(hrmResourceId)).start();
new HrmResourceTriggerRunnable(hrmResourceId).run();
}
forbiddenChildTag(deptById.getParentComp(), ecCompanyId, deptList);
// 递归更新下级部门、岗位
@ -784,7 +789,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
getDepartmentMapper().updateBaseDept(departmentPO);
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(departmentPO.getId())).start();
new DepartmentTriggerRunnable(departmentPO.getId()).run();
// 刷新岗位所属分部
refreshJobComp(departmentPO.getId(), parentComp);
// 更新当前部门下的人员
@ -794,7 +799,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
new RecordSet().executeUpdate("update jcl_org_hrmresource set company_id =? ,ec_company = ? where department_id =?", parentComp, ecCompanyId, departmentPO.getId());
// 更新人员组织架构图
for (Long hrmResourceId : hrmResourceIds) {
new Thread(new HrmResourceTriggerRunnable(hrmResourceId)).start();
new HrmResourceTriggerRunnable(hrmResourceId).run();
}
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(departmentPO.getId());
forbiddenChildTag(parentComp, ecCompanyId, childList);
@ -833,11 +838,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
// 查询部门信息
Long parentCompId = StringUtil.isEmpty(id) ? null : Long.parseLong(id);
CompPO compBuild = CompPO.builder().compName(keyword).parentCompany(parentCompId).forbiddenTag(0).build();
List<CompPO> allCompanys = getCompMapper().list("show_order");
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Map<Long, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
Set<CompPO> builderComps = new HashSet<>();
for (CompPO compPO : filterComps) {
buildParentComps(compPO, builderComps);
buildParentComps(compPO, builderComps,allMaps);
}
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps));
@ -849,14 +859,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
* @param compPO
* @param builderComps
*/
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps) {
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps, Map<Long, CompPO> allMaps) {
builderComps.add(compPO);
if (SearchTreeUtil.isTop(compPO.getParentCompany())) {
return;
}
CompPO parentComp = getCompMapper().listById(compPO.getParentCompany());
CompPO parentComp = allMaps.get(compPO.getParentCompany());
if (null != parentComp && 0 == parentComp.getForbiddenTag()) {
buildParentComps(parentComp, builderComps);
buildParentComps(parentComp, builderComps, allMaps);
}
}
@ -930,7 +937,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
jobPO.setShowOrder(orderNum);
MapperProxyFactory.getProxy(JobMapper.class).insertIgnoreNull(jobPO);
// 更新组织架构图
new Thread(new JobTriggerRunnable(jobPO.getId())).start();
new JobTriggerRunnable(jobPO.getId()).run();
// 处理子级元素
if (CollectionUtils.isNotEmpty(jobsByPid)) {
@ -1010,7 +1017,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
getJobMapper().updateJobCompany(jobPOS.stream().map(JobPO::getId).collect(Collectors.toList()), parentComp, ecCompanyId);
for (JobPO jobPO : jobPOS) {
// 刷新组织架构图
new Thread(new JobTriggerRunnable(jobPO.getId())).start();
new JobTriggerRunnable(jobPO.getId()).run();
}
}
}

@ -83,7 +83,7 @@ public class GroupServiceImpl extends Service implements GroupService {
String companyweb = (String) params.get("companyweb");
RecordSet rs = new RecordSet();
boolean executeUpdate = rs.executeUpdate("update HrmCompany set COMPANYNAME = ?,COMPANYDESC=?,COMPANYWEB=? where id = ?", companyname, companydesc, companyweb, id);
new Thread(new GroupTriggerRunnable(params)).start();
new GroupTriggerRunnable(params).run();
return executeUpdate;
}

@ -16,6 +16,7 @@ import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.personnelcard.PersonnelCardMapper;
import com.engine.organization.service.HrmPersonnelCardService;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.field.FieldDefinedValueUtil;
import com.engine.portal.biz.constants.ModuleConstants;
@ -190,7 +191,12 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
for (ExtendInfoPO extendInfoPO : extendInfoList) {
String fieldShowName = "";
if (null != fieldValueMap) {
Object fieldValue = fieldValueMap.get(extendInfoPO.getFieldName());
Object fieldValue;
if (DBType.isOracle()) {
fieldValue = fieldValueMap.get(extendInfoPO.getFieldName().toUpperCase());
} else {
fieldValue = fieldValueMap.get(extendInfoPO.getFieldName());
}
fieldShowName = FieldDefinedValueUtil.getFieldValue(user, extendInfoPO, Util.null2String(fieldValue));
}
itemList.add(Item.builder().fieldId(extendInfoPO.getFieldNameDesc()).fieldValue(fieldShowName).build());

@ -6,9 +6,11 @@ import com.api.browser.bean.SearchConditionItem;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrm.entity.RuleCodeType;
import com.engine.hrm.util.face.HrmFaceCheckManager;
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.po.CompPO;
@ -19,6 +21,7 @@ import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.entity.hrmresource.po.HrmRelationPO;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
import com.engine.organization.entity.job.bo.JobBO;
import com.engine.organization.entity.job.po.JobPO;
@ -26,6 +29,7 @@ import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams;
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.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
@ -35,6 +39,7 @@ import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.post.PostInfoMapper;
import com.engine.organization.mapper.post.PostMapper;
import com.engine.organization.mapper.resource.ResourceMapper;
import com.engine.organization.mapper.scheme.GradeMapper;
import com.engine.organization.mapper.scheme.LevelMapper;
import com.engine.organization.mapper.scheme.SchemeMapper;
@ -47,8 +52,10 @@ import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.coderule.CodeRuleUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.detach.DetachUtil;
import com.engine.organization.util.page.PageUtil;
import com.engine.organization.util.tree.SearchTreeUtil;
import org.apache.commons.collections.CollectionUtils;
@ -153,6 +160,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
}
private static ResourceMapper getResourceMapper() {
return MapperProxyFactory.getProxy(ResourceMapper.class);
}
private ExtendTitleMapper getExtendTitleMapper() {
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
}
@ -206,7 +217,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
@Override
public Long saveBaseForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
String workCode = (String) params.get("work_code");
// 判断是否开启自动编号
workCode = repeatDetermine(workCode);
params.put("work_code", workCode);
// 完善新增参数
completeParams(params);
@ -218,7 +232,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_RESOURCE, ecResourceId);
params.put("uuid", recordInfo.getUuid());
Long resourceId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null);
new Thread(new HrmResourceTriggerRunnable(resourceId)).start();
new HrmResourceTriggerRunnable(resourceId).run();
return resourceId;
}
@ -271,6 +285,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
// 判断编号是否重复
String workCode = Util.null2String(params.get("work_code"));
HrmResourcePO resourceById = getResourceMapper().getResourceById(id.toString());
if (!workCode.equals(resourceById.getWorkCode())) {
workCode = repeatDetermine(workCode);
params.put("work_code", workCode);
}
// 完善更新参数
completeParams(params);
@ -288,7 +309,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_HRMEXT_DT1, params, id);
new Thread(new HrmResourceTriggerRunnable(id)).start();
new HrmResourceTriggerRunnable(id).run();
return updateCount;
}
@ -500,6 +521,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
sqlWhere += " AND t.job_title = '" + jobTitle + "'";
}
// 分权查询
DetachUtil detachUtil = new DetachUtil(user.getUID());
String parentCompanyIds = detachUtil.getJclRoleLevels();
if (detachUtil.isDETACH()) {
sqlWhere += " And t.company_id in(" + parentCompanyIds + ")";
}
return sqlWhere;
}
@ -542,7 +570,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
*/
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild, JobPO jobBuild) {
List<JobPO> jobPOS = getJobMapper().listPOsByFilter(jobBuild);
new DetachUtil(user.getUID()).filterJobList(jobPOS);
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
// 添加父级岗位
Set<JobPO> builderJobs = new HashSet<>();
for (JobPO jobPO : jobPOS) {
@ -572,11 +602,14 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
// 查询分部信息
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts);
}
List<SearchTree> deptTrees = SearchTreeUtil.builderTreeMode(DepartmentBO.buildSetToSearchTree(builderDeparts, false));
List<SearchTree> departmentList = DepartmentBO.buildSetToSearchTree(builderDeparts, false);
List<SearchTree> deptTrees = SearchTreeUtil.builderTreeMode(departmentList);
List<SearchTree> searchTrees = SearchTreeUtil.builderTreeMode(departmentList, jobTrees);
// 添加部门的上级分部
String parentCompS = deptTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
if (!StringUtil.isEmpty(parentCompS)) {
@ -585,11 +618,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
filterComps.addAll(compsByIds);
}
}
List<CompPO> allCompanys = getCompMapper().list("show_order");
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
Map<Long, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
Set<CompPO> builderComps = new HashSet<>();
for (CompPO compPO : filterComps) {
buildParentComps(compPO, builderComps);
buildParentComps(compPO, builderComps,allMaps);
}
List<SearchTree> searchTrees = SearchTreeUtil.builderTreeMode(deptTrees, jobTrees);
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), searchTrees);
}
@ -663,14 +698,11 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
* @param compPO
* @param builderComps
*/
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps) {
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps,Map<Long, CompPO> allMaps) {
builderComps.add(compPO);
if (SearchTreeUtil.isTop(compPO.getParentCompany())) {
return;
}
CompPO parentComp = getCompMapper().listById(compPO.getParentCompany());
CompPO parentComp = allMaps.get(compPO.getParentCompany());
if (null != parentComp) {
buildParentComps(parentComp, builderComps);
buildParentComps(parentComp, builderComps,allMaps);
}
}
@ -682,8 +714,11 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
params.put("company_id", jobById.getParentComp());
params.put("ec_department", jobById.getEcDepartment());
params.put("ec_company", jobById.getEcCompany());
// 职级
params.put("job_level", jobById.getGradeId());
// 等级方案、岗位序列、职等、职级
params.put("scheme_id", jobById.getSchemeId());
params.put("sequence_id", jobById.getSequenceId());
params.put("job_level", jobById.getLevelId());
params.put("job_grade", jobById.getGradeId());
String showOrder = Util.null2String(params.get("show_order"));
// 初始化排序字段
if (StringUtils.isBlank(showOrder)) {
@ -698,4 +733,37 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
}
}
}
/**
*
*
* @return
*/
public static String repeatDetermine(String workCode) {
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.USER.getValue());
if (StringUtils.isNotBlank(workCode)) {
workCode = CodeRuleUtil.generateCode(RuleCodeType.USER, workCode);
List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(workCode));
OrganizationAssert.isEmpty(list, "编号不允许重复");
} else {
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
workCode = autoCreateWorkCode();
}
}
return workCode;
}
/**
*
*
* @return
*/
private static String autoCreateWorkCode() {
String generateCode = CodeRuleUtil.generateCode(RuleCodeType.USER, "");
List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(generateCode));
if (CollectionUtils.isNotEmpty(list)) {
generateCode = autoCreateWorkCode();
}
return generateCode;
}
}

@ -324,9 +324,9 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
lsPromptLabel.add(34275);
lsPromptLabel.add(125452);
lsPromptLabel.add(125466);
lsPromptLabel.add(522355);
lsPromptLabel.add(522356);
lsPromptLabel.add(522357);
//lsPromptLabel.add(522355);
//lsPromptLabel.add(522356);
//lsPromptLabel.add(522357);
//lsPromptLabel.add(530411);
for (int i = 0; i < lsPromptLabel.size(); i++) {
@ -386,9 +386,9 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
lsPromptLabel.add(34275);
lsPromptLabel.add(125452);
lsPromptLabel.add(125466);
lsPromptLabel.add(522355);
lsPromptLabel.add(522356);
lsPromptLabel.add(522357);
//lsPromptLabel.add(522355);
//lsPromptLabel.add(522356);
//lsPromptLabel.add(522357);
//lsPromptLabel.add(530411);
for (int i = 0; i < lsPromptLabel.size(); i++) {
@ -521,7 +521,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
lsPromptLabel.add(81699);
lsPromptLabel.add(516263);
//lsPromptLabel.add(81701);
lsPromptLabel.add(388880);
//lsPromptLabel.add(388880);
lsPromptLabel.add(81702);
lsPromptLabel.add(81703);
lsPromptLabel.add(125869);
@ -681,7 +681,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build();
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
// 刷新组织架构图
new Thread(new CompanyTriggerRunnable(infoParams.getId())).start();
new CompanyTriggerRunnable(infoParams.getId()).run();
historyDetailPO.setOperateDetail("添加成功");
historyDetailPO.setStatus("1");
} else {
@ -706,7 +706,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.remove("id");
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(companyId).tableName("JCL_ORG_COMP").params(map).build());
// 刷新组织架构图
new Thread(new CompanyTriggerRunnable(companyId)).start();
new CompanyTriggerRunnable(companyId).run();
historyDetailPO.setOperateDetail("更新成功");
historyDetailPO.setStatus("1");
} else {
@ -897,7 +897,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_DEPT").params(map).build();
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
// 刷新组织架构图
new Thread(new DepartmentTriggerRunnable(infoParams.getId())).start();
new DepartmentTriggerRunnable(infoParams.getId()).run();
map.put("id", infoParams.getId());
historyDetailPO.setOperateDetail("添加成功");
historyDetailPO.setStatus("1");
@ -923,7 +923,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.remove("id");
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(departmentId).tableName("JCL_ORG_DEPT").params(map).build());
// 刷新组织架构图
new Thread(new DepartmentTriggerRunnable(departmentId)).start();
new DepartmentTriggerRunnable(departmentId).run();
historyDetailPO.setOperateDetail("更新成功");
historyDetailPO.setStatus("1");
} else {
@ -1132,16 +1132,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("JCL_ORG_JOB").params(map).build();
map.put("jobactivityid", JobServiceImpl.JOB_ACTIVITY_ID);
map.put("id", infoParams.getId());
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.ADD, map, false).sync();
if (isThrowError(syncMap)) {
boolean assertNameRepeat = JobServiceImpl.assertNameRepeat(null, Util.null2String(map.get("ec_department")), Util.null2String(map.get("parent_job")), Util.null2String(map.get("job_name")));
if (assertNameRepeat) {
map.remove("id");
map.remove("jobactivityid");
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
// 更新组织架构图
new Thread(new JobTriggerRunnable(jobId)).start();
new JobTriggerRunnable(infoParams.getId()).run();
historyDetailPO.setOperateDetail("添加成功");
historyDetailPO.setStatus("1");
} else {
@ -1174,7 +1172,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.remove("jobactivityid");
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(jobId).tableName("JCL_ORG_JOB").params(map).build());
// 更新组织架构图
new Thread(new JobTriggerRunnable(jobId)).start();
new JobTriggerRunnable(jobId).run();
historyDetailPO.setOperateDetail("更新成功");
historyDetailPO.setStatus("1");
} else {
@ -1259,7 +1257,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
saveImportDetailLog(historyDetailPO);
continue nextRow;
}
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"ec_company".equals(infoPO.getFieldName()) && !"ec_department".equals(infoPO.getFieldName())) {
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"ec_company".equals(infoPO.getFieldName()) && !"ec_department".equals(infoPO.getFieldName()) && !"job_title".equals(infoPO.getFieldName())) {
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据");
historyDetailPO.setStatus("0");
saveImportDetailLog(historyDetailPO);
@ -1376,7 +1374,18 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
saveImportDetailLog(historyDetailPO);
continue;
}
// 自动编号
String workCode = Util.null2String(map.get("work_code"));
try {
// 自动编号
workCode = HrmResourceServiceImpl.repeatDetermine(workCode);
map.put("work_code", workCode);
} catch (Exception e) {
historyDetailPO.setOperateDetail(Util.null2String(e.getMessage()));
historyDetailPO.setStatus("0");
saveImportDetailLog(historyDetailPO);
}
map.put("creator", user.getUID());
map.put("delete_type", 0);
map.put("create_time", new Date());
@ -1398,7 +1407,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.remove("id");
MapperProxyFactory.getProxy(ExtMapper.class).insertTable(infoParams);
// 更新组织架构图
new Thread(new HrmResourceTriggerRunnable(infoParams.getId())).start();
new HrmResourceTriggerRunnable(infoParams.getId()).run();
historyDetailPO.setOperateDetail("添加成功");
historyDetailPO.setStatus("1");
@ -1422,7 +1431,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
map.remove("id");
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(resourceId).tableName("JCL_ORG_HRMRESOURCE").params(map).build());
// 更新组织架构图
new Thread(new HrmResourceTriggerRunnable(resourceId)).start();
new HrmResourceTriggerRunnable(resourceId).run();
historyDetailPO.setOperateDetail("更新成功");
historyDetailPO.setStatus("1");
@ -1516,10 +1525,10 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
Map<String, String> optionMap = options.stream().collect(Collectors.toMap(FieldSelectOptionBean::getOption, FieldSelectOptionBean::getId, (k1, k2) -> k1));
object = optionMap.get(cellValue);
break;
case 4:// CHECKBOX
case 6:
// FILEUPLOAD
break;
case 4:// CHECKBOX
case 7:// TEXT
case 2:// TEXTAREA
default:
@ -1591,7 +1600,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
iterator.remove();
}
if ("所属部门".equals(column) || "上级部门".equals(column) || "部门".equals(column)) {
if ("所属部门".equals(column) || "上级部门".equals(column)) {
departmentColumn = column;
iterator.remove();
}

@ -50,6 +50,7 @@ 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;
import com.engine.organization.util.detach.DetachUtil;
import com.engine.organization.util.page.Column;
import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
@ -164,10 +165,12 @@ public class JobServiceImpl extends Service implements JobService {
PageInfo<JobListDTO> pageInfos;
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
new DetachUtil(user.getUID()).filterJobDTOList(allList);
// 通过子级遍历父级元素
if (filter) {
// 根据条件获取元素
List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO, orderSql);
new DetachUtil(user.getUID()).filterJobDTOList(allList);
// 添加父级元素
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
@ -361,12 +364,20 @@ public class JobServiceImpl extends Service implements JobService {
jobNo = repeatDetermine(jobNo);
params.put("job_no", jobNo);
params.put("is_key", null == searchParam.getIsKey() ? 0 : searchParam.getIsKey());
Long ecDepartment = searchParam.getEcDepartment();
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(Util.null2String(ecDepartment));
params.put("parent_dept", jclDepartment.getId());
params.put("parent_comp", jclDepartment.getParentComp());
if (null != jclDepartment.getParentComp()) {
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(jclDepartment.getParentComp())));
if (null != searchParam.getParentJob()) {
JobPO parentJob = getJobMapper().getJobById(searchParam.getParentJob());
params.put("parent_dept", parentJob.getParentDept());
params.put("parent_comp", parentJob.getParentComp());
params.put("ec_company", parentJob.getEcCompany());
params.put("ec_department", parentJob.getEcDepartment());
} else {
Long ecDepartment = searchParam.getEcDepartment();
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(Util.null2String(ecDepartment));
params.put("parent_dept", jclDepartment.getId());
params.put("parent_comp", jclDepartment.getParentComp());
if (null != jclDepartment.getParentComp()) {
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(jclDepartment.getParentComp())));
}
}
if (StringUtils.isBlank(params.get("show_order").toString())) {
@ -406,12 +417,20 @@ public class JobServiceImpl extends Service implements JobService {
// 更新主表数据
params.put("is_key", searchParam.getIsKey());
Long ecDepartment = searchParam.getEcDepartment();
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(Util.null2String(ecDepartment));
params.put("parent_dept", jclDepartment.getId());
params.put("parent_comp", jclDepartment.getParentComp());
if (null != jclDepartment.getParentComp()) {
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(jclDepartment.getParentComp())));
if (null != searchParam.getParentJob()) {
JobPO parentJob = getJobMapper().getJobById(searchParam.getParentJob());
params.put("parent_dept", parentJob.getParentDept());
params.put("parent_comp", parentJob.getParentComp());
params.put("ec_company", parentJob.getEcCompany());
params.put("ec_department", parentJob.getEcDepartment());
} else {
Long ecDepartment = searchParam.getEcDepartment();
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(Util.null2String(ecDepartment));
params.put("parent_dept", jclDepartment.getId());
params.put("parent_comp", jclDepartment.getParentComp());
if (null != jclDepartment.getParentComp()) {
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(Util.null2String(jclDepartment.getParentComp())));
}
}
params.put("jobactivityid", JOB_ACTIVITY_ID);
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO).sync();
@ -420,8 +439,11 @@ public class JobServiceImpl extends Service implements JobService {
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
// 更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, searchParam.getId());
JobPO jobById = getJobMapper().getJobById(searchParam.getId());
new JobTriggerRunnable(oldJobPO, jobById).run();
// 更新人员关联字段
updateResourceJob(getJobMapper().getJobById(searchParam.getId()));
updateResourceJob(jobById);
return searchParam.getId();
}
@ -453,7 +475,7 @@ public class JobServiceImpl extends Service implements JobService {
assertNameRepeat(null, jobById.getEcDepartment(), jobById.getParentJob(), jobById.getJobName());
insertCount += getJobMapper().insertIgnoreNull(jobById);
// 更新组织架构图
new Thread(new JobTriggerRunnable(jobById.getId())).start();
new JobTriggerRunnable(jobById.getId()).run();
}
return insertCount;
@ -568,12 +590,12 @@ public class JobServiceImpl extends Service implements JobService {
targetJob.setJobName(mergeParam.getMergeName());
getJobMapper().updateBaseJob(targetJob);
new Thread(new JobTriggerRunnable(jobById.getId(),targetJob.getId())).start();
new JobTriggerRunnable(jobById.getId(),targetJob.getId()).run();
// 原岗位删除
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobById).sync();
getJobMapper().deleteByIds(Collections.singletonList(jobById.getId()));
// 更新组织架构图
new Thread(new JobTriggerRunnable(jobById)).start();
new JobTriggerRunnable(jobById).run();
return updateCount;
}
@ -589,7 +611,7 @@ public class JobServiceImpl extends Service implements JobService {
// 更新人员信息
updateResourceJob(job);
// 更新组织架构图
new Thread(new JobTriggerRunnable(job.getId())).start();
new JobTriggerRunnable(job.getId()).run();
// 递归处理子级元素
List<JobPO> jobsByPid = getJobMapper().getJobsByPid(job.getId());
@ -620,14 +642,11 @@ public class JobServiceImpl extends Service implements JobService {
* @param compPO
* @param builderComps
*/
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps) {
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps,Map<Long, CompPO> allMaps) {
builderComps.add(compPO);
if (SearchTreeUtil.isTop(compPO.getParentCompany())) {
return;
}
CompPO parentComp = getCompMapper().listById(compPO.getParentCompany());
CompPO parentComp = allMaps.get(compPO.getParentCompany());
if (null != parentComp && 0 == parentComp.getForbiddenTag()) {
buildParentComps(parentComp, builderComps);
buildParentComps(parentComp, builderComps,allMaps);
}
}
@ -670,8 +689,10 @@ public class JobServiceImpl extends Service implements JobService {
*/
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) {
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
// 查询分部信息
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
Set<DepartmentPO> builderDeparts = new HashSet<>();
for (DepartmentPO departmentPO : filterDeparts) {
buildParentDepts(departmentPO, builderDeparts);
@ -685,9 +706,12 @@ public class JobServiceImpl extends Service implements JobService {
filterComps.addAll(compsByIds);
}
}
List<CompPO> allCompanys = getCompMapper().list("show_order");
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
Map<Long, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
Set<CompPO> builderComps = new HashSet<>();
for (CompPO compPO : filterComps) {
buildParentComps(compPO, builderComps);
buildParentComps(compPO, builderComps,allMaps);
}
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), deptTrees);
}
@ -768,7 +792,7 @@ public class JobServiceImpl extends Service implements JobService {
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, job).sync();
getJobMapper().updateBaseJob(job);
// 更新组织架构图
new Thread(new JobTriggerRunnable(job.getId())).start();
new JobTriggerRunnable(job.getId()).run();
List<JobPO> childJobs = getJobMapper().getJobsByPid(job.getId());
forbiddenChildTag(parentComp, parentDept, job.getId(), childJobs);
}

@ -0,0 +1,192 @@
package com.engine.organization.service.impl;
import com.api.browser.bean.BrowserBean;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.api.browser.bean.SearchConditionOption;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.detach.param.ManagerDetachParam;
import com.engine.organization.entity.detach.po.ManagerDetachPO;
import com.engine.organization.entity.detach.vo.ManagerDetachVO;
import com.engine.organization.mapper.detach.ManagerDetachMapper;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.service.ManagerDetachService;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import com.weaver.file.ConfigOperator;
import com.weaver.general.BaseBean;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/21
* @Version V1.0
**/
public class ManagerDetachServiceImpl extends Service implements ManagerDetachService {
private static final String RIGHT_NAME = "MangerDeatch:All";
public ManagerDetachMapper getMangeDetachMapper() {
return MapperProxyFactory.getProxy(ManagerDetachMapper.class);
}
public HrmResourceMapper getHrmResourceMapper() {
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
}
public EmployeeMapper getEmployeeMapper() {
return MapperProxyFactory.getProxy(EmployeeMapper.class);
}
public SystemDataMapper getSystemDataMapper(){
return MapperProxyFactory.getProxy(SystemDataMapper.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;
}
String detach = new BaseBean().getPropValue("hrmOrganization", "detach");
resultMap.put("isDetach",detach);
OrganizationWeaTable<ManagerDetachVO> table = new OrganizationWeaTable<>(user, ManagerDetachVO.class);
String sqlWhere = buildSqlWhere(params);
table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
resultMap.putAll(result.getResultMap());
return resultMap;
}
@Override
public Map<String, Object> getForm(Integer id) {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionItem> selectItems = new ArrayList<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionOption> selectOptions = new ArrayList<>();
SearchConditionOption moduleOption = new SearchConditionOption("0", "组织管理",true);
selectOptions.add(moduleOption);
SearchConditionItem ecManager = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, true, "管理员", "1", "ecManager", "");
ecManager.setRules("required|string");
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "可维护机构", "194", "ecRolelevel", "");
ecRolelevel.setRules("required|string");
SearchConditionItem module = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "可管理模块", "module");
module.setViewAttr(1);
module.setDetailtype(2);
module.setHasBorder(true);
if (id != null) {
ManagerDetachPO detachById = getMangeDetachMapper().getDetachById(id);
BrowserBean manager = ecManager.getBrowserConditionParam();
manager.setReplaceDatas(getEmployeeMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcManager())).build().getIds()));
ecManager.setBrowserConditionParam(manager);
BrowserBean roleLevel = ecRolelevel.getBrowserConditionParam();
roleLevel.setReplaceDatas(getSystemDataMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcRolelevel())).build().getIds()));
ecRolelevel.setBrowserConditionParam(roleLevel);
}
selectItems.add(ecManager);
selectItems.add(ecRolelevel);
selectItems.add(module);
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
apiDatas.put("condition", addGroups);
return apiDatas;
}
@Override
public int deleteByIds(Collection<Long> ids) {
return getMangeDetachMapper().deleteByIds(ids);
}
@Override
public int save(ManagerDetachParam param) {
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
.managerType(0)
.ecManager(param.getEcManager())
.jclManager(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
.ecRolelevel(param.getEcRolelevel())
.jclRolelevel(EcHrmRelationUtil.getJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
.manageModule("组织管理")
.creator((long)user.getUID())
.deleteType(0)
.createTime(new Date())
.updateTime(new Date())
.build();
return getMangeDetachMapper().insertIgnoreNull(managerDetachPO);
}
@Override
public int updateDetach(ManagerDetachParam param) {
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
.id(param.getId())
.ecManager(param.getEcManager())
.jclManager(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
.ecRolelevel(param.getEcRolelevel())
.jclRolelevel(EcHrmRelationUtil.getJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
.build();
return getMangeDetachMapper().updateDetach(managerDetachPO);
}
@Override
public String doDetach(String isDetach) {
ConfigOperator ConfigOperator = new ConfigOperator();
ConfigOperator.setProp("hrmOrganization.properties", "detach", isDetach);
return new BaseBean().getPropValue("hrmOrganization", "detach");
}
private String buildSqlWhere(Map<String, Object> params) {
DBType dbType = DBType.get(new RecordSet().getDBType());
String sqlWhere = " where delete_type = 0";
String lastName = (String) params.get("ecManager");
List<Long> resourceIds = MapperProxyFactory.getProxy(EmployeeMapper.class).getResourceIds(lastName);
String ecManager = StringUtils.join(resourceIds,",");
if (StringUtils.isNotBlank(lastName)) {
sqlWhere += " AND ec_manager in ("+ecManager+") ";
}
String ecRolelevel = (String) params.get("ecRolelevel");
if (StringUtils.isNotBlank(ecRolelevel)) {
sqlWhere += " AND ec_rolelevel " +dbType.like(ecRolelevel);
}
return sqlWhere;
}
/**
* JCL_ID
* @param uId
* @return
*/
public static List<Long> getJclRoleLevels(Integer uId) {
List<Long> ecRoleLevels = new ArrayList<>();
ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
List<ManagerDetachPO> detachListById = mangeDetachMapper.getDetachListById(uId);
for (ManagerDetachPO managerDetachPO : detachListById) {
List<Long> ids = Stream.of(managerDetachPO.getJclRolelevel().split(",")).map(Long::parseLong).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(ids)) {
ecRoleLevels.addAll(ids);
}
}
return ecRoleLevels;
}
}

@ -11,11 +11,14 @@ import com.engine.organization.service.OrgChartService;
import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.detach.DetachUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.User;
import java.util.*;
import java.util.stream.Collectors;
/**
* @className: OrgChartServiceImpl
@ -47,8 +50,14 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
item.put("companyname", rs.getString("companyname"));
fclasslist.add(item);
}
String sql = "select distinct id, fnumber, fname, ftype from jcl_org_map where ftype in (0, 1) order by ftype , id ";
rs.executeQuery("select distinct id, fnumber, fname, ftype from jcl_org_map where ftype in (0, 1) order by ftype , id ");
// 分部分权过滤
DetachUtil detachUtil = new DetachUtil(user.getUID());
if (detachUtil.isDETACH()) {
sql = "select distinct id, fnumber, fname, ftype from jcl_org_map where (ftype = 0 or (ftype = 1 and fobjid in(" + detachUtil.getJclRoleLevels() + "))) order by ftype , id";
}
rs.executeQuery(sql);
List<Map<String, Object>> companylist = new ArrayList<>();
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
@ -109,77 +118,54 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
if (StringUtils.isBlank(level)) {
level = "3";
}
// 虚拟组织切换
String fisvitual = (String) request2Map.get("fisvitual"); // 是否虚拟组织 0否1是
String whereSql = companyDateWhereSql(request2Map);
String whereItemSql = " ";
if ("0".equals(root)) { // 集团的情况
whereItemSql += " and ftype = 0 ";
} else {
whereItemSql += " and id = '" + root + "' ";
}
// 获取根节点
RecordSet rs = new RecordSet();
rs.executeQuery("select id, fname, ftype, fparentid, fnumber, fobjid from jcl_org_map " + whereSql + whereItemSql);
List<Map<String, Object>> list = new ArrayList<>();
if (StringUtils.isBlank(fisvitual)) {
fisvitual = "0";
String id = null;
if (rs.next()) {
Map<String, Object> item = new HashMap<>();
id = rs.getString("id");
item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname"));
item.put("ftype", rs.getString("ftype"));
item.put("fnumber", rs.getString("fnumber"));
item.put("fobjid", rs.getString("fobjid"));
item.put("parentId", null);
item.put("expand", "1");
item.put("hasChildren", hasChildren(rs.getString("id"), true));
list.add(item);
}
if(fisvitual.equals("1")){
String whereSql = "where fid='0'";
// 获取根节点
RecordSet rs = new RecordSet();
rs.executeQuery("select fid, fname, forder, fparentid, ftype from uf_jcl_vo " + whereSql);
String fid = null;
if (rs.next()) {
Map<String, Object> item = new HashMap<>();
fid = rs.getString("fid");
item.put("id", rs.getString("fid"));
item.put("fname", rs.getString("fname"));
item.put("forder", rs.getString("forder"));
item.put("parentId", null);
item.put("ftype", rs.getString("ftype"));
item.put("expand", "1");
item.put("hasChildren", hasVOChildren(rs.getString("fid")));
list.add(item);
}
if (null != fid) {
findVoItemByParantId(fid, rs, list, true);
}
}else {
String whereSql = companyDateWhereSql(request2Map);
String whereItemSql = " ";
if ("0".equals(root)) { // 集团的情况
whereItemSql += " and ftype = 0 ";
} else {
whereItemSql += " and id = '" + root + "' ";
}
// 获取根节点
RecordSet rs = new RecordSet();
rs.executeQuery("select id, fname, ftype, fparentid, fnumber, fobjid from jcl_org_map " + whereSql + whereItemSql);
// List<Map<String, Object>> list = new ArrayList<>();
String id = null;
if (rs.next()) {
Map<String, Object> item = new HashMap<>();
id = rs.getString("id");
item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname"));
item.put("ftype", rs.getString("ftype"));
item.put("fnumber", rs.getString("fnumber"));
item.put("fobjid",rs.getString("fobjid"));
item.put("parentId", null);
item.put("expand", "1");
item.put("hasChildren", hasChildren(rs.getString("id"), true));
list.add(item);
}
int currentLevel = 1;
findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, currentLevel + 1 <= Integer.parseInt(level));
// 分部数据,构建层级关系
reBuildTreeList(list);
int currentLevel = 1;
if (currentLevel + 1 <= Integer.parseInt(level)) {
findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
} else {
findCompanyItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, false);
}
}
result.put("api_status", true);
result.put("data", list);
return result;
}
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,fobjid,fecid,fnumber from jcl_org_map " + whereSql + " and fparentid = " + id);
String sql = "select id, fname, ftype, fparentid,fobjid,fecid,fnumber from jcl_org_map " + whereSql;
DetachUtil detachUtil = new DetachUtil(user.getUID());
if (detachUtil.isDETACH() && "0".equals(id)) {
sql += " and ftype = 1 and fobjid in(" + detachUtil.getJclRoleLevels() + ")";
} else {
sql += " and fparentid = " + id;
}
rs.executeQuery(sql);
List<Map<String, Object>> currentList = new ArrayList<>();
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
@ -207,29 +193,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
}
private void findVoItemByParantId(String id, RecordSet rs, List<Map<String, Object>> list, boolean expand) {
rs.executeQuery("select fid, fname, forder, fparentid, ftype from uf_jcl_vo where fparentid = '" + id + "'");
List<Map<String, Object>> currentList = new ArrayList<>();
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("fid"));
item.put("fname", rs.getString("fname"));
item.put("forder", rs.getString("forder"));
item.put("parentId", rs.getString("fparentid"));
item.put("ftype", rs.getString("ftype"));
item.put("expand", expand ? "1" : "0");
item.put("hasChildren", hasVOChildren(rs.getString("fid")));
currentList.add(item);
}
list.addAll(currentList);
for (Map<String, Object> stringObjectMap : currentList) {
findVoItemByParantId((String) stringObjectMap.get("id"), rs, list, true);
}
}
private String userWhereSql(Map<String, Object> request2Map) {
String date = (String) request2Map.get("date"); // 数据日期
if (StringUtils.isBlank(date)) {
@ -262,78 +225,59 @@ 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;
}
String root = (String) request2Map.get("root"); // 根节点
String level = (String) request2Map.get("level"); // 显示层级
String fisvitual = (String) request2Map.get("fisvitual"); // 虚拟组织
if (StringUtils.isBlank(level)) {
level = "3";
}
if (StringUtils.isBlank(fisvitual)) {
fisvitual = "0";
}
List<Map<String, Object>> list = new ArrayList<>();
if (fisvitual.equals("0")) {
String whereSql = userWhereSql(request2Map);
String whereItemSql = " ";
if ("0".equals(root)) { // 集团的情况
whereItemSql += " and t.ftype = 0 ";
} else {
whereItemSql += " and t.id = '" + root + "' ";
}
// 获取根节点
RecordSet rs = new RecordSet();
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername,t.fobjid,t.fecid, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader, t.fleaderlv, t.fleaderst,t.fecid from jcl_org_map t " + whereSql + whereItemSql);
String id = null;
if (rs.next()) {
Map<String, Object> item = new HashMap<>();
id = rs.getString("id");
item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname"));
item.put("ftype", rs.getString("ftype"));
item.put("parentId", null);
item.put("fleadername", rs.getString("fleadername"));
item.put("fleaderimg", rs.getString("fleaderimg"));
item.put("fleaderjob", rs.getString("fleaderjob"));
item.put("fplan", rs.getString("fplan"));
item.put("fonjob", rs.getString("fonjob"));
item.put("hasChildren", hasChildren(rs.getString("id"), false));
item.put("expand", "1");
item.put("fnumber", rs.getString("fnumber"));
item.put("fleader", rs.getString("fleader"));
item.put("fobjid",rs.getString("fobjid"));
item.put("fleaderlv",convertLevel(rs.getString("fleaderlv")));
item.put("fleaderst",convertGrade(rs.getString("fleaderst")));
item.put("fecid",rs.getString("fecid"));
list.add(item);
}
int currentLevel = 1;
if (currentLevel + 1 <= Integer.parseInt(level)) {
findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, true);
}else{
findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, false);
}
String whereSql = userWhereSql(request2Map);
String whereItemSql = " ";
if ("0".equals(root)) { // 集团的情况
whereItemSql += " and t.ftype = 0 ";
} else {
String whereSql = "where fid='0'";
// 获取根节点
RecordSet rs = new RecordSet();
rs.executeQuery("select fid, fname, forder, fparentid, ftype from uf_jcl_vo " + whereSql);
String fid = null;
if (rs.next()) {
Map<String,Object> item = new HashMap<>();
}
whereItemSql += " and t.id = '" + root + "' ";
}
// 获取根节点
RecordSet rs = new RecordSet();
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername,t.fobjid,t.fecid, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber, t.fleader, t.fleaderlv, t.fleaderst,t.fecid from jcl_org_map t " + whereSql + whereItemSql);
List<Map<String, Object>> list = new ArrayList<>();
String id = null;
if (rs.next()) {
Map<String, Object> item = new HashMap<>();
id = rs.getString("id");
item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname"));
item.put("ftype", rs.getString("ftype"));
item.put("parentId", null);
item.put("fleadername", rs.getString("fleadername"));
item.put("fleaderimg", rs.getString("fleaderimg"));
item.put("fleaderjob", rs.getString("fleaderjob"));
item.put("fplan", rs.getString("fplan"));
item.put("fonjob", rs.getString("fonjob"));
item.put("hasChildren", hasChildren(rs.getString("id"), false));
item.put("expand", "1");
item.put("fnumber", rs.getString("fnumber"));
item.put("fleader", rs.getString("fleader"));
item.put("fobjid", rs.getString("fobjid"));
item.put("fleaderlv", convertLevel(rs.getString("fleaderlv")));
item.put("fleaderst", convertGrade(rs.getString("fleaderst")));
item.put("fecid", rs.getString("fecid"));
list.add(item);
}
int currentLevel = 1;
findUserItemByParantId(id, currentLevel + 1, level, rs, list, whereSql, currentLevel + 1 <= Integer.parseInt(level));
// 分部数据,构建层级关系
reBuildTreeList(list);
result.put("api_status", true);
result.put("data", list);
@ -364,9 +308,9 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
item.put("fnumber", rs.getString("fnumber"));
item.put("hasChildren", hasChildren(rs.getString("id"), false));
item.put("fleader", rs.getString("fleader"));
item.put("fleaderlv",convertLevel(rs.getString("fleaderlv")));
item.put("fleaderst",convertGrade(rs.getString("fleaderst")));
item.put("fobjid",rs.getString("fobjid"));
item.put("fleaderlv", convertLevel(rs.getString("fleaderlv")));
item.put("fleaderst", convertGrade(rs.getString("fleaderst")));
item.put("fobjid", rs.getString("fobjid"));
currentList.add(item);
}
@ -397,42 +341,23 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
@Override
public Map<String, Object> asyncCompanyData(Map<String, Object> request2Map, User user) {
String ids = (String) request2Map.get("ids");
String fisvitual = (String) request2Map.get("fisvitual");
String whereSql = companyDateWhereSql(request2Map);
whereSql += " and fparentid in (" + ids + ") ";
RecordSet rs = new RecordSet();
rs.executeQuery("select id, fname, ftype, fparentid, fnumber,fobjid from jcl_org_map " + whereSql);
List<Map<String, Object>> currentList = new ArrayList<>();
if (fisvitual.equals("0")) {
String whereSql = companyDateWhereSql(request2Map);
whereSql += " and fparentid in (" + ids + ") ";
RecordSet rs = new RecordSet();
rs.executeQuery("select id, fname, ftype, fparentid, fnumber,fobjid from jcl_org_map " + whereSql);
// List<Map<String, Object>> currentList = new ArrayList<>();
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname"));
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("hasChildren", hasChildren(rs.getString("id"), true));
currentList.add(item);
}
} else {
String whereSql = "where fparentid in (" + ids + ") ";
RecordSet rs = new RecordSet();
rs.executeQuery("select fid, fname, forder, fparentid, ftype from uf_jcl_vo " + whereSql);
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("fid"));
item.put("fname", rs.getString("fname"));
item.put("ftype", rs.getString("ftype"));
item.put("parentId", rs.getString("fparentid"));
item.put("forder", rs.getString("forder"));
item.put("hasChildren", hasVOChildren(rs.getString("fid")));
currentList.add(item);
}
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
item.put("id", rs.getString("id"));
item.put("fname", rs.getString("fname"));
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("hasChildren", hasChildren(rs.getString("id"), true));
currentList.add(item);
}
Map<String, Object> result = new HashMap<>();
@ -443,7 +368,14 @@ 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.fobjparentid,t.fleader, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber,t.fobjid,t.fecid,t.fleaderlv, t.fleaderst from jcl_org_map t " + whereSql + " and t.fparentid = " + id);
String sql = "select t.id, t.fname, t.ftype, t.fparentid,t.fobjparentid,t.fleader, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber,t.fobjid,t.fecid,t.fleaderlv, t.fleaderst from jcl_org_map t " + whereSql;
DetachUtil detachUtil = new DetachUtil(user.getUID());
if (detachUtil.isDETACH() && "0".equals(id)) {
sql += " and ftype = 1 and fobjid in(" + detachUtil.getJclRoleLevels() + ")";
} else {
sql += " and t.fparentid = " + id;
}
rs.executeQuery(sql);
List<Map<String, Object>> currentList = new ArrayList<>();
while (rs.next()) {
Map<String, Object> item = new HashMap<>();
@ -506,49 +438,53 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
return !"0".equals(count);
}
/**
*
* @return
*/
private boolean hasVOChildren(String fid) {
String whereSql = " where fparentid = " + fid + " ";
grs.executeQuery("select count(1) as count from uf_jcl_vo " + whereSql);
String count = "0";
if (grs.next()) {
count = grs.getString("count");
}
return !"0".equals(count);
}
private String convertLevel(String fLeaderLv) {
String jobLevelName = "";
if (StringUtils.isBlank(fLeaderLv)) {
StringBuilder jobLevelName = new StringBuilder();
if (StringUtils.isNotBlank(fLeaderLv)) {
try {
long parseLong = Long.parseLong(fLeaderLv);
LevelPO levelByID = MapperProxyFactory.getProxy(LevelMapper.class).getLevelByID(parseLong);
if (null != levelByID) {
jobLevelName = levelByID.getLevelName();
String[] split = fLeaderLv.split(",");
for (String s : split) {
long parseLong = Long.parseLong(s);
LevelPO levelByID = MapperProxyFactory.getProxy(LevelMapper.class).getLevelByID(parseLong);
if (null != levelByID) {
jobLevelName.append(levelByID.getLevelName());
}
}
} catch (NumberFormatException exception) {
jobLevelName = fLeaderLv;
jobLevelName = new StringBuilder(fLeaderLv);
}
}
return jobLevelName;
return jobLevelName.toString();
}
private String convertGrade(String fLeaderSt) {
String jobGradeName = "";
if (StringUtils.isBlank(fLeaderSt)) {
StringBuilder jobGradeName = new StringBuilder();
if (StringUtils.isNotBlank(fLeaderSt)) {
try {
long parseLong = Long.parseLong(fLeaderSt);
GradePO gradeByID = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(parseLong);
if (null != gradeByID) {
jobGradeName = gradeByID.getGradeName();
String[] split = fLeaderSt.split(",");
for (String s : split) {
long parseLong = Long.parseLong(s);
GradePO gradeByID = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(parseLong);
if (null != gradeByID) {
jobGradeName.append(gradeByID.getGradeName());
}
}
} catch (NumberFormatException exception) {
jobGradeName = fLeaderSt;
jobGradeName = new StringBuilder(fLeaderSt);
}
}
return jobGradeName;
return jobGradeName.toString();
}
private void reBuildTreeList(List<Map<String, Object>> list) {
// 分部数据,构建层级关系
Set<String> idSet = list.stream().filter(item -> "1".equals(Util.null2String(item.get("ftype")))).map(item -> Util.null2String(item.get("id"))).collect(Collectors.toSet());
list.forEach(item -> {
if ("1".equals(Util.null2String(item.get("ftype"))) && !idSet.contains(Util.null2String(item.get("parentId")))) {
item.put("parentId", "0");
item.put("fobjparentId", "0");
}
});
}
}

@ -78,7 +78,7 @@ public class StaffServiceImpl extends Service implements StaffService {
// 判断编制导入模板是否存在,不存在则创建该文件
static {
try {
String outPutPath = GCONST.getRootPath() + "/hrm/import/template/staff.xls";
String outPutPath = GCONST.getRootPath() + File.separator + "hrm" + File.separator + "import" + File.separator + "template" + File.separator + "staff.xls";
File excelPathFile = new File(outPutPath);
if (!excelPathFile.exists()) {
String columns = "方案编号,方案名称,分部,部门,岗位,编制数";
@ -147,7 +147,7 @@ public class StaffServiceImpl extends Service implements StaffService {
}
int ignoreNull = getStaffMapper().insertIgnoreNull(staffPO);
// 同步组织架构图编制信息
new Thread(new StaffTriggerRunnable(staffPO)).start();
new StaffTriggerRunnable(staffPO).run();
return ignoreNull;
}
@ -186,7 +186,7 @@ public class StaffServiceImpl extends Service implements StaffService {
// 更新主表
int updateStaff = getStaffMapper().updateStaff(staffPO);
// 同步组织架构图编制信息
new Thread(new StaffTriggerRunnable(staffPO)).start();
new StaffTriggerRunnable(staffPO).run();
return updateStaff;
}
@ -198,7 +198,7 @@ public class StaffServiceImpl extends Service implements StaffService {
List<StaffPO> staffsByIds = getStaffMapper().getStaffsByIds(ids);
int deleteByIds = getStaffMapper().deleteByIds(ids);
for (StaffPO staffsById : staffsByIds) {
new Thread(new StaffTriggerRunnable(staffsById)).start();
new StaffTriggerRunnable(staffsById).run();
}
return deleteByIds;
}

@ -2,23 +2,22 @@ package com.engine.organization.thread;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.logview.bo.FieldBaseEquator;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.personnelcard.User;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.mapper.trigger.CompTriggerMapper;
import com.engine.organization.util.OrganizationDateUtil;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import weaver.common.DateUtil;
import weaver.hrm.passwordprotection.domain.HrmResource;
import java.sql.Date;
import java.util.Calendar;
import java.util.List;
/**
* @author:dxfeng
@ -52,80 +51,76 @@ public class CompanyTriggerRunnable implements Runnable {
@Override
public void run() {
FieldBaseEquator fieldBaseEquator = new FieldBaseEquator();
List<String> diffFields = fieldBaseEquator.getDiffFieldList(oldCompany, newCompany);
if (CollectionUtils.isEmpty(diffFields)) {
return;
}
// 判断
if (diffFields.contains("compName") || diffFields.contains("compPrincipal") || diffFields.contains("parentCompany") || diffFields.contains("forbiddenTag") || diffFields.contains("deleteType")) {
JclOrgMap jclMap = new JclOrgMap();
jclMap.setFType(1);
// 更新逻辑
jclMap.setFObjId(newCompany.getId().intValue());
jclMap.setId(newCompany.getId().intValue());
jclMap.setUuid(newCompany.getUuid());
jclMap.setFNumber(newCompany.getCompNo());
jclMap.setFName(newCompany.getCompName());
jclMap.setFLeader(newCompany.getCompPrincipal());
jclMap.setFParentId(null == newCompany.getParentCompany() ? 0 : newCompany.getParentCompany().intValue());
jclMap.setFObjParentId(null == newCompany.getParentCompany() ? 0 : newCompany.getParentCompany().intValue());
jclMap.setFEcId(getCompTriggerMapper().getEcCompanyIdByUuid(jclMap.getUuid()));
jclMap.setFClass(0);
jclMap.setFClassName("行政维度");
HrmResource hrmResourceById = getCompTriggerMapper().getHrmResourceById(jclMap.getFLeader());
if (null != hrmResourceById) {
jclMap.setFLeaderImg(hrmResourceById.getMessagerurl());
jclMap.setFLeaderName(hrmResourceById.getLastname());
jclMap.setFLeaderJobId(hrmResourceById.getJobtitle());
JclOrgMap jclMap = new JclOrgMap();
jclMap.setFType(1);
// 更新逻辑
jclMap.setFObjId(newCompany.getId().intValue());
jclMap.setId(newCompany.getId().intValue());
jclMap.setUuid(newCompany.getUuid());
jclMap.setFNumber(newCompany.getCompNo());
jclMap.setFName(newCompany.getCompName());
jclMap.setFParentId(null == newCompany.getParentCompany() ? 0 : newCompany.getParentCompany().intValue());
jclMap.setFObjParentId(null == newCompany.getParentCompany() ? 0 : newCompany.getParentCompany().intValue());
jclMap.setFEcId(getCompTriggerMapper().getEcCompanyIdByUuid(jclMap.getUuid()));
jclMap.setFClass(0);
jclMap.setFClassName("行政维度");
Integer ecResourceId = newCompany.getCompPrincipal();
HrmResourcePO hrmResourcePO = getCompTriggerMapper().getResourceByEcId(ecResourceId);
if (null != hrmResourcePO) {
jclMap.setFLeader(hrmResourcePO.getId().intValue());
jclMap.setFLeaderName(hrmResourcePO.getLastName());
jclMap.setFLeaderJobId(hrmResourcePO.getJobTitle().intValue());
jclMap.setFLeaderSt(hrmResourcePO.getJobGrade());
jclMap.setFLeaderLv(hrmResourcePO.getJobLevel());
String image = User.builder().image(hrmResourcePO.getResourceImageId()).build().getImage();
jclMap.setFLeaderImg(image);
if (null != hrmResourcePO.getJobTitle()) {
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(hrmResourcePO.getJobTitle());
if (null != jobById) {
jclMap.setFLeaderJob(jobById.getJobName());
}
}
}
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
HrmResourcePO resourceByEcId = getCompTriggerMapper().getResourceByEcId(jclMap.getFLeader());
if (null != resourceByEcId) {
jclMap.setFLeaderSt(resourceByEcId.getJobGrade());
jclMap.setFLeaderLv(resourceByEcId.getJobLevel());
}
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(jclMap.getFType(),jclMap.getFObjId().toString(),null, null);
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), jclMap.getFObjId().toString());
if (null != jclOrgMapByObjID) {
jclMap.setFPlan(jclOrgMapByObjID.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
} else {
jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(0);
}
jclMap.setFIsVitual(0);
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
Calendar cal = Calendar.getInstance();
cal.setTime(jclMap.getFDateBegin());
Calendar calendar = DateUtil.addDay(cal, -1);
Date time = new Date(calendar.getTime().getTime());
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(jclMap.getFType(), jclMap.getFObjId().toString(), null, null);
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), jclMap.getFObjId().toString());
if (null != jclOrgMapByObjID) {
jclMap.setFPlan(jclOrgMapByObjID.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
} else {
jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(0);
}
jclMap.setFIsVitual(0);
if (1 != newCompany.getDeleteType() && 1 != newCompany.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
}
if (null != jclOrgMapByObjID) {
if (null != jclOrgMapByObjID.getFParentId()) {
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
}
Calendar cal = Calendar.getInstance();
cal.setTime(jclMap.getFDateBegin());
Calendar calendar = DateUtil.addDay(cal, -1);
Date time = new Date(calendar.getTime().getTime());
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
if (1 != newCompany.getDeleteType() && 1 != newCompany.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
}
if (null != jclOrgMapByObjID) {
if (null != jclOrgMapByObjID.getFParentId()) {
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
}
if (null != oldCompany) {
if(null != oldCompany.getId()){
updateParentPlanAndJob(jclMap.getFDateBegin(), oldCompany.getId().toString());
}
}
if (null != oldCompany) {
if (null != oldCompany.getId()) {
updateParentPlanAndJob(jclMap.getFDateBegin(), oldCompany.getId().toString());
}
}
}
@ -138,9 +133,9 @@ public class CompanyTriggerRunnable implements Runnable {
if (null != parentJclOrgMap) {
// 上级部门当前在编、在岗数
JclOrgMap jclOrgMapSum = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, parentJclOrgMap.getId().toString());
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(parentJclOrgMap.getFType(),parentId,null, null);
StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(parentJclOrgMap.getFType(), parentId, null, null);
if (null != jclOrgMapSum) {
parentJclOrgMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0 ) + jclOrgMapSum.getFPlan());
parentJclOrgMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMapSum.getFPlan());
parentJclOrgMap.setFOnJob(jclOrgMapSum.getFOnJob());
} else {
parentJclOrgMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);

@ -2,12 +2,15 @@ package com.engine.organization.thread;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.logview.bo.FieldBaseEquator;
import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.personnelcard.User;
import com.engine.organization.entity.staff.po.StaffPO;
import com.engine.organization.enums.ModuleTypeEnum;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.staff.StaffMapper;
import com.engine.organization.mapper.trigger.CompTriggerMapper;
import com.engine.organization.mapper.trigger.DepartmentTriggerMapper;
@ -16,7 +19,6 @@ import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import weaver.common.DateUtil;
import weaver.general.Util;
import weaver.hrm.passwordprotection.domain.HrmResource;
import java.sql.Date;
import java.util.Calendar;
@ -96,7 +98,6 @@ public class DepartmentTriggerRunnable implements Runnable {
jclMap.setUuid(newDepartment.getUuid());
jclMap.setFNumber(newDepartment.getDeptNo());
jclMap.setFName(newDepartment.getDeptName());
jclMap.setFLeader(null == newDepartment.getDeptPrincipal() ? null : newDepartment.getDeptPrincipal().intValue());
jclMap.setFParentId(null == newDepartment.getParentDept() ? newDepartment.getParentComp().intValue() : newDepartment.getParentDept().intValue() + st);
jclMap.setFObjParentId(null == newDepartment.getParentDept() ? newDepartment.getParentComp().intValue() : newDepartment.getParentDept().intValue());
@ -104,22 +105,24 @@ public class DepartmentTriggerRunnable implements Runnable {
jclMap.setFClass(0);
jclMap.setFClassName("行政维度");
HrmResource hrmResourceById = getCompTriggerMapper().getHrmResourceById(jclMap.getFLeader());
if (null != hrmResourceById) {
jclMap.setFLeaderImg(hrmResourceById.getMessagerurl());
jclMap.setFLeaderName(hrmResourceById.getLastname());
jclMap.setFLeaderJobId(hrmResourceById.getJobtitle());
Integer ecResourceId = null == newDepartment.getDeptPrincipal() ? null : newDepartment.getDeptPrincipal().intValue();
HrmResourcePO hrmResourcePO = getCompTriggerMapper().getResourceByEcId(ecResourceId);
if (null != hrmResourcePO) {
jclMap.setFLeader(hrmResourcePO.getId().intValue());
jclMap.setFLeaderName(hrmResourcePO.getLastName());
jclMap.setFLeaderJobId(hrmResourcePO.getJobTitle().intValue());
jclMap.setFLeaderSt(hrmResourcePO.getJobGrade());
jclMap.setFLeaderLv(hrmResourcePO.getJobLevel());
String image = User.builder().image(hrmResourcePO.getResourceImageId()).build().getImage();
jclMap.setFLeaderImg(image);
if (null != hrmResourcePO.getJobTitle()) {
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(hrmResourcePO.getJobTitle());
if (null != jobById) {
jclMap.setFLeaderJob(jobById.getJobName());
}
}
}
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
HrmResourcePO resourceByEcId = getCompTriggerMapper().getResourceByEcId(jclMap.getFLeader());
if (null != resourceByEcId) {
jclMap.setFLeaderSt(resourceByEcId.getJobGrade());
jclMap.setFLeaderLv(resourceByEcId.getJobLevel());
}
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
@ -127,7 +130,6 @@ public class DepartmentTriggerRunnable implements Runnable {
// 获取当前生效的本部门map记录
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.departmentfielddefined.getValue().toString(), Util.null2String(jclMap.getFObjId()));
StaffPO staffPO = new StaffPO();
// StaffPO staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(null,jclMap.getFObjId().toString(), null);
switch (jclMap.getFType()) {
// 分部
case 1:
@ -146,7 +148,7 @@ public class DepartmentTriggerRunnable implements Runnable {
if (null != jclOrgMapByObjID) {
if (null != jclOrgMap) {
jclMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMap.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob());
jclMap.setFOnJob(jclOrgMap.getFOnJob());
} else {
jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
@ -192,11 +194,11 @@ public class DepartmentTriggerRunnable implements Runnable {
StaffPO staffPO = new StaffPO();
switch (parentJclOrgMap.getFType()) {
case 1:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(1,parentId, null, null);
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(1,Util.null2String(parentJclOrgMap.getFObjId()), null, null);
break;
// 部门
case 2:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2,null, parentId, null);
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2, null, Util.null2String(parentJclOrgMap.getFObjId()), null);
break;
}
// 编制表jcl_org_staff中的编制数+下级编制数,工具类判断
@ -222,4 +224,4 @@ public class DepartmentTriggerRunnable implements Runnable {
}
}
}
}
}

@ -1,9 +1,12 @@
package com.engine.organization.thread;
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.map.JclOrgMap;
import com.engine.organization.entity.personnelcard.User;
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.trigger.CompTriggerMapper;
import com.engine.organization.mapper.trigger.HrmResourceTriggerMapper;
import com.engine.organization.util.OrganizationDateUtil;
@ -50,7 +53,9 @@ public class HrmResourceTriggerRunnable implements Runnable {
jclMap.setFType(4);
// 查询当前人员信息数据
String ecResourceId = getHrmResourceMapper().getEcResourceId(userId.toString());
// EC人员
HrmResource ecHrmResource = getHrmResourceTriggerMapper().getHrmResource(Long.parseLong(ecResourceId));
// 聚才林人员
HrmResourcePO hrmResource = getCompTriggerMapper().getResourceByEcId(Integer.parseInt(ecResourceId));
if (null != hrmResource && null!=ecHrmResource) {
jclMap.setFObjId(hrmResource.getId().intValue());
@ -60,22 +65,23 @@ public class HrmResourceTriggerRunnable implements Runnable {
jclMap.setFName(hrmResource.getLastName());
jclMap.setUuid(hrmResource.getUuid());
delete = hrmResource.getStatus() < 4 ? 0 : 1;
jclMap.setFLeaderImg(ecHrmResource.getMessagerurl());
// 展示为花名册上传的照片
String image = User.builder().image(hrmResource.getResourceImageId()).build().getImage();
jclMap.setFLeaderImg(image);
jclMap.setFLeaderName(hrmResource.getLastName());
jclMap.setFLeaderJobId(hrmResource.getJobTitle().intValue());
HrmResourcePO resourceByEcId = getCompTriggerMapper().getResourceByEcId(Integer.parseInt(ecResourceId));
if (null != resourceByEcId) {
Long jobTitle = resourceByEcId.getJobTitle();
if (null!=jobTitle) {
jclMap.setFObjParentId(jobTitle.intValue());
jclMap.setFParentId(jclMap.getFObjParentId() + sj);
if (null != hrmResource.getJobTitle()) {
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(hrmResource.getJobTitle());
if (null != jobById) {
jclMap.setFLeaderJob(jobById.getJobName());
}
jclMap.setFLeaderSt(resourceByEcId.getJobGrade());
jclMap.setFLeaderLv(resourceByEcId.getJobLevel());
jclMap.setFObjParentId(hrmResource.getJobTitle().intValue());
jclMap.setFParentId(jclMap.getFObjParentId() + sj);
}
jclMap.setFLeaderSt(hrmResource.getJobGrade());
jclMap.setFLeaderLv(hrmResource.getJobLevel());
jclMap.setFClass(0);
jclMap.setFClassName("行政维度");
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
@ -93,14 +99,13 @@ public class HrmResourceTriggerRunnable implements Runnable {
if (0 == delete) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
// 更新当前架构图负责人的卡片信息
getHrmResourceTriggerMapper().updateLeaders(currentDate, hrmResource.getId().toString(), jclMap.getFLeaderImg(), jclMap.getFLeaderName(), jclMap.getFLeaderJobId(), jclMap.getFLeaderJob(), jclMap.getFLeaderLv(), jclMap.getFLeaderSt());
getHrmResourceTriggerMapper().updateLeaders(jclMap.getFDateBegin(), hrmResource.getId().toString(), jclMap.getFLeaderImg(), jclMap.getFLeaderName(), jclMap.getFLeaderJobId(), jclMap.getFLeaderJob(), jclMap.getFLeaderLv(), jclMap.getFLeaderSt());
// 更新组织架构图在岗数
if (null == jclOrgMapByObjID) {
new StaffTriggerRunnable(jclMap.getFObjParentId()).run();
} else if (!jclMap.getFObjParentId().equals(jclOrgMapByObjID.getFObjParentId())) {
if (null != jclOrgMapByObjID) {
new StaffTriggerRunnable(jclOrgMapByObjID.getFObjParentId()).run();
new StaffTriggerRunnable(jclMap.getFObjParentId()).run();
}
new StaffTriggerRunnable(jclMap.getFObjParentId()).run();
} else if (null != jclOrgMapByObjID) {
new StaffTriggerRunnable(jclOrgMapByObjID.getFObjParentId()).run();
}

@ -42,7 +42,8 @@ public class JobTriggerRunnable implements Runnable {
this.oldJob = oldJob;
this.newJob = newJob;
}
public JobTriggerRunnable(Boolean forbiddenTag,JobPO oldJob, JobPO newJob) {
public JobTriggerRunnable(Boolean forbiddenTag, JobPO oldJob, JobPO newJob) {
this.oldJob = oldJob;
this.newJob = newJob;
this.forbiddenTag = forbiddenTag;
@ -52,7 +53,8 @@ public class JobTriggerRunnable implements Runnable {
this.oldJob = new JobPO();
this.newJob = MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId);
}
public JobTriggerRunnable(Long oldJobId,Long newJobId) {
public JobTriggerRunnable(Long oldJobId, Long newJobId) {
this.oldJob = MapperProxyFactory.getProxy(JobMapper.class).getJobById(oldJobId);
this.newJob = MapperProxyFactory.getProxy(JobMapper.class).getJobById(newJobId);
}
@ -71,84 +73,83 @@ public class JobTriggerRunnable implements Runnable {
return;
}
// 判断
if (diffFields.contains("jobName") || diffFields.contains("parentDept") || diffFields.contains("parentJob") || diffFields.contains("forbiddenTag") || diffFields.contains("deleteType")) {
JclOrgMap jclMap = new JclOrgMap();
int st = 100000000;
int sj = 200000000;
jclMap.setFType(3);
// 更新逻辑
jclMap.setFObjId(newJob.getId().intValue());
jclMap.setId(newJob.getId().intValue() + sj);
jclMap.setFNumber(newJob.getJobNo());
jclMap.setFName(newJob.getJobName());
jclMap.setFParentId(null == newJob.getParentJob() ? newJob.getParentDept().intValue() + st : newJob.getParentJob().intValue() + sj);
jclMap.setFObjParentId(null == newJob.getParentJob() ? newJob.getParentDept().intValue() : newJob.getParentJob().intValue());
Integer parentdept = newJob.getParentDept().intValue();
jclMap.setFClass(0);
jclMap.setFClassName("行政维度");
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID( jclMap.getFDateBegin(), ModuleTypeEnum.jobfielddefined.getValue().toString(), jclMap.getFObjId().toString());
// 该岗位有下级岗位时,查询
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString());
StaffPO staffPO = new StaffPO();
switch (jclMap.getFType()) {
// 部门
case 2:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2,null, jclMap.getFObjId().toString(), null);
break;
// 岗位
case 3:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(3,null, null, jclMap.getFObjId().toString());
break;
default:
break;
}
if (null != jclOrgMapByObjID) {
if (null != jclOrgMap) {
jclMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMap.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob());
} else {
jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
}
JclOrgMap jclMap = new JclOrgMap();
int st = 100000000;
int sj = 200000000;
jclMap.setFType(3);
// 更新逻辑
jclMap.setFObjId(newJob.getId().intValue());
jclMap.setId(newJob.getId().intValue() + sj);
jclMap.setFNumber(newJob.getJobNo());
jclMap.setFName(newJob.getJobName());
jclMap.setFParentId(null == newJob.getParentJob() ? newJob.getParentDept().intValue() + st : newJob.getParentJob().intValue() + sj);
jclMap.setFObjParentId(null == newJob.getParentJob() ? newJob.getParentDept().intValue() : newJob.getParentJob().intValue());
Integer parentdept = newJob.getParentDept().intValue();
jclMap.setFClass(0);
jclMap.setFClassName("行政维度");
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.jobfielddefined.getValue().toString(), jclMap.getFObjId().toString());
// 该岗位有下级岗位时,查询
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString());
StaffPO staffPO = new StaffPO();
switch (jclMap.getFType()) {
// 部门
case 2:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(2, null, jclMap.getFObjId().toString(), null);
break;
// 岗位
case 3:
staffPO = MapperProxyFactory.getProxy(StaffMapper.class).getStaffsByParamId(3, null, null, jclMap.getFObjId().toString());
break;
default:
break;
}
if (null != jclOrgMapByObjID) {
if (null != jclOrgMap) {
jclMap.setFPlan((null != staffPO ? staffPO.getStaffNum() : 0) + jclOrgMap.getFPlan());
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob() + jclOrgMap.getFOnJob());
} else {
jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(0);
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
}
jclMap.setFIsVitual(0);
} else {
jclMap.setFPlan(null != staffPO ? staffPO.getStaffNum() : 0);
jclMap.setFOnJob(0);
}
jclMap.setFIsVitual(0);
Calendar cal = Calendar.getInstance();
cal.setTime(jclMap.getFDateBegin());
Calendar calendar = DateUtil.addDay(cal, -1);
Date time = new Date(calendar.getTime().getTime());
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
Calendar cal = Calendar.getInstance();
cal.setTime(jclMap.getFDateBegin());
Calendar calendar = DateUtil.addDay(cal, -1);
Date time = new Date(calendar.getTime().getTime());
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
if (1 != newJob.getDeleteType() && 1 != newJob.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
}
if (null != jclOrgMapByObjID) {
if(null != jclOrgMapByObjID.getFParentId()){
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
}
}
// 部门启用,刷新上级数据
if(forbiddenTag){
updateParentPlanAndJob(jclMap.getFDateBegin(), jclMap.getFParentId().toString());
if (1 != newJob.getDeleteType() && 1 != newJob.getForbiddenTag()) {
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
}
if (null != jclOrgMapByObjID) {
if (null != jclOrgMapByObjID.getFParentId()) {
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
}
if (null != oldJob) {
if (null != oldJob.getId()){
updateParentPlanAndJob(jclMap.getFDateBegin(), oldJob.getId().toString());
}
}
// 部门启用,刷新上级数据
if (forbiddenTag) {
updateParentPlanAndJob(jclMap.getFDateBegin(), jclMap.getFParentId().toString());
}
if (null != oldJob) {
if (null != oldJob.getId()) {
updateParentPlanAndJob(jclMap.getFDateBegin(), oldJob.getId().toString());
}
}
}
/**
@ -198,4 +199,4 @@ public class JobTriggerRunnable implements Runnable {
}
}
}
}
}

@ -176,7 +176,7 @@ public class StaffTriggerRunnable implements Runnable {
getJclOrgMapper().updateMap(type, objId, currentDate, yesterday);
jclOrgMapByObjID.setFPlan(addInteger(planSum, childPlanSum));
jclOrgMapByObjID.setFOnJob(addInteger(onJobSum, childOnJobSum));
jclOrgMapByObjID.setFDateBegin(new Date(System.currentTimeMillis()));
jclOrgMapByObjID.setFDateBegin(currentDate);
getJclOrgMapper().insertMap(jclOrgMapByObjID);
}

@ -0,0 +1,33 @@
package com.engine.organization.transmethod;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/26
* @Version V1.0
**/
public class ManagerDetachTransMethod {
public static String getManagerName(String ecManager) {
String managerName = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(Long.valueOf(ecManager));
return managerName;
}
public static String getRoleLevel(String ecRolelevel) {
List<Map<String, Object>> maps = MapperProxyFactory.getProxy(SystemDataMapper.class).getBrowserDatas(DeleteParam.builder().ids(ecRolelevel).build().getIds());
String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
return names;
}
}

@ -0,0 +1,79 @@
package com.engine.organization.util.detach;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.job.dto.JobListDTO;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.service.impl.ManagerDetachServiceImpl;
import com.weaver.general.BaseBean;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2022/10/28
* @version: 1.0
*/
public class DetachUtil {
private boolean DETACH = "true".equals(new BaseBean().getPropValue("hrmOrganization", "detach"));
private final List<Long> jclRoleLevels;
public DetachUtil(Integer uId) {
if (1 == uId) {
DETACH = false;
}
if (DETACH) {
jclRoleLevels = ManagerDetachServiceImpl.getJclRoleLevels(uId);
} else {
jclRoleLevels = new ArrayList<>();
}
}
/**
*
*/
public void filterCompanyList(List<CompPO> companyList) {
if (DETACH && CollectionUtils.isNotEmpty(companyList)) {
companyList.removeIf(item -> !jclRoleLevels.contains(item.getId()));
}
}
/**
*
*/
public void filterDepartmentList(List<DepartmentPO> departmentList) {
if (DETACH && CollectionUtils.isNotEmpty(departmentList)) {
departmentList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
}
}
/**
*
*/
public void filterJobDTOList(List<JobListDTO> jobList) {
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
}
}
/**
*
*/
public void filterJobList(List<JobPO> jobList) {
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
}
}
public String getJclRoleLevels() {
return StringUtils.join(jclRoleLevels, ",");
}
public boolean isDETACH() {
return DETACH;
}
}

@ -12,6 +12,7 @@ import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.util.Arrays;
import java.util.List;
/**
@ -80,6 +81,19 @@ public class EcHrmRelationUtil {
return getCompMapper().getCompanyByUUID(uuid);
}
public static String getBatchJclCompanyId(String ecBatchCompanyId) {
if (StringUtils.isBlank(ecBatchCompanyId)) {
return null;
}
List<String> strings = Arrays.asList(ecBatchCompanyId.split(","));
List<String> uuids = getSystemDataMapper().getBatchUuidByIds(HRM_COMPANY, strings);
List<Long> companyIdsByUuid = getCompMapper().getCompanyIdsByUuid(uuids);
if (CollectionUtils.isNotEmpty(companyIdsByUuid)) {
return StringUtils.join(companyIdsByUuid, ",");
}
return "";
}
public static DepartmentPO getJclDepartmentId(String ecDepartmentId) {
if (StringUtils.isBlank(ecDepartmentId)) {

@ -138,7 +138,7 @@ public class StaffInfoImportUtil {
// 分部
if ("comp_id".equals(infoPO.getFieldName())) {
String[] split = cellValue.split(">");
if (split.length > 0) {
if (split.length > 0 && StringUtils.isNotBlank(cellValue)) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("分部层级不能大于10");
historyDetailPO.setStatus("0");
@ -161,7 +161,7 @@ public class StaffInfoImportUtil {
// 部门
if ("dept_id".equals(infoPO.getFieldName())) {
String[] split = cellValue.split(">");
if (split.length > 0) {
if (split.length > 0 && StringUtils.isNotBlank(cellValue)) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("部门层级不能大于10");
historyDetailPO.setStatus("0");
@ -194,7 +194,7 @@ public class StaffInfoImportUtil {
continue nextRow;
}
String[] split = cellValue.split(">");
if (split.length > 0) {
if (split.length > 0 && StringUtils.isNotBlank(cellValue)) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("岗位层级不能大于10");
historyDetailPO.setStatus("0");

@ -89,11 +89,15 @@ public class SearchTreeUtil {
public static List<SearchTree> builderTreeMode(List<SearchTree> treeList) {
List<SearchTree> sortedList = treeList.stream().sorted(Comparator.comparing(SearchTree::getOrderNum)).collect(Collectors.toList());
Map<String, List<TreeNode>> collects = sortedList.stream().collect(Collectors.groupingBy(TreeNode::getPid));
return sortedList.stream().peek(e -> e.setSubs(collects.get(e.getId()))).peek(item -> {
if (CollectionUtils.isNotEmpty(item.getSubs())) {
item.setIsParent(true);
Set<String> leafIds = new HashSet<>();
List<SearchTree> collect = sortedList.stream().peek(e -> {
e.setSubs(collects.get(e.getId()));
leafIds.add(e.getId());
if (CollectionUtils.isNotEmpty(e.getSubs())) {
e.setIsParent(true);
}
}).filter(item -> isTop(item.getPid())).collect(Collectors.toList());
}).collect(Collectors.toList());
return collect.stream().filter(item -> !leafIds.contains(item.getPid())).collect(Collectors.toList());
}
/**
@ -107,8 +111,9 @@ public class SearchTreeUtil {
Map<String, List<TreeNode>> parentMap = treeList.stream().collect(Collectors.groupingBy(TreeNode::getPid));
Map<String, List<SearchTree>> childMap = deptTrees.stream().collect(Collectors.groupingBy(SearchTree::getParentComp));
boolean isAdd = !childMap.isEmpty();
return treeList.stream().peek(e -> {
List<TreeNode> treeNodes = new ArrayList<>();
Set<String> leafIds = new HashSet<>();
List<SearchTree> collect = treeList.stream().peek(e -> {
Set<TreeNode> treeNodes = new HashSet<>();
List<TreeNode> nodes = parentMap.get(e.getId());
if (CollectionUtils.isNotEmpty(nodes)) {
treeNodes.addAll(nodes);
@ -119,12 +124,14 @@ public class SearchTreeUtil {
if (CollectionUtils.isNotEmpty(e.getSubs())) {
treeNodes.addAll(e.getSubs());
}
e.setSubs(treeNodes);
}).peek(item -> {
e.setSubs(new ArrayList<>(treeNodes));
leafIds.add(e.getId());
}).collect(Collectors.toList());
return collect.stream().peek(item -> {
if (CollectionUtils.isNotEmpty(item.getSubs())) {
item.setIsParent(true);
}
}).filter(item -> isTop(item.getPid())).collect(Collectors.toList());
}).filter(item -> !leafIds.contains(item.getPid())).collect(Collectors.toList());
}
/**

@ -0,0 +1,11 @@
package com.engine.organization.web;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/1
* @Version V1.0
**/
public class CardAccessController {
}

@ -0,0 +1,134 @@
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.detach.param.ManagerDetachParam;
import com.engine.organization.util.response.ReturnResult;
import com.engine.organization.wrapper.ManagerDetachWrapper;
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.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/21
* @Version V1.0
**/
public class ManagerDetachController {
public ManagerDetachWrapper getManagerDetachWrapper(User user) {
return ServiceUtil.getService(ManagerDetachWrapper.class,user);
}
@GET
@Path("/getTable")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult listScheme(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> map = ParamUtil.request2Map(request);
return ReturnResult.successed(getManagerDetachWrapper(user).listPage(map));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e);
}
}
@GET
@Path("/getTableBtn")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getTableBtn(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getManagerDetachWrapper(user).getTableBtn());
} 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(getManagerDetachWrapper(user).getSearchCondition());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e);
}
}
@GET
@Path("/getForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getForm(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("id") Integer id) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getManagerDetachWrapper(user).getForm(id));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e);
}
}
@POST
@Path("/deleteByIds")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeleteParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getManagerDetachWrapper(user).deleteByIds(param.getIds()));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e);
}
}
@POST
@Path("/save")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult saveScheme(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ManagerDetachParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getManagerDetachWrapper(user).save(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e);
}
}
@POST
@Path("/update")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateScheme(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ManagerDetachParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getManagerDetachWrapper(user).updateDetach(param));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e);
}
}
@GET
@Path("/doDetach")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult doDetach(@Context HttpServletRequest request,@Context HttpServletResponse response,
@QueryParam("idDetach") String isDetach) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getManagerDetachWrapper(user).doDetach(isDetach));
} catch (Exception e) {
return ReturnResult.exceptionHandle(e);
}
}
}

@ -0,0 +1,12 @@
package com.engine.organization.wrapper;
import com.engine.organization.util.OrganizationWrapper;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/1
* @Version V1.0
**/
public class CardAccessWrapper extends OrganizationWrapper {
}

@ -109,7 +109,7 @@ public class CompWrapper extends OrganizationWrapper {
for (CompPO compsById : compsByIds) {
writeOperateLog(new Object() {
}.getClass(), compsById.getCompName(), JSON.toJSONString(ids), "删除分部信息");
new Thread(new CompanyTriggerRunnable(compsById)).start();
new CompanyTriggerRunnable(compsById).run();
}
return deleteByIds;
}

@ -133,7 +133,6 @@ public class DepartmentWrapper extends OrganizationWrapper {
DepartmentPO newDeptById = getDepartmentMapper().getDeptById(id);
writeOperateLog(new Object() {
}.getClass(), deptById.getDeptName(), JSON.toJSONString(params), deptById, newDeptById);
new Thread(new DepartmentTriggerRunnable(deptById, newDeptById)).start();
return departmentId;
}
@ -150,7 +149,7 @@ public class DepartmentWrapper extends OrganizationWrapper {
writeOperateLog(new Object() {
}.getClass(), departmentPO.getDeptName(), JSON.toJSONString(ids), "删除部门");
// 更新组织架构图
new Thread(new DepartmentTriggerRunnable(departmentPO)).start();
new DepartmentTriggerRunnable(departmentPO).run();
}
return deleteByIds;
}

@ -135,7 +135,7 @@ public class JobWrapper extends OrganizationWrapper {
writeOperateLog(new Object() {
}.getClass(), jobById.getJobName(), JSON.toJSONString(params), jobById, newJobById);
// 更新组织架构图
new Thread(new JobTriggerRunnable(jobById, newJobById)).start();
return jobId;
}
@ -189,7 +189,7 @@ public class JobWrapper extends OrganizationWrapper {
writeOperateLog(new Object() {
}.getClass(), jobPO.getJobName(), JSON.toJSONString(ids), "删除岗位");
// 更新组织架构图
new Thread(new JobTriggerRunnable(jobPO)).start();
new JobTriggerRunnable(jobPO).run();
}
return deleteByIds;
}

@ -0,0 +1,93 @@
package com.engine.organization.wrapper;
import com.alibaba.fastjson.JSON;
import com.api.browser.bean.SearchConditionGroup;
import com.api.browser.bean.SearchConditionItem;
import com.engine.common.util.ServiceUtil;
import com.engine.organization.annotation.Log;
import com.engine.organization.entity.detach.param.ManagerDetachParam;
import com.engine.organization.entity.detach.po.ManagerDetachPO;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.detach.ManagerDetachMapper;
import com.engine.organization.service.ManagerDetachService;
import com.engine.organization.service.impl.ManagerDetachServiceImpl;
import com.engine.organization.util.MenuBtn;
import com.engine.organization.util.OrganizationFormItemUtil;
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/10/21
* @Version V1.0
**/
public class ManagerDetachWrapper extends OrganizationWrapper {
public ManagerDetachService getManagerDetachService(User user) {
return ServiceUtil.getService(ManagerDetachServiceImpl.class,user);
}
public Map<String, Object> listPage(Map<String, Object> params) {
return getManagerDetachService(user).listPage(params);
}
public Map<String, List<MenuBtn>> getTableBtn() {
return MenuBtn.getCommonBtnDatas();
}
public Map<String, Object> getSearchCondition() {
Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> conditionItems = new ArrayList<>();
SearchConditionItem ecManager = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "管理员名称", "ecManager");
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "可管理组织机构", "164", "ecRolelevel", "");
conditionItems.add(ecManager);
conditionItems.add(ecRolelevel);
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
apiDatas.put("conditions", addGroups);
return apiDatas;
}
public Map<String, Object> getForm(Integer id) {
return getManagerDetachService(user).getForm(id);
}
@Log(operateType = OperateTypeEnum.DELETE,operateModule = LogModuleNameEnum.DETACH,operateDesc = "删除分权数据")
public int deleteByIds(Collection<Long> ids) {
List<ManagerDetachPO> managerDetachPOS = MapperProxyFactory.getProxy(ManagerDetachMapper.class).selectByIds(ids);
int deleteByIds = getManagerDetachService(user).deleteByIds(ids);
for (ManagerDetachPO managerDetachPO : managerDetachPOS) {
writeOperateLog(new Object() {
}.getClass(), String.valueOf(managerDetachPO.getEcManager()), JSON.toJSONString(ids), "删除等级方案");
}
return deleteByIds;
}
@Log(operateType = OperateTypeEnum.ADD,operateModule = LogModuleNameEnum.DETACH,operateDesc = "新增分权管理员")
public int save(ManagerDetachParam param) {
int save = getManagerDetachService(user).save(param);
writeOperateLog(new Object() {
}.getClass(), String.valueOf(param.getEcManager()), JSON.toJSONString(param), "新增分权管理员");
return save;
}
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.DETACH, operateDesc = "分权数据更新")
public int updateDetach(ManagerDetachParam param) {
ManagerDetachPO managerDetachPO = MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachById(param.getId());
int result = getManagerDetachService(user).updateDetach(param);
writeOperateLog(new Object() {
}.getClass(), String.valueOf(managerDetachPO.getEcManager()), JSON.toJSONString(param), managerDetachPO, MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachById(param.getId()));
return result;
}
public String doDetach(String isDetach) {
return getManagerDetachService(user).doDetach(isDetach);
}
}
Loading…
Cancel
Save