Merge pull request 'develop' (#169) from develop into master

Reviewed-on: #169
cx0418hd
liang.cheng 2 years ago
commit e76432ae1a

@ -3,35 +3,16 @@
#### 介绍
聚才林组织模块代码
#### 软件架构
软件架构说明
#### 版本1.0 已封版
该版本组织分为2套数据 采用单向同步的方式
#### 安装教程
#### 功能介绍
1. xxxx
2. xxxx
3. xxxx
组织架构图
组织分权
人员卡片等自定义功能
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
#### 迭代计划
由于当前版本两套数据不好管理 下版计划将数据源统一换成ecology数据源

@ -593,4 +593,17 @@ create table JCL_ORG_CARDBUTTON (
create_time date null,
update_time date null,
constraint JCL_ORG_CARDBUTTON_PK primary key (id)
);
--v2.0
-- JCl_ORG_RESOURCEEXTEND //id是人员ID 非自增
create table JCl_ORG_RESOURCEEXTEND (
id int not null,
scheme int null,
level_id int null,
grade int null,
sequence int null,
constraint JCl_ORG_RESOURCEEXTEND_PK primary key (id)
);

@ -0,0 +1,61 @@
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="com.engine.organization.entity.staff.po.StaffPO" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.engine.organization.entity.job.po.JobPO" %>
<%@ page import="com.engine.organization.util.db.MapperProxyFactory" %>
<%@ page import="com.engine.organization.mapper.job.JobMapper" %>
<%@ page import="com.engine.organization.entity.staff.bo.StaffBO" %>
<%@ page import="com.engine.organization.mapper.staff.StaffMapper" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%
RecordSet rs = new RecordSet();
List<StaffPO> staffPOList = new ArrayList<>();
String sql = "select * from jcl_org_staff where permanent_num = 0 and is_used = 0 and delete_type = 0";
rs.executeQuery(sql);
while (rs.next()) {
StaffPO staffPO = new StaffPO();
staffPO.setId(-1 == rs.getInt("id") ? 0L : (long) rs.getInt("id"));
staffPO.setPlanId(-1 == rs.getInt("plan_id") ? 0L : (long) rs.getInt("plan_id"));
staffPO.setCompId(-1 == rs.getInt("comp_id") ? 0 : rs.getInt("comp_id"));
staffPO.setEcCompany(-1 == rs.getInt("ec_company") ? 0 : rs.getInt("ec_company"));
staffPO.setDeptId(-1 == rs.getInt("dept_id") ? 0 : rs.getInt("dept_id"));
staffPO.setEcDepartment(-1 == rs.getInt("ec_department") ? 0 : rs.getInt("ec_department"));
staffPO.setJobId(-1 == rs.getInt("job_id") ? 0L : (long) rs.getInt("job_id"));
staffPO.setStaffNum(-1 == rs.getInt("staff_num") ? 0 : rs.getInt("staff_num"));
staffPO.setControlPolicy(-1 == rs.getInt("control_policy") ? 0 : rs.getInt("control_policy"));
staffPO.setPermanentNum(-1 == rs.getInt("permanent_num") ? 0 : rs.getInt("permanent_num"));
staffPO.setFreezeNum(-1 == rs.getInt("freeze_num") ? 0 : rs.getInt("freeze_num"));
staffPO.setDescription(rs.getString("description"));
staffPO.setCreator((long) rs.getInt("creator")); staffPO.setCreator((long) rs.getInt("creator"));
staffPOList.add(staffPO);
}
for (StaffPO staffPO : staffPOList) {
sql = "select count(1) as num from hrmresource where STATUS < 4";
if (null != staffPO.getEcCompany() && 0 != staffPO.getEcCompany()) {
sql += " and subcompanyid1 = " + staffPO.getEcCompany();
}
if (null != staffPO.getEcDepartment() && 0 != staffPO.getEcDepartment()) {
sql += " and departmentid = " + staffPO.getEcDepartment();
}
if (null != staffPO.getJobId() && 0 != staffPO.getJobId()) {
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(staffPO.getJobId());
if (null == jobById) {
continue;
}
Integer ecJobTitle = jobById.getEcJobTitle();
sql += " and jobtitle = " + ecJobTitle;
}
rs.executeQuery(sql);
if (rs.next()) {
staffPO.setPermanentNum(-1 == rs.getInt("num") ? 0 : rs.getInt("num"));
StaffBO.buildStaffDesc(staffPO);
MapperProxyFactory.getProxy(StaffMapper.class).updateStaff(staffPO);
}
}
out.println("在编数初始化完成");
%>

@ -26,6 +26,8 @@ import org.apache.commons.lang.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
@ -70,6 +72,45 @@ public class JobBrowserService extends BrowserService {
return resultMap;
}
@Override
public Map<String, Object> browserAutoComplete(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
Map<String, Object> apidatas = new HashMap<>();
String q = Util.null2String(httpServletRequest.getParameter("q"));
List<String> sqlParams = new ArrayList<>();
String keyword = "";
if (q.length() > 0) keyword = "%" + q + "%";
RecordSet rs = new RecordSet();
String sqlwhere = " where t.delete_type = 0 ";
String backfields = "t.id, t.job_no, h.jobtitlename as name, t.sequence_id, t.scheme_id , t.grade_id , t.level_id ";
String fromSql = "FROM jcl_org_job t left join hrmjobtitles h on t.ec_jobTitle = h.id ";
String orderby = " order by t.id ";
sqlwhere += " ";
DetachUtil detachUtil = new DetachUtil(user);
if (detachUtil.isDETACH()) {
sqlwhere += " AND t.ec_company in (" + detachUtil.getJclRoleLevels() + ")";
}
if (!"".equals(keyword)) {
sqlwhere += " and (h.jobtitlemark like ? or h.jobtitlename like ? or h.ecology_pinyin_search like ? )";
sqlParams.add(keyword);
sqlParams.add(keyword);
sqlParams.add(keyword);
}
String sql = "select " + backfields + fromSql + sqlwhere + orderby;
rs.executeQuery(sql, sqlParams);
List<Map<String, String>> datas = new ArrayList<>();
while (rs.next()) {
Map<String, String> item = new HashMap<>();
item.put("id", Util.null2String(rs.getString("id")));
String name = Util.null2String(rs.getString("name"));
item.put("name", name);
item.put("title", name);
datas.add(item);
}
apidatas.put("datas", datas);
return apidatas;
}
@Override
public Map getBrowserConditionInfo(Map<String, Object> map) {
Map<String, List<SearchConditionItem>> apiDatas = new HashMap<>();
@ -99,14 +140,14 @@ public class JobBrowserService extends BrowserService {
*/
private String buildSqlWhere(Map<String, Object> params) {
DBType dbType = DBType.get(new RecordSet().getDBType());
String sqlWhere = " where t.delete_type ='0' and forbidden_tag ='0' ";
String sqlWhere = " where t.delete_type = 0 ";
String jobNo = Util.null2String(params.get("jobNo"));
if (StringUtils.isNotBlank(jobNo)) {
sqlWhere += " AND t.job_no " + dbType.like(jobNo);
}
String jobName = Util.null2String(params.get("jobName"));
if (StringUtils.isNotBlank(jobName)) {
sqlWhere += " AND t.job_name " + dbType.like(jobName);
sqlWhere += " AND h.jobtitlename " + dbType.like(jobName);
}
String ecCompany = Util.null2String(params.get("ecCompany"));
if (StringUtils.isNotBlank(ecCompany)) {
@ -121,16 +162,16 @@ public class JobBrowserService extends BrowserService {
String[] keyArray = treeKey.split("_");
if (keyArray.length == 2) {
if (TreeNodeTypeEnum.TYPE_COMP.getName().equals(keyArray[0])) {
sqlWhere += " AND t.parent_comp = '" + Long.parseLong(keyArray[1]) + "'";
sqlWhere += " AND t.ec_company = '" + Long.parseLong(keyArray[1]) + "'";
} else if (TreeNodeTypeEnum.TYPE_DEPT.getName().equals(keyArray[0])) {
sqlWhere += " AND t.parent_dept = '" + Long.parseLong(keyArray[1]) + "'";
sqlWhere += " AND t.ec_department = '" + Long.parseLong(keyArray[1]) + "'";
}
}
}
// 分权
DetachUtil detachUtil = new DetachUtil(user.getUID());
DetachUtil detachUtil = new DetachUtil(user);
if (detachUtil.isDETACH()) {
sqlWhere += " AND t.parent_comp in (" + detachUtil.getJclRoleLevels() + ")";
sqlWhere += " AND t.ec_company in (" + detachUtil.getJclRoleLevels() + ")";
}
return sqlWhere;
}
@ -143,7 +184,7 @@ public class JobBrowserService extends BrowserService {
*/
private List<TreeNode> getCurrentTreeNode(SearchTreeParams params) {
// 分权
DetachUtil detachUtil = new DetachUtil(user.getUID());
DetachUtil detachUtil = new DetachUtil(user);
List<Long> jclRoleLevelList;
if (StringUtils.isNotBlank(detachUtil.getJclRoleLevels())) {
jclRoleLevelList = Arrays.stream(detachUtil.getJclRoleLevels().split(",")).map(Long::parseLong).collect(Collectors.toList());
@ -181,8 +222,8 @@ public class JobBrowserService extends BrowserService {
if (CollectionUtils.isNotEmpty(jclRoleLevelList)) {
compList = MapperProxyFactory.getProxy(CompMapper.class).getCompsByIds(jclRoleLevelList);
// 处理上下级关系
Set<Long> collectIds = compList.stream().map(CompPO::getId).collect(Collectors.toSet());
compList.removeIf(item->collectIds.contains(item.getParentCompany()));
Set<Integer> collectIds = compList.stream().map(CompPO::getId).collect(Collectors.toSet());
compList.removeIf(item -> collectIds.contains(item.getSupSubComId()));
} else {
compList = new ArrayList<>();
@ -191,22 +232,22 @@ public class JobBrowserService extends BrowserService {
compList = MapperProxyFactory.getProxy(CompMapper.class).listParent();
}
// 获取顶层分部
compList.stream().sorted(Comparator.comparing(CompPO::getShowOrder)).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
compList.stream().sorted(Comparator.comparing(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
} else if ("1".equals(params.getType())) {
// 当前节点下的元素
CompPO compBuild = CompPO.builder().parentCompany(Long.parseLong(params.getId())).forbiddenTag(0).deleteType(0).build();
List<CompPO> compList = MapperProxyFactory.getProxy(CompMapper.class).listByFilter(compBuild, "show_order");
CompPO compBuild = CompPO.builder().supSubComId(Integer.parseInt(params.getId())).canceled(0).build();
List<CompPO> compList = MapperProxyFactory.getProxy(CompMapper.class).listByFilter(compBuild, "showorder");
if (detachUtil.isDETACH()) {
detachUtil.filterCompanyList(compList);
}
DepartmentPO departmentBuild = DepartmentPO.builder().parentComp(Long.parseLong(params.getId())).forbiddenTag(0).deleteType(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "show_order");
DepartmentPO departmentBuild = DepartmentPO.builder().subCompanyId1(Integer.parseInt(params.getId())).canceled(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "showorder");
compList.forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
departmentList.stream().filter(item -> null == item.getParentDept() || 0 == item.getParentDept()).forEach(item -> buildDeptNodes(treeNodes, hasSubDepartment, item));
departmentList.stream().filter(item -> null == item.getSupDepId() || 0 == item.getSupDepId()).forEach(item -> buildDeptNodes(treeNodes, hasSubDepartment, item));
} else if ("2".equals(params.getType())) {
DepartmentPO departmentBuild = DepartmentPO.builder().parentDept(Long.parseLong(params.getId())).forbiddenTag(0).deleteType(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "show_order");
DepartmentPO departmentBuild = DepartmentPO.builder().supDepId(Integer.parseInt(params.getId())).canceled(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "showorder");
departmentList.forEach(item -> buildDeptNodes(treeNodes, hasSubDepartment, item));
}
@ -226,7 +267,7 @@ public class JobBrowserService extends BrowserService {
SearchTree searchTree = new SearchTree();
searchTree.setId(company.getId().toString());
searchTree.setType(TreeNodeTypeEnum.TYPE_COMP.getValue());
searchTree.setName(company.getCompName());
searchTree.setName(company.getSubCompanyName());
searchTree.setIsParent(compHasSubs.contains(company.getId().toString()));
treeNodes.add(searchTree);
}
@ -241,7 +282,7 @@ public class JobBrowserService extends BrowserService {
private void buildDeptNodes(List<TreeNode> treeNodes, List<String> hasSubDepartment, DepartmentPO department) {
SearchTree searchTree = new SearchTree();
searchTree.setId(department.getId().toString());
searchTree.setName(department.getDeptName());
searchTree.setName(department.getDepartmentName());
searchTree.setType(TreeNodeTypeEnum.TYPE_DEPT.getValue());
searchTree.setIsParent(hasSubDepartment.contains(department.getId().toString()));
treeNodes.add(searchTree);

@ -2,12 +2,7 @@ package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @className: OrgChartController
* @author: dengjp
* @date: 2022/7/7
* @description:
**/
@Path("/bs/hrmorganization/orgchart")
public class OrgChartController extends com.engine.organization.web.OrgChartController {
}

@ -0,0 +1,14 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @Author liang.cheng
* @Date 2023/6/27 3:38 PM
* @Description: TODO
* @Version 1.0
*/
@Path("/bs/hrmorganization/virtual")
public class OrgVirtualController extends com.engine.organization.web.OrgVirtualController {
}

@ -0,0 +1,12 @@
package com.api.organization.web;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2022/12/28
* @version: 1.0
*/
@Path("/bs/hrmorganization/personnelresume")
public class PersonnelResumeController extends com.engine.organization.web.PersonnelResumeController {
}

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

@ -8,7 +8,7 @@ import weaver.general.StringUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
@ -24,7 +24,7 @@ import java.util.stream.Collectors;
public class DeleteParam {
private String ids;
public Collection<Long> getIds() {
public List<Long> getIds() {
if(StringUtil.isEmpty(ids)){
return new ArrayList<>();
}

@ -1,10 +1,7 @@
package com.engine.organization.entity.browser.po;
import com.api.browser.bean.BrowserBean;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.*;
import java.util.Map;
@ -17,6 +14,7 @@ import java.util.Map;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class CustomBrowserBean extends BrowserBean {

@ -0,0 +1,39 @@
package com.engine.organization.entity.chart;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import weaver.conn.RecordSet;
/**
* @author:dxfeng
* @createTime: 2023/06/26
* @version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CompanyTreePO {
private String id;
private String pId;
private String value;
private String title;
private boolean isLeaf;
private String key;
public boolean getIsLeaf() {
RecordSet rs = new RecordSet();
rs.executeQuery("select id from hrmsubcompany where (canceled is null or canceled != '1') and supsubcomid = ?",id);
return !rs.next();
}
public String getpId() {
return pId;
}
public String getKey() {
return id;
}
}

@ -73,7 +73,7 @@ public class CodeSettingBO {
if(Objects.nonNull(param)) {
String enable = Util.null2String(param.getEnable(),"0");
String key = param.getKey();
if (enable.equals("1") && StringUtils.isNotEmpty(key)) {
if ("1".equals(enable) && StringUtils.isNotEmpty(key)) {
sb.append(key);
sb.append(",");
}

@ -96,8 +96,12 @@ public class FieldInfo {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FieldInfo fieldInfo = (FieldInfo) o;
return Objects.equals(fieldName, fieldInfo.fieldName) &&
Objects.equals(firstFieldType, fieldInfo.firstFieldType) &&

@ -1,54 +1,121 @@
package com.engine.organization.entity.company.bo;
import com.engine.organization.entity.company.dto.CompListDTO;
import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.company.param.CompParam;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import weaver.crm.Maint.SectorInfoComInfo;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.hrm.resource.ResourceComInfo;
import java.util.*;
import java.util.stream.Collectors;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/05/16
* @createTime: 2022/11/24
* @version: 1.0
*/
public class CompBO {
public static List<CompListDTO> buildCompDTOList(Collection<CompPO> list) {
private static CompMapper getCompMapper() {
return MapperProxyFactory.getProxy(CompMapper.class);
}
Map<Long, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
public static List<SearchTree> buildSetToSearchTree(Set<CompPO> comps) {
return comps.stream().sorted(Comparator.comparing(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(item.getCanceled() != null && item.getCanceled() != 0);
tree.setIcon("icon-coms-LargeArea");
tree.setId(item.getId().toString());
tree.setIsParent(false);
tree.setIsVirtual("0");
tree.setName(item.getSubCompanyName());
tree.setPid(item.getSupSubComId().toString());
tree.setSelected(false);
tree.setType("1");
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
return tree;
}).collect(Collectors.toList());
}
/**
*
*
* @param param
* @param userId
* @return
*/
public static CompPO convertParamToPO(CompParam param, Integer userId) {
if (null == param) {
return null;
}
return CompPO
.builder()
.id(param.getId() == null ? 0 : param.getId())
.subCompanyName(param.getSubCompanyName())
.subCompanyDesc(param.getSubCompanyDesc())
// 所属集团默认为1
.companyId(null == param.getCompanyId() ? 1 : param.getCompanyId())
.supSubComId(param.getSupSubComId())
.url(param.getUrl())
.canceled(param.getCanceled() == null ? null : param.getCanceled() ? 0 : 1)
.subCompanyCode(param.getSubCompanyCode())
.outKey(param.getOutKey())
.limitUsers(null == param.getLimitUsers() ? 0 : param.getLimitUsers())
.uuid(param.getUuid())
.showOrder(param.getShowOrder())
.showOrderOfTree(param.getShowOrderOfTree())
.created(new Date())
.creater(userId)
.modified(new Date())
.modifier(userId)
.build();
}
public static List<CompListDTO> buildCompDTOList(Collection<CompPO> list, List<CompPO> filterList) {
// 搜索结果为空,直接返回空
if (CollectionUtils.isEmpty(filterList)) {
return Collections.emptyList();
}
// 递归添加父级数据
Map<Integer, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
List<CompPO> addedList = new ArrayList<>();
for (CompPO po : filterList) {
dealParentData(addedList, po, poMaps);
}
return buildCompDTOList(addedList);
}
public static List<CompListDTO> buildCompDTOList(List<CompPO> list) {
Map<Integer, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
List<CompListDTO> dtoList = list.stream().map(e ->
CompListDTO
.builder()
.id(e.getId())
.compNo(e.getCompNo())
.compName(e.getCompName())
.compNameShort(e.getCompNameShort())
.parentCompany(e.getParentCompany())
.parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName())
.orgCode(e.getOrgCode())
.industry(new SectorInfoComInfo().getSectorInfoname(Util.null2String(e.getIndustry())))
.compPrincipal(getUserNameById( Util.null2String(e.getCompPrincipal())))
.subCompanyCode(e.getSubCompanyCode())
.subCompanyDesc(e.getSubCompanyDesc())
.subCompanyName(e.getSubCompanyName())
.supSubComId(e.getSupSubComId())
.supSubComName(null == poMaps.get(e.getSupSubComId()) ? "" : poMaps.get(e.getSupSubComId()).getSubCompanyName())
.showOrder(e.getShowOrder())
.forbiddenTag(e.getForbiddenTag())
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
.build()).collect(Collectors.toList());
Map<Long, List<CompListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany));
Map<Integer, List<CompListDTO>> collects = dtoList.stream().filter(item -> 0 != item.getSupSubComId()).collect(Collectors.groupingBy(CompListDTO::getSupSubComId));
// 处理被引用数据
List<String> usedIds = MapperProxyFactory.getProxy(CompMapper.class).listUsedId();
List<String> usedIds = getCompMapper().listUsedId();
// 兼容MySQL
usedIds.addAll(MapperProxyFactory.getProxy(CompMapper.class).listUsedIds());
List<String> strings = getCompMapper().listUsedIds();
if (CollectionUtils.isNotEmpty(strings)) {
usedIds.addAll(strings);
}
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
Set<Long> leafs = new HashSet<>();
Set<Integer> leafs = new HashSet<>();
List<CompListDTO> collectTree = dtoList.stream().peek(e -> {
List<CompListDTO> childList = collects.get(e.getId());
leafs.add(e.getId());
@ -63,65 +130,7 @@ public class CompBO {
}
}
}).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) {
// 搜索结果为空,直接返回空
if (CollectionUtils.isEmpty(filterList)) {
return Collections.emptyList();
}
// 递归添加父级数据
Map<Long, CompPO> poMaps = list.stream().collect(Collectors.toMap(CompPO::getId, item -> item));
List<CompPO> addedList = new ArrayList<>();
for (CompPO po : filterList) {
dealParentData(addedList, po, poMaps);
}
return buildCompDTOList(addedList);
}
public static CompPO convertParamToPO(CompSearchParam param, Long employeeId) {
if (null == param) {
return null;
}
return CompPO
.builder()
.id(param.getId() == null ? 0 : param.getId())
.compNo(param.getCompNo())
.compName(param.getCompName())
.compNameShort(param.getCompNameShort())
.parentCompany(param.getParentCompany())
.ecCompany(param.getEcCompany())
.orgCode(param.getOrgCode())
.industry(param.getIndustry())
.compPrincipal(param.getCompPrincipal())
.description(param.getDescription())
.forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1)
.deleteType(0)
.createTime(new Date())
.updateTime(new Date())
.creator(employeeId)
.build();
}
public static List<SearchTree> buildSetToSearchTree(Set<CompPO> comps) {
return comps.stream().sorted(Comparator.comparing(CompPO::getShowOrder)).map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(item.getForbiddenTag() != 0);
tree.setIcon("icon-coms-LargeArea");
tree.setId(item.getId().toString());
tree.setIsParent(false);
tree.setIsVirtual("0");
tree.setName(item.getCompName());
tree.setPid(null == item.getParentCompany() ? "0" : item.getParentCompany().toString());
tree.setSelected(false);
tree.setType("1");
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
return tree;
}).collect(Collectors.toList());
return collectTree.stream().filter(item -> !leafs.contains(item.getSupSubComId())).collect(Collectors.toList());
}
/**
@ -131,24 +140,13 @@ public class CompBO {
* @param po
* @param poMaps
*/
private static void dealParentData(List<CompPO> addedList, CompPO po, Map<Long, CompPO> poMaps) {
private static void dealParentData(List<CompPO> addedList, CompPO po, Map<Integer, CompPO> poMaps) {
if (!addedList.contains(po)) {
addedList.add(po);
}
CompPO parentCompPO = poMaps.get(po.getParentCompany());
CompPO parentCompPO = poMaps.get(po.getSupSubComId());
if (null != parentCompPO) {
dealParentData(addedList, parentCompPO, poMaps);
}
}
private static String getUserNameById(String userId) {
try {
if (StringUtil.isEmpty(userId)) {
return "";
}
return new ResourceComInfo().getLastname(userId);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

@ -10,21 +10,20 @@ import lombok.NoArgsConstructor;
import java.util.List;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/05/16
* @createTime: 2022/11/24
* @version: 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508")
@OrganizationTable(pageId = "dcfd9d27-6ba2-11ed-996a-00ffcbed7508")
public class CompListDTO {
/**
* id
*/
private Long id;
private Integer id;
/**
*
*/
@ -32,46 +31,29 @@ public class CompListDTO {
/**
*
*/
@TableTitle(title = "名称", dataIndex = "compName", key = "compName")
private String compName;
@TableTitle(title = "名称", dataIndex = "subCompanyDesc", key = "subCompanyDesc")
private String subCompanyDesc;
/**
*
*/
@TableTitle(title = "编号", dataIndex = "compNo", key = "compNo")
private String compNo;
@TableTitle(title = "编号", dataIndex = "subCompanyCode", key = "subCompanyCode")
private String subCompanyCode;
/**
*
*/
@TableTitle(title = "简称", dataIndex = "compNameShort", key = "compNameShort")
private String compNameShort;
@TableTitle(title = "简称", dataIndex = "subCompanyName", key = "subCompanyName")
private String subCompanyName;
/**
*
*/
@TableTitle(title = "上级分部", dataIndex = "parentCompName", key = "parentCompName")
private String parentCompName;
@TableTitle(title = "上级分部", dataIndex = "supSubComName", key = "supSubComName")
private String supSubComName;
private Long parentCompany;
private Integer supSubComId;
/**
*
*/
@TableTitle(title = "组织机构代码", dataIndex = "orgCode", key = "orgCode")
private String orgCode;
/**
*
*/
@TableTitle(title = "行业", dataIndex = "industry", key = "industry")
private String industry;
/**
*
*/
@TableTitle(title = "负责人", dataIndex = "compPrincipal", key = "compPrincipal")
private String compPrincipal;
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
private Integer showOrder;
@ -79,8 +61,8 @@ public class CompListDTO {
/**
*
*/
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
private int forbiddenTag;
@TableTitle(title = "启用", dataIndex = "canceled", key = "canceled")
private Integer canceled;
/**
*

@ -0,0 +1,30 @@
package com.engine.organization.entity.company.param;
import com.engine.organization.common.BaseQueryParam;
import lombok.*;
/**
* @author:dxfeng
* @createTime: 2022/11/24
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class CompParam extends BaseQueryParam {
private Integer Id;
private String subCompanyName;
private String subCompanyDesc;
private Integer companyId;
private Integer supSubComId;
private String url;
private Boolean canceled;
private String subCompanyCode;
private String outKey;
private Integer limitUsers;
private String uuid;
private Integer showOrder;
private Integer showOrderOfTree;
}

@ -1,71 +0,0 @@
package com.engine.organization.entity.company.param;
import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/05/16
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CompSearchParam extends BaseQueryParam {
/**
*
*/
private Long id;
/**
*
*/
private String compNo;
/**
*
*/
private String compName;
/**
*
*/
private String compNameShort;
/**
*
*/
private Long parentCompany;
private Long ecCompany;
/**
*
*/
private String orgCode;
/**
*
*/
private Integer industry;
/**
*
*/
private Integer compPrincipal;
/**
*
*/
private String description;
/**
*
*/
private Boolean forbiddenTag;
}

@ -8,9 +8,8 @@ import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/05/16
* @createTime: 2022/11/24
* @version: 1.0
*/
@Data
@ -18,68 +17,21 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
public class CompPO {
/**
*
*/
private Long id;
/**
*
*/
private String compNo;
/**
*
*/
private String compName;
/**
*
*/
private String compNameShort;
/**
*
*/
private Long parentCompany;
private Long ecCompany;
/**
*
*/
private String orgCode;
/**
*
*/
private Integer industry;
/**
*
*/
private Integer compPrincipal;
/**
*
*/
private String description;
/**
*
*/
private Integer forbiddenTag;
/**
*
*/
private Integer showOrder;
private Integer id;
private String subCompanyName;
private String subCompanyDesc;
private Integer companyId;
private Integer supSubComId;
private String url;
private Integer canceled;
private String subCompanyCode;
private String outKey;
private Integer limitUsers;
private Date created;
private Integer creater;
private Date modified;
private Integer modifier;
private String uuid;
private Long creator;
private int deleteType;
private Date createTime;
private Date updateTime;
private Integer showOrder;
private Integer showOrderOfTree;
}

@ -10,6 +10,7 @@ import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.Util;
import java.util.*;
@ -26,22 +27,23 @@ public class DepartmentBO {
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list) {
// 递归添加父级数据
Map<Long, DepartmentPO> poMaps = list.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item));
Map<Integer, DepartmentPO> poMaps = list.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item));
List<DepartmentListDTO> dtoList = list.stream().map(e ->
DepartmentListDTO
.builder()
.id(e.getId())
.deptNo(e.getDeptNo())
.deptName(e.getDeptName())
.deptNameShort(e.getDeptNameShort())
.parentComp(null == e.getParentComp() ? "" : MapperProxyFactory.getProxy(CompMapper.class).listById(e.getParentComp()).getCompName())
.parentDept(e.getParentDept())
.parentDeptName(null == poMaps.get(e.getParentDept()) ? "" : poMaps.get(e.getParentDept()).getDeptName())
.deptPrincipal(getEmployeeNameById(e.getDeptPrincipal()))
.departmentMark(e.getDepartmentMark())
.departmentName(e.getDepartmentName())
.departmentCode(e.getDepartmentCode())
.subCompanyId1(e.getSubCompanyId1())
.subCompanyName(0 == e.getSubCompanyId1() ? "" : MapperProxyFactory.getProxy(CompMapper.class).listById(e.getSubCompanyId1()).getSubCompanyName())
.supDepId(e.getSupDepId())
.supDepName(null == poMaps.get(e.getSupDepId()) ? "" : poMaps.get(e.getSupDepId()).getDepartmentName())
.bmfzr(getEmployeeNameById(e.getId()))
.showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder())
.forbiddenTag(e.getForbiddenTag())
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
.build()).collect(Collectors.toList());
Map<Long, List<DepartmentListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentDept() && 0 != item.getParentDept()).collect(Collectors.groupingBy(DepartmentListDTO::getParentDept));
Map<Integer, List<DepartmentListDTO>> collects = dtoList.stream().filter(item -> null != item.getSupDepId() && 0 != item.getSupDepId()).collect(Collectors.groupingBy(DepartmentListDTO::getSupDepId));
// 处理被引用数据
List<String> usedIds = MapperProxyFactory.getProxy(DepartmentMapper.class).listUsedId();
List<String> collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList());
@ -57,7 +59,7 @@ public class DepartmentBO {
e.setIsUsed(0);
}
}
}).filter(item -> null == item.getParentDept() || 0 == item.getParentDept()).collect(Collectors.toList());
}).filter(item -> null == item.getSupDepId() || 0 == item.getSupDepId()).collect(Collectors.toList());
}
public static List<DepartmentListDTO> buildDeptDTOList(Collection<DepartmentPO> list, List<DepartmentPO> filterList) {
@ -66,7 +68,7 @@ public class DepartmentBO {
return Collections.emptyList();
}
// 递归添加父级数据
Map<Long, DepartmentPO> poMaps = list.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item));
Map<Integer, DepartmentPO> poMaps = list.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item));
List<DepartmentPO> addedList = new ArrayList<>();
for (DepartmentPO po : filterList) {
dealParentData(addedList, po, poMaps);
@ -74,32 +76,33 @@ public class DepartmentBO {
return buildDeptDTOList(addedList);
}
public static DepartmentPO convertParamsToPO(DeptSearchParam param, long employeeId) {
public static DepartmentPO convertParamsToPO(DeptSearchParam param, Integer employeeId) {
if (null == param) {
return null;
}
return DepartmentPO
.builder()
.id(param.getId() == null ? 0 : param.getId())
.deptNo(param.getDeptNo())
.deptName(param.getDepartmentName())
.deptNameShort(param.getDeptNameShort())
.parentComp(null == param.getParentComp() ? param.getSubcompanyid1() : param.getParentComp())
.ecCompany(param.getEcCompany())
.parentDept(null == param.getParentDept() ? param.getDepartmentid() : param.getParentDept())
.ecDepartment(param.getEcDepartment())
.deptPrincipal(param.getDeptPrincipal())
.departmentId(param.getDepartmentId())
.departmentMark(param.getDepartmentMark())
.departmentName(param.getDepartmentName())
.subCompanyId1(param.getSubCompanyId1())
.supDepId(param.getSupDepId())
.allSupDepId(param.getAllSupDepId())
.canceled(param.getCanceled() == null ? null : param.getCanceled() ? 0 : 1)
.departmentCode(param.getDepartmentCode())
.coadjutant(param.getCoadjutant())
.uuid(param.getUuid())
.showOrder(param.getShowOrder())
.forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1)
.description(param.getDescription())
.deleteType(0)
.createTime(new Date())
.updateTime(new Date())
.creator(employeeId)
.showOrderOfTree(param.getShowOrderOfTree())
.created(new Date())
.modified(new Date())
.creater(employeeId)
.modifier(employeeId)
.build();
}
public static List<SingleDeptTreeVO> buildSingleDeptTreeVOS(List<DepartmentPO> departmentPOs, Long parentComp) {
public static List<SingleDeptTreeVO> buildSingleDeptTreeVOS(List<DepartmentPO> departmentPOs, Integer parentComp) {
if (CollectionUtils.isEmpty(departmentPOs)) {
return Collections.emptyList();
@ -109,17 +112,17 @@ public class DepartmentBO {
SingleDeptTreeVO
.builder()
.id(e.getId())
.deptNo(e.getDeptNo())
.deptName(e.getDeptName())
.parentComp(e.getParentComp())
.parentDept(e.getParentDept())
.parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept()))
.deptPrincipalName(getEmployeeNameById(e.getDeptPrincipal()))
.departmentCode(e.getDepartmentCode())
.departmentMark(e.getDepartmentMark())
.subCompanyId1(e.getSubCompanyId1())
.supDepId(e.getSupDepId())
.supDepName(null == e.getSupDepId() || e.getSupDepId() == 0 ? "" : getDeptNameById(e.getSupDepId()))
//.deptPrincipalName(getEmployeeNameById(e.getDeptPrincipal()))
.build()).collect(Collectors.toList());
//获取非一级部门
Map<Long, List<SingleDeptTreeVO>> collects = singleDeptTreeVOS.stream().filter(item -> !parentComp.equals(item.getParentComp()) && null != item.getParentDept()).collect(Collectors.groupingBy(SingleDeptTreeVO::getParentDept));
Map<Integer, List<SingleDeptTreeVO>> collects = singleDeptTreeVOS.stream().filter(item -> !parentComp.equals(item.getSubCompanyId1()) && null != item.getSupDepId() && 0 != item.getSupDepId()).collect(Collectors.groupingBy(SingleDeptTreeVO::getSupDepId));
return singleDeptTreeVOS.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> parentComp.equals(item.getParentComp())).collect(Collectors.toList());
return singleDeptTreeVOS.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> parentComp.equals(item.getSubCompanyId1())).collect(Collectors.toList());
}
public static List<SearchTree> buildSetToSearchTree(Set<DepartmentPO> departmentPOS) {
@ -131,28 +134,40 @@ public class DepartmentBO {
return departmentPOS.stream().map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(item.getForbiddenTag() != 0);
tree.setCanceled(item.getCanceled() != null && item.getCanceled() != 0);
tree.setIcon(isLeaf ? "icon-coms-Branch" : "icon-coms-LargeArea");
tree.setId(item.getId().toString());
tree.setIsParent(false);
tree.setIsVirtual("0");
tree.setName(item.getDeptName());
tree.setPid(null == item.getParentDept() ? "0" : item.getParentDept().toString());
tree.setName(item.getDepartmentName());
tree.setPid(null == item.getSupDepId() ? "0" : item.getSupDepId().toString());
tree.setSelected(false);
tree.setType("2");
tree.setParentComp(null == item.getParentComp() ? "0" : item.getParentComp().toString());
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
tree.setParentComp(item.getSubCompanyId1().toString());
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder().intValue());
return tree;
}).collect(Collectors.toList());
}
public static String getDeptNameById(Long id) {
public static String getDeptNameById(Integer id) {
return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id);
}
public static String getEmployeeNameById(Long id) {
return MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(id);
public static String getEmployeeNameById(Integer id) {
if (null == id) {
return "";
}
String departmentPrincipal = MapperProxyFactory.getProxy(DepartmentMapper.class).getDepartmentPrincipal(id);
if (StringUtils.isBlank(departmentPrincipal) || "$NULL$".equalsIgnoreCase(departmentPrincipal)) {
return "";
}
List<Long> collect = Arrays.stream(departmentPrincipal.split(",")).map(Long::parseLong).collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)) {
return "";
}
List<String> employeeNameById = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(collect);
return StringUtils.join(employeeNameById, ",");
}
@ -163,11 +178,11 @@ public class DepartmentBO {
* @param po
* @param poMaps
*/
private static void dealParentData(List<DepartmentPO> addedList, DepartmentPO po, Map<Long, DepartmentPO> poMaps) {
private static void dealParentData(List<DepartmentPO> addedList, DepartmentPO po, Map<Integer, DepartmentPO> poMaps) {
if (!addedList.contains(po)) {
addedList.add(po);
}
DepartmentPO parentPO = poMaps.get(po.getParentDept());
DepartmentPO parentPO = poMaps.get(po.getSupDepId());
if (null != parentPO) {
dealParentData(addedList, parentPO, poMaps);
}

@ -24,7 +24,7 @@ import java.util.List;
tableType = WeaTableType.NONE)
public class DepartmentListDTO {
private Long id;
private Integer id;
/**
*
*/
@ -33,58 +33,54 @@ public class DepartmentListDTO {
/**
*
*/
@TableTitle(title = "名称", dataIndex = "deptName", key = "deptName",width = "200")
private String deptName;
@TableTitle(title = "名称", dataIndex = "departmentMark", key = "departmentMark", width = "200")
private String departmentMark;
/**
*
*/
@TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo")
private String deptNo;
@TableTitle(title = "编号", dataIndex = "departmentCode", key = "departmentCode")
private String departmentCode;
/**
*
*/
@TableTitle(title = "简称", dataIndex = "deptNameShort", key = "deptNameShort")
private String deptNameShort;
@TableTitle(title = "简称", dataIndex = "departmentName", key = "departmentName")
private String departmentName;
/**
*
*/
@TableTitle(title = "所属分部", dataIndex = "parentComp", key = "parentComp")
private String parentComp;
@TableTitle(title = "所属分部", dataIndex = "subCompanyName", key = "subCompanyName")
private String subCompanyName;
private Integer subCompanyId1;
/**
*
*/
@TableTitle(title = "上级部门", dataIndex = "parentDeptName", key = "parentDeptName")
private String parentDeptName;
@TableTitle(title = "上级部门", dataIndex = "supDepName", key = "supDepName")
private String supDepName;
private Long parentDept;
private Integer supDepId;
/**
*
*/
@TableTitle(title = "部门负责人", dataIndex = "deptPrincipal", key = "deptPrincipal")
private String deptPrincipal;
@TableTitle(title = "部门负责人", dataIndex = "bmfzr", key = "bmfzr")
private String bmfzr;
/**
*
*/
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder",sorter = true)
private int showOrder;
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
private Double showOrder;
///**
// * 说明
// */
//@TableTitle(title = "说明", dataIndex = "description", key = "description")
//private String description;
/**
*
*/
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
private int forbiddenTag;
@TableTitle(title = "启用", dataIndex = "canceled", key = "canceled")
private int canceled;
/**
*
*/

@ -19,11 +19,11 @@ public class DepartmentMergeParam {
/**
*
*/
private Long id;
private Integer id;
/**
*
*/
private Long department;
private Integer department;
/**
*
*/

@ -16,8 +16,8 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
public class DepartmentMoveParam {
private Long id;
private Integer id;
private String moveType;
private Long company;
private Long department;
private Integer company;
private Integer department;
}

@ -1,10 +1,7 @@
package com.engine.organization.entity.department.param;
import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.*;
/**
* @description:
@ -16,30 +13,21 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class DeptSearchParam extends BaseQueryParam {
private Long id;
private String deptNo;
private Integer id;
private String departmentMark;
private String departmentName;
private String deptNameShort;
private Long parentComp;
private Long ecCompany;
private Long parentDept;
private Long ecDepartment;
private Long deptPrincipal;
private Integer showOrder;
private String description;
private Integer subCompanyId1;
private Integer supDepId;
private String allSupDepId;
private Boolean canceled;
private String departmentCode;
private Integer coadjutant;
private String departmentId;
private String uuid;
private Double showOrder;
private Integer showOrderOfTree;
private Boolean forbiddenTag;
private Long subcompanyid1;
private Long departmentid;
}

@ -1,10 +1,7 @@
package com.engine.organization.entity.department.param;
import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.*;
/**
* @Author weaver_cl
@ -16,10 +13,11 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class QuerySingleDeptListParam extends BaseQueryParam {
private Long parentComp;
private Integer parentComp;
private Long parentDept;
private Integer parentDept;
}

@ -18,36 +18,23 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
public class DepartmentPO {
private Long id;
private String deptNo;
private String deptName;
private String deptNameShort;
private Long parentComp;
private Long ecCompany;
private Long parentDept;
private Long ecDepartment;
private Long deptPrincipal; //部门负责人
private Integer showOrder;
private String description;
private Integer forbiddenTag;
private Integer id;
private String departmentMark;
private String departmentName;
private Integer subCompanyId1;
private Integer supDepId;
private String allSupDepId;
private Integer canceled;
private String departmentCode;
private Integer coadjutant;
private String departmentId;
private Date created;
private Integer creater;
private Date modified;
private Integer modifier;
private String uuid;
private Double showOrder;
private Integer showOrderOfTree;
private Long creator;
private int deleteType;
private Date createTime;
private Date updateTime;
}

@ -24,23 +24,23 @@ import java.util.List;
tableType = WeaTableType.NONE)
public class SingleDeptTreeVO {
private Long id;
private Integer id;
@TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo")
private String deptNo;
@TableTitle(title = "编号", dataIndex = "departmentCode", key = "departmentCode")
private String departmentCode;
@TableTitle(title = "部门名称", dataIndex = "deptName", key = "deptName")
private String deptName;
@TableTitle(title = "部门名称", dataIndex = "departmentMark", key = "departmentMark")
private String departmentMark;
private Long parentComp; //上级分部
private Integer subCompanyId1; //上级分部
private Long parentDept; //上级部门id
private Integer supDepId; //上级部门id
@TableTitle(title = "上级部门", dataIndex = "parentDeptName", key = "parentDeptName")
private String parentDeptName; //上级部门
@TableTitle(title = "上级部门", dataIndex = "supDepName", key = "supDepName")
private String supDepName; //上级部门
@TableTitle(title = "部门负责人", dataIndex = "deptPrincipalName", key = "deptPrincipalName")
private String deptPrincipalName; //部门负责人
//@TableTitle(title = "部门负责人", dataIndex = "deptPrincipalName", key = "deptPrincipalName")
//private String deptPrincipalName; //部门负责人
//子节点
private List<SingleDeptTreeVO> children;

@ -21,11 +21,11 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@OrganizationTable(pageId = "80e7830c-18e8-4e14-8241-18821195ef31",
fields = "t.id," +
"t.last_name," +
"t.lastname," +
"t.mobile," +
"t.company_start_date," +
"t.companystartdate," +
"t.sex",
fromSql = "FROM jcl_org_hrmresource t ",
fromSql = "FROM hrmresource t ",
orderby = "id",
primarykey = "id",
tableType = WeaTableType.NONE
@ -35,7 +35,7 @@ public class EmployeeTableVO {
@OrganizationTableColumn(column = "id", display = false)
private Long id;
@OrganizationTableColumn(text = "姓名", width = "25%", column = "last_name")
@OrganizationTableColumn(text = "姓名", width = "25%", column = "lastname")
private String lastname;
@OrganizationTableColumn(text = "性别", width = "25%", column = "sex",transmethod = "com.engine.organization.transmethod.JobTransMethod.getSexName")
@ -44,7 +44,7 @@ public class EmployeeTableVO {
@OrganizationTableColumn(text = "手机", width = "25%", column = "mobile")
private String mobile;
@OrganizationTableColumn(text = "入职日期", width = "25%", column = "company_start_date")
@OrganizationTableColumn(text = "入职日期", width = "25%", column = "companystartdate")
private String companystartdate;

@ -11,25 +11,37 @@ import com.api.browser.util.BrowserInitUtil;
import com.api.browser.util.ConditionFactory;
import com.api.browser.util.ConditionType;
import com.api.hrm.bean.FieldItem;
import com.api.hrm.util.FieldType;
import com.api.hrm.util.ServiceUtil;
import com.api.hrm.bean.HrmFieldBean;
import com.api.hrm.util.*;
import com.cloudstore.dev.api.util.TextUtil;
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
import com.engine.organization.entity.SelectOptionParam;
import com.engine.organization.entity.browser.po.CustomBrowserBean;
import com.engine.organization.entity.extend.param.ExtendInfoFieldParam;
import com.engine.organization.entity.extend.po.ExtendGroupPO;
import com.engine.organization.entity.extend.po.ExtendInfoPO;
import com.engine.organization.mapper.extend.ExtendInfoMapper;
import com.engine.organization.entity.browser.po.CustomBrowserBean;
import com.engine.organization.util.OrganizationFormItemUtil;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.sensitive.biz.SensitiveWordTypeComInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.common.StringUtil;
import weaver.conn.RecordSet;
import weaver.docs.docs.CustomFieldManager;
import weaver.encrypt.EncryptUtil;
import weaver.file.ImageFileManager;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import weaver.hrm.definedfield.HrmFieldGroupComInfo;
import weaver.hrm.definedfield.HrmFieldManager;
import weaver.hrm.moduledetach.ManageDetachComInfo;
import weaver.hrm.resource.CustomFieldTreeManager;
import weaver.hrm.resource.HrmListValidate;
import weaver.systeminfo.SystemEnv;
import weaver.systeminfo.systemright.CheckSubCompanyRight;
import java.util.*;
@ -47,7 +59,7 @@ public class ExtendInfoBO {
public static String DATE_Time_TO = "_end";
// 封装对象为table组件
public static List<Map<String, Object>> convertInfoListToTable(User user, List<ExtendInfoPO> infoPOList, int viewAttr, boolean showLabel) {
public static List<Map<String, Object>> convertInfoListToTable(User user, List<ExtendInfoPO> infoPOList, int viewAttr, boolean showLabel, boolean checkBox) {
List<Map<String, Object>> lsCol = new ArrayList<>();
Map<String, Object> col;
@ -56,19 +68,53 @@ public class ExtendInfoBO {
String tmpkey = extendInfoPO.getFieldName();
col = new HashMap<>();
col.put("title", extendInfoPO.getFieldNameDesc());
col.put("key", tmpkey);
col.put("dataIndex", tmpkey);
col.put("com", getFieldDetailInfo(user, extendInfoPO, viewAttr, showLabel, width));
col.put("width", width + "%");
if (checkBox && Integer.valueOf(7).equals(extendInfoPO.getControlType())) {
col.put("checkType", "checkbox");
}
lsCol.add(col);
}
return lsCol;
}
/**
* viewAttr
* @param user
* @param infoPOList
* @param showLabel
* @param checkBox
* @return
*/
public static List<Map<String, Object>> convertInfoListToTable(User user, List<ExtendInfoPO> infoPOList, boolean showLabel, boolean checkBox) {
List<Map<String, Object>> lsCol = new ArrayList<>();
Map<String, Object> col;
int width = 100 / infoPOList.size();
for (ExtendInfoPO extendInfoPO : infoPOList) {
String tmpkey = extendInfoPO.getFieldName();
col = new HashMap<>();
col.put("title", extendInfoPO.getFieldNameDesc());
col.put("key", tmpkey);
col.put("dataIndex", tmpkey);
col.put("com", getFieldDetailInfo(user, extendInfoPO, extendInfoPO.getViewAttr(), showLabel, width));
col.put("width", width + "%");
if (checkBox && Integer.valueOf(7).equals(extendInfoPO.getControlType())) {
col.put("checkType", "checkbox");
}
lsCol.add(col);
}
return lsCol;
}
public static List<Map<String, Object>> convertInfoListToTable(User user, List<ExtendInfoPO> infoPOList, int viewAttr, boolean showLabel) {
return convertInfoListToTable(user, infoPOList, viewAttr, showLabel, false);
}
/**
*
*
@ -160,9 +206,9 @@ public class ExtendInfoBO {
/**
*
*
* @param user
* @param user
* @param extendInfoPO
* @param viewAttr
* @param viewAttr
*/
private static List<FieldItem> getFieldDetailInfo(User user, ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) {
List<FieldItem> ls = new ArrayList<>();
@ -174,11 +220,11 @@ public class ExtendInfoBO {
/**
*
*
* @param user
* @param user
* @param extendInfoPO
* @param viewAttr
* @param showLabel
* @param width
* @param viewAttr
* @param showLabel
* @param width
*/
private static FieldItem createField(User user, ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) {
FieldItem fieldItem = new FieldItem();
@ -202,12 +248,36 @@ public class ExtendInfoBO {
fieldItem.setViewAttr(2);
}
}
// 浏览按钮特殊处理
if (FieldType.BROWSER.equals(fieldItem.getType())) {
String browserId = SelectOptionParam.getCustomBrowserId(extendInfoPO.getCustomValue());
BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), browserId).getBrowserConditionParam();
fieldItem.setBrowserConditionParam(browserConditionParam);
switch (fieldItem.getType()) {
case BROWSER:
String browserId = SelectOptionParam.getCustomBrowserId(extendInfoPO.getCustomValue());
BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), browserId).getBrowserConditionParam();
fieldItem.setBrowserConditionParam(browserConditionParam);
break;
case SELECT:
String customValue = Util.null2String(extendInfoPO.getCustomValue());
List<SearchConditionOption> searchConditionOptions = SelectOptionParam.convertJsonToListOption(customValue);
fieldItem.setOptions(searchConditionOptions);
break;
case FILEUPLOAD:
fieldItem.setUploadUrl("/api/doc/upload/uploadFile");
fieldItem.setCategory("category");
fieldItem.setMaxFilesNumber(10);
fieldItem.setMultiSelection(true);
Map<String, Object> otherParamsMap = new HashMap<>();
otherParamsMap.put("showClearAll", false);
otherParamsMap.put("showOrder", true);
fieldItem.setOtherParams(otherParamsMap);
break;
case DATEPICKER:
if ("402".equals(extendInfoPO.getBrowserType())) {
fieldItem.setFormat("YYYY");
} else if ("403".equals(extendInfoPO.getBrowserType())) {
fieldItem.setFormat("YYYY-MM");
}
break;
default:
break;
}
fieldItem.setWidth(width + "%");
@ -260,7 +330,7 @@ public class ExtendInfoBO {
String fieldid = Util.null2String(extendInfoPO.getId());//字段id
String fieldname = Util.null2String(extendInfoPO.getFieldName());//字段名
// String fieldlabel = Util.null2String(extendInfoPO.getFieldNameDesc());//字段显示名
String fieldlabel = "502327";//字段显示名
String fieldlabel = "502327";//字段显示名
String fieldhtmltype = Util.null2String(extendInfoPO.getControlType());//字段类型
String detailtype = Util.null2String(extendInfoPO.getBrowserType());//字段二级类型(浏览框--单人力)
String customValue = Util.null2String(extendInfoPO.getCustomValue());
@ -268,7 +338,7 @@ public class ExtendInfoBO {
switch (fieldhtmltype) {
case "1": //单行文本框
if (detailtype.equals("2")) {//数字
if ("2".equals(detailtype)) {//数字
searchConditionItem = conditionFactory.createCondition(ConditionType.INPUTNUMBER, fieldlabel, fieldname, isQuickSearch);
} else {
searchConditionItem = conditionFactory.createCondition(ConditionType.INPUT, "25034", fieldname, isQuickSearch);
@ -319,14 +389,14 @@ public class ExtendInfoBO {
break;
}
default:
if (detailtype.equals("161") || detailtype.equals("162") || detailtype.equals("256") || detailtype.equals("257")) {
BrowserBean browserbean = new BrowserBean( Util.null2String(detailtype));
if ("161".equals(detailtype) || "162".equals(detailtype) || "256".equals(detailtype) || "257".equals(detailtype)) {
BrowserBean browserbean = new BrowserBean(Util.null2String(detailtype));
BrowserInitUtil browserInitUtil = new BrowserInitUtil();
String fielddbtype = customValue;
if (!customValue.startsWith("browser.")) {
fielddbtype = "browser." + customValue;
}
if (detailtype.equals("161") || detailtype.equals("162")) {
if ("161".equals(detailtype) || "162".equals(detailtype)) {
browserInitUtil.initCustomizeBrow(browserbean, fielddbtype, Util.getIntValue(detailtype), user.getUID());
} else {
browserbean.getDataParams().put("cube_treeid", customValue);
@ -354,7 +424,9 @@ public class ExtendInfoBO {
String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) {
String fieldshowname = Util.null2String(shiftManagementToolKit.getShiftOnOffWorkSections(fieldvalues[i], user.getLanguage()));
if (fieldshowname.length() == 0) continue;
if (fieldshowname.length() == 0) {
continue;
}
Map<String, Object> replaceData = new HashMap<>();
replaceData.put("id", fieldvalues[i]);
replaceData.put("name", fieldshowname);
@ -367,7 +439,9 @@ public class ExtendInfoBO {
String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) {
String fieldshowname = Util.null2String(sensitiveWordTypeComInfo.getName(fieldvalues[i]));
if (fieldshowname.length() == 0) continue;
if (fieldshowname.length() == 0) {
continue;
}
Map<String, Object> replaceData = new HashMap<>();
replaceData.put("id", fieldvalues[i]);
replaceData.put("name", fieldshowname);
@ -395,7 +469,7 @@ public class ExtendInfoBO {
String fieldshowname = hrmFieldManager.getFieldvalue(user, customValue, Util.getIntValue(fieldid), Util.getIntValue(fieldhtmltype), Util.getIntValue(detailtype), tmpFieldValue, 0);
String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
String[] fieldshownames = Util.splitString(fieldshowname, ",");
if (detailtype.equals("257")) {
if ("257".equals(detailtype)) {
if (fieldshowname.endsWith("&nbsp")) {
fieldshowname = fieldshowname.substring(0, fieldshowname.length() - 5);
}
@ -422,7 +496,7 @@ public class ExtendInfoBO {
break;
case "4": //Check框
searchConditionItem = conditionFactory.createCondition(ConditionType.CHECKBOX, fieldlabel, fieldname);
if (detailtype.equals("2")) {
if ("2".equals(detailtype)) {
searchConditionItem.setConditionType(ConditionType.SWITCH);
}
@ -431,7 +505,7 @@ public class ExtendInfoBO {
List<SearchConditionOption> searchConditionOptions = SelectOptionParam.convertJsonToListOption(customValue);
searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname, searchConditionOptions);
if (detailtype.equals("") || detailtype.equals("0")) {
if ("".equals(detailtype) || "0".equals(detailtype)) {
detailtype = "1";
}
searchConditionItem.setKey(Util.null2String(fieldvalue));
@ -439,7 +513,7 @@ public class ExtendInfoBO {
searchConditionItem.setDetailtype(Util.getIntValue(detailtype, 3));
break;
case "6": //附件
if (fieldname.equals("resourceimageid")) {
if ("resourceimageid".equals(fieldname)) {
searchConditionItem = conditionFactory.createCondition(ConditionType.RESOURCEIMG, fieldlabel, fieldname, isQuickSearch);
} else {
searchConditionItem = conditionFactory.createCondition(ConditionType.UPLOAD, fieldlabel, fieldname, isQuickSearch);
@ -514,4 +588,334 @@ public class ExtendInfoBO {
return searchConditionItem;
}
// 基本信息明细表
// 个人信息明细表
// 工作信息明细表
public Map<String, Object> getFormFields(User user, String id, Integer viewAttr, boolean isAdd) {
Map<String, Object> result = new HashMap<String, Object>();
List<Object> lsGroup = new ArrayList<Object>();
Map<String, Object> groupitem = null;
List<Object> itemlist = null;
try {
if (isAdd) {
viewAttr = 2;
}
if (id.length() == 0) {
id = "" + user.getUID();
}
boolean isSelf = false;
if (id.equals("" + user.getUID())) {
isSelf = true;
}
String subcompanyid = "", departmentId = "";
RecordSet recordSet = new RecordSet();
//不能直接判断是否有人力资源维护权限,也需要根据分权进行判断
boolean canEdit = false;
recordSet.executeSql("select subcompanyid1, status, departmentId from hrmresource where id = " + id);
if (recordSet.next()) {
subcompanyid = Util.toScreen(recordSet.getString("subcompanyid1"), user.getLanguage());
departmentId = StringUtil.vString(recordSet.getString("departmentId"));
if (subcompanyid == null || "".equals(subcompanyid) || "null".equalsIgnoreCase(subcompanyid)) {
subcompanyid = "-1";
}
}
int operatelevel = -1;
//人力资源模块是否开启了管理分权,如不是,则不显示框架,直接转向到列表页面(新的分权管理)
int hrmdetachable = 0;
ManageDetachComInfo ManageDetachComInfo = new ManageDetachComInfo();
boolean isUseHrmManageDetach = ManageDetachComInfo.isUseHrmManageDetach();
if (isUseHrmManageDetach) {
hrmdetachable = 1;
} else {
hrmdetachable = 0;
}
if (hrmdetachable == 1) {
CheckSubCompanyRight CheckSubCompanyRight = new CheckSubCompanyRight();
operatelevel = CheckSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(), "HrmResourceEdit:Edit", Util.getIntValue(subcompanyid));
} else {
if (HrmUserVarify.checkUserRight("HrmResourceEdit:Edit", user, departmentId)) {
operatelevel = 2;
}
}
if (operatelevel > 0) {
canEdit = true;
}
int scopeId = 1;
HrmFieldGroupComInfo HrmFieldGroupComInfo = new HrmFieldGroupComInfo();
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
com.engine.hrm.biz.HrmFieldManager hfm = new com.engine.hrm.biz.HrmFieldManager("HrmCustomFieldByInfoType", scopeId);
CustomFieldManager cfm = new CustomFieldManager("HrmCustomFieldByInfoType", scopeId);
if (viewAttr != 1) {
hfm.isReturnDecryptData(true);
}
hfm.getHrmData(Util.getIntValue(id));
cfm.getCustomData(Util.getIntValue(id));
HrmListValidate hrmListValidate = new HrmListValidate();
while (HrmFieldGroupComInfo.next()) {
int grouptype = Util.getIntValue(HrmFieldGroupComInfo.getType());
if (grouptype != scopeId) {
continue;
}
int grouplabel = Util.getIntValue(HrmFieldGroupComInfo.getLabel());
int groupid = Util.getIntValue(HrmFieldGroupComInfo.getid());
hfm.getCustomFields(groupid);
groupitem = new HashMap<String, Object>();
itemlist = new ArrayList<Object>();
groupitem.put("title", SystemEnv.getHtmlLabelName(grouplabel, user.getLanguage()));
groupitem.put("defaultshow", true);
if (groupid == 4) {
groupitem.put("hide", (!isAdd && !canEdit && isSelf && viewAttr == 2 && hfm.getContactEditCount() == 0) || !hrmListValidate.isValidate(42));
} else {
groupitem.put("hide", (!isAdd && !canEdit && isSelf && viewAttr == 2 && hfm.getContactEditCount() == 0) || !"1".equals(Util.null2String(HrmFieldGroupComInfo.getIsShow())));
}
groupitem.put("items", itemlist);
lsGroup.add(groupitem);
while (hfm.next()) {
int tmpviewattr = viewAttr;
String fieldName = hfm.getFieldname();
String cusFieldname = "";
String fieldValue = "";
if (hfm.isBaseField(fieldName)) {
fieldValue = hfm.getHrmData(fieldName);
} else {
fieldValue = Util.null2String(new EncryptUtil().decrypt("cus_fielddata", "field" + hfm.getFieldid(), "HrmCustomFieldByInfoType", "" + scopeId, cfm.getData("field" + hfm.getFieldid()), viewAttr == 2, true));
cusFieldname = "customfield" + hfm.getFieldid();
if (isAdd) {
cusFieldname = "customfield_1_" + hfm.getFieldid();
}
}
if (!hfm.isUse() || (!isAdd && viewAttr == 2 && !canEdit && isSelf && !hfm.isModify())) {
HrmFieldBean hrmFieldBean = new HrmFieldBean();
hrmFieldBean.setFieldname(cusFieldname.length() > 0 ? cusFieldname : fieldName);
hrmFieldBean.setFieldhtmltype("1");
hrmFieldBean.setType("1");
if (!isAdd) {
hrmFieldBean.setFieldvalue(fieldValue);
}
hrmFieldBean.setIsFormField(true);
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
Map<String, Object> otherParams = new HashMap<String, Object>();
otherParams.put("hide", true);
searchConditionItem.setOtherParams(otherParams);
itemlist.add(searchConditionItem);
continue;
}
org.json.JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
HrmFieldBean hrmFieldBean = new HrmFieldBean();
hrmFieldBean.setFieldid((String) hrmFieldConf.get("id"));
hrmFieldBean.setFieldname(cusFieldname.length() > 0 ? cusFieldname : fieldName);
hrmFieldBean.setFieldlabel(hfm.getLable());
hrmFieldBean.setFieldhtmltype((String) hrmFieldConf.get("fieldhtmltype"));
hrmFieldBean.setType((String) hrmFieldConf.get("type"));
hrmFieldBean.setDmlurl((String) hrmFieldConf.get("dmlurl"));
hrmFieldBean.setIssystem("" + (Integer) hrmFieldConf.get("issystem"));
if (!isAdd) {
hrmFieldBean.setFieldvalue(fieldValue);
}
hrmFieldBean.setIsFormField(true);
if (viewAttr == 2 && "1".equals((String) hrmFieldConf.get("ismand"))) {
tmpviewattr = 3;
if ("3".equals(hrmFieldBean.getFieldhtmltype())) {
hrmFieldBean.setRules("required|string");
// if (hrmFieldBean.getType().equals("2")||hrmFieldBean.getType().equals("161")||hrmFieldBean.getType().equals("162")) {
// hrmFieldBean.setRules("required|string");
// }else{
// hrmFieldBean.setRules("required|integer");
// }
} else if ("4".equals(hrmFieldBean.getFieldhtmltype()) ||
"5".equals(hrmFieldBean.getFieldhtmltype())) {
hrmFieldBean.setRules("required|integer");
} else if ("1".equals(hrmFieldBean.getFieldhtmltype()) && "2".equals(hrmFieldBean.getType())) {
hrmFieldBean.setRules("required|integer");
} else {
hrmFieldBean.setRules("required|string");
}
}
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
if (searchConditionItem == null) {
continue;
}
if (searchConditionItem.getBrowserConditionParam() != null) {
searchConditionItem.getBrowserConditionParam().setViewAttr(tmpviewattr);
}
searchConditionItem.setViewAttr(tmpviewattr);
itemlist.add(searchConditionItem);
}
if (itemlist.size() == 0) {
lsGroup.remove(groupitem);
}
}
result.put("conditions", lsGroup);
//明细信息
List<Object> lsTable = new ArrayList<Object>();
List<HrmFieldBean> titles = null;
Map<String, Object> table = null;
Map<String, Object> maptab = null;
HrmFieldBean hrmFieldBean = null;
List<Map<String, Object>> columns = null;
List<Map<String, Object>> datas = null;
Map<String, Object> data = null;
result.put("tables", lsTable);
//标头信息--家庭信息
HrmFieldDetailComInfo HrmFieldDetailComInfo = new HrmFieldDetailComInfo();
LinkedHashMap<String, List<HrmFieldBean>> detialTable = HrmFieldDetailComInfo.getDetialTable("" + scopeId, viewAttr, "80%");
Iterator<Map.Entry<String, List<HrmFieldBean>>> entries = detialTable.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<String, List<HrmFieldBean>> entry = entries.next();
String tablename = entry.getKey();
titles = entry.getValue();
table = new HashMap<String, Object>();
columns = HrmFieldUtil.getHrmDetailTable(titles, null, user);
table.put("columns", columns);
datas = new ArrayList<Map<String, Object>>();
RecordSet rs = new RecordSet();
String sql = "select * from " + tablename + " where resourceid = " + id;
rs.executeSql(sql);
while (rs.next()) {
data = new HashMap<String, Object>();
for (HrmFieldBean fieldInfo : titles) {
if (!isAdd) {
data.put(fieldInfo.getFieldname(), TextUtil.toBase64ForMultilang(Util.null2String(rs.getString(fieldInfo.getFieldname()))));
}
}
datas.add(data);
}
table.put("datas", datas);
table.put("rownum", "rownum");
maptab = new Hashtable<String, Object>();
String tablabel = HrmResourceDetailTab.HrmResourceDetailTabInfo.get(tablename.toUpperCase());
maptab.put("tabname", SystemEnv.getHtmlLabelNames(tablabel, user.getLanguage()));
maptab.put("hide", (!hrmListValidate.isValidate(45) || (!isAdd && !canEdit && isSelf && viewAttr == 2)));
maptab.put("tabinfo", table);
lsTable.add(maptab);
}
//自定义信息
RecordSet RecordSet = new RecordSet();
CustomFieldTreeManager CustomFieldTreeManager = new CustomFieldTreeManager();
LinkedHashMap<String, String> ht = new LinkedHashMap<String, String>();
RecordSet.executeSql("select id, formlabel,viewtype from cus_treeform where parentid=" + scopeId + " order by scopeorder");
while (RecordSet.next()) {
if (RecordSet.getInt("viewtype") != 1) {
continue;
}
titles = new ArrayList<HrmFieldBean>();
int subId = RecordSet.getInt("id");
CustomFieldManager cfm2 = new CustomFieldManager("HrmCustomFieldByInfoType", subId);
cfm2.getCustomFields();
CustomFieldTreeManager.getMutiCustomData("HrmCustomFieldByInfoType", subId, Util.getIntValue(id, 0));
int colcount1 = 0;
int rowcount = 0;
int col = 0;
while (cfm2.next()) {
rowcount++;
if (!cfm2.isUse() || (!isAdd && viewAttr == 2 && !canEdit && isSelf && !cfm2.isModify())) {
continue;
}
col++;
}
if (rowcount == 0) {
continue;
}
cfm2.beforeFirst();
ht.put("cus_list_" + subId, RecordSet.getString("formlabel"));
cfm2.beforeFirst();
while (cfm2.next()) {
if (!cfm2.isUse() || (!isAdd && viewAttr == 2 && !canEdit && isSelf && !cfm2.isModify())) {
continue;
}
int tmpviewattr = viewAttr;
//创建表头
String fieldname = "customfield" + cfm2.getId() + "_" + subId;
if (isAdd) {
fieldname = "customfield_1_" + cfm2.getId() + "_" + subId;
}
hrmFieldBean = new HrmFieldBean();
hrmFieldBean.setFieldid("" + cfm2.getId());
hrmFieldBean.setFieldname(fieldname);
hrmFieldBean.setFieldlabel(cfm2.getLable());
hrmFieldBean.setFieldhtmltype(cfm2.getHtmlType());
hrmFieldBean.setType("" + cfm2.getType());
hrmFieldBean.setDmlurl(cfm2.getDmrUrl());
if (viewAttr == 2 && cfm2.isMand()) {
tmpviewattr = 3;
hrmFieldBean.setRules("required|string");
}
hrmFieldBean.setViewAttr(tmpviewattr);
hrmFieldBean.setWidth("80%");
titles.add(hrmFieldBean);
}
table = new HashMap<String, Object>();
if (col > 0) {
columns = HrmFieldUtil.getHrmDetailTable(titles, null, user);
table.put("columns", columns);
}
datas = new ArrayList<Map<String, Object>>();
cfm2.beforeFirst();
while (CustomFieldTreeManager.nextMutiData()) {
data = new HashMap<String, Object>();
while (cfm2.next()) {
// if(!cfm2.isUse()||(!isAdd&&viewAttr==2&&!canEdit&&isSelf&&!cfm2.isModify()))continue;
int fieldid = cfm2.getId(); //字段id
int type = cfm2.getType();
String dmlurl = cfm2.getDmrUrl();
int fieldhtmltype = Util.getIntValue(cfm2.getHtmlType());
String fieldname = "customfield" + cfm2.getId() + "_" + subId;
if (isAdd) {
fieldname = "customfield_1_" + cfm2.getId() + "_" + subId;
}
String fieldvalue = "";
if (!isAdd) {
fieldvalue = Util.null2String(CustomFieldTreeManager.getMutiData("field" + fieldid));
}
data.put(fieldname, fieldvalue);
if ("1".equals(cfm2.getHtmlType()) && cfm2.getType() == 1) {
data.put(fieldname, TextUtil.toBase64ForMultilang(Util.null2String(fieldvalue)));
} else if ("3".equals(cfm2.getHtmlType())) {
String fieldshowname = hfm.getFieldvalue(user, dmlurl, fieldid, fieldhtmltype, type, fieldvalue, 0);
data.put(fieldname, fieldvalue);
data.put(fieldname + "span", fieldshowname);
} else if ("4".equals(cfm2.getHtmlType())) {
data.put(fieldname, "1".equals(fieldvalue));
}
//只允许有权限的人删除明细行,没有权限的人只能修改不能删除
if (canEdit) {
data.put("viewAttr", 2);
} else {
data.put("viewAttr", 1);
}
}
cfm2.beforeFirst();
datas.add(data);
}
table.put("datas", datas);
table.put("rownum", "nodesnum_" + subId);
maptab = new Hashtable<String, Object>();
RecordSet rs = new RecordSet();
rs.executeSql("select id, formlabel from cus_treeform where parentid=" + scopeId + " and id=" + subId + " order by scopeorder");
if (rs.next()) {
maptab.put("tabname", rs.getString("id"));
maptab.put("tabname", rs.getString("formlabel"));
}
maptab.put("hide", col == 0);
maptab.put("tabinfo", table);
lsTable.add(maptab);
}
} catch (Exception e) {
new BaseBean().writeLog(e);
}
return result;
}
}

@ -38,17 +38,17 @@ public class ExtendInfoFieldParam {
public String getControlType() {
JSONArray fieldType = (JSONArray) this.getFieldType();
String fieldHtmlType = Util.null2String(fieldType.get(0));
if (fieldHtmlType.equals("input")) {
if ("input".equals(fieldHtmlType)) {
fieldHtmlType = "1";
} else if (fieldHtmlType.equals("textarea")) {
} else if ("textarea".equals(fieldHtmlType)) {
fieldHtmlType = "2";
} else if (fieldHtmlType.equals("browser")) {
} else if ("browser".equals(fieldHtmlType)) {
fieldHtmlType = "3";
} else if (fieldHtmlType.equals("check")) {
} else if ("check".equals(fieldHtmlType)) {
fieldHtmlType = "4";
} else if (fieldHtmlType.equals("select")) {
} else if ("select".equals(fieldHtmlType)) {
fieldHtmlType = "5";
} else if (fieldHtmlType.equals("upload")) {
} else if ("upload".equals(fieldHtmlType)) {
fieldHtmlType = "6";
}
return fieldHtmlType;
@ -60,27 +60,27 @@ public class ExtendInfoFieldParam {
if (fieldType.size() > 1) {
browserType = Util.null2String(fieldType.get(1));
}
if (controlType.equals("1")) {
if (browserType.equals("text")) {
if ("1".equals(controlType)) {
if ("text".equals(browserType)) {
browserType = "1";
} else if (browserType.equals("int")) {
} else if ("int".equals(browserType)) {
browserType = "2";
} else if (browserType.equals("float")) {
} else if ("float".equals(browserType)) {
browserType = "3";
} else if (browserType.equals("file")) {
} else if ("file".equals(browserType)) {
browserType = "1";
}
}
if (controlType.equals("2")) {
if ("2".equals(controlType)) {
browserType = "1";
} else if (controlType.equals("3")) {
} else if ("3".equals(controlType)) {
browserType = Util.null2String(((JSONObject) fieldType.get(1)).get("value"));
} else if (controlType.equals("4")) {
} else if ("4".equals(controlType)) {
browserType = "1";
} else if (controlType.equals("5")) {
} else if ("5".equals(controlType)) {
browserType = "1";
} else if (controlType.equals("6")) {
if (browserType.equals("file")) {
} else if ("6".equals(controlType)) {
if ("file".equals(browserType)) {
browserType = "1";
}
}
@ -89,7 +89,7 @@ public class ExtendInfoFieldParam {
public String getDbType(String controlType, String browserType) {
FieldParam fp = new FieldParam();
if (controlType.equals("1")) {
if ("1".equals(controlType)) {
JSONArray fieldType = (JSONArray) this.getFieldType();
String dbLength = "100";
if (fieldType.size() > 2) {
@ -101,15 +101,15 @@ public class ExtendInfoFieldParam {
}
fp.setSimpleText(Util.getIntValue(browserType, -1), dbLength);
} else if (controlType.equals("2")) {
} else if ("2".equals(controlType)) {
fp.setText();
} else if (controlType.equals("3")) {
} else if ("3".equals(controlType)) {
fp.setBrowser(Util.getIntValue(browserType, -1));
} else if (controlType.equals("4")) {
} else if ("4".equals(controlType)) {
fp.setCheck();
} else if (controlType.equals("5")) {
} else if ("5".equals(controlType)) {
fp.setSelect();
} else if (controlType.equals("6")) {
} else if ("6".equals(controlType)) {
fp.setAttach();
}
return fp.getFielddbtype();

@ -131,4 +131,6 @@ public class ExtendInfoPO {
private int deleteType;
private Date createTime;
private Date updateTime;
private Integer viewAttr;
}

@ -17,4 +17,5 @@ import lombok.NoArgsConstructor;
public class FieldTransferParam {
private String id;
private String name;
private boolean check;
}

@ -0,0 +1,36 @@
package com.engine.organization.entity.hrmresource.bo;
import com.engine.organization.entity.hrmresource.po.ResourcePO;
import com.engine.organization.entity.searchtree.SearchTree;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2022/12/28
* @version: 1.0
*/
public class ResourceBO {
public static List<SearchTree> buildSetToSearchTree(Collection<ResourcePO> builderJobs) {
return builderJobs.stream().map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(false);
tree.setIcon("icon-coms-currency-Customer");
tree.setId(item.getId().toString());
tree.setIsParent(false);
tree.setIsVirtual("0");
tree.setName(item.getLastName());
tree.setPid("0");
tree.setSelected(false);
tree.setType("4");
tree.setParentComp(null == item.getJobId() ? "0" : item.getJobId().toString());
tree.setOrderNum(null == item.getDspOrder() ? 0 : item.getDspOrder());
return tree;
}).collect(Collectors.toList());
}
}

@ -1,10 +1,7 @@
package com.engine.organization.entity.hrmresource.param;
import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.*;
/**
* @author:dxfeng
@ -15,6 +12,7 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class HrmResourceSearchParam extends BaseQueryParam {
/**
*

@ -0,0 +1,22 @@
package com.engine.organization.entity.hrmresource.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2023/01/05
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SearchTemplateParam {
private String key;
//private boolean selected;
private String showname;
private String fields;
}

@ -0,0 +1,67 @@
package com.engine.organization.entity.hrmresource.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
*
* @TableName jcl_org_custom_template
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class JclOrgCustomTemplatePO implements Serializable {
/**
*
*/
private Integer id;
/**
*
*/
private String name;
/**
*
*/
private String basicFields;
/**
*
*/
private String personalFields;
/**
*
*/
private String workFields;
/**
*
*/
private Integer isused;
/**
*
*/
private Integer creator;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,37 @@
package com.engine.organization.entity.hrmresource.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/12/15
* @Version V1.0
**/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ResourcePO {
private Long id;
private Integer subcompanyid1;
private Integer departmentid;
private Integer jobtitle;
private String lastName;
private Integer dspOrder;
/**
* ID
*/
private Long jobId;
}

@ -0,0 +1,29 @@
package com.engine.organization.entity.hrmresource.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author:dxfeng
* @createTime: 2023/01/06
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SearchTemplatePO {
private Integer id;
private String name;
private String basicFields;
private String personalFields;
private String workFields;
private String isused;
private Integer creator;
private Date createTime;
private Date updateTime;
}

@ -0,0 +1,22 @@
package com.engine.organization.entity.hrmresource.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2023/01/11
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TransferDataPO {
private String id;
private String label;
private String title;
private String idx;
}

@ -0,0 +1,47 @@
package com.engine.organization.entity.hrmresource.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:ml
* @createTime: 2023/01/06
* @version: 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "c0583f20-f10c-11ec-9947-00e04c680716",
fields = "t.id," +
"t.lastname," +
"t.departmentid," +
"t.subcompanyid1," +
"t.jobtitle," +
"t.mobile," +
"t.telephone," +
"t.managerid, " +
"t.dsporder ",
fromSql = "FROM hrmresource t ",
orderby = " dsporder ",
sortway = " asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(text = "查看"),
@OrganizationTableOperate(index = "1", text = "另存为版本")
},
tableType = WeaTableType.CHECKBOX
)
public class HrmResourceJclVO {
/**
*
*/
@OrganizationTableColumn(column = "id", display = false)
private Long id;
}

@ -18,20 +18,21 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@OrganizationTable(pageId = "c0583f20-f10c-11ec-9947-00e04c680716",
fields = "t.id," +
"t.last_name," +
"t.department_id," +
"t.company_id," +
"t.job_title," +
"t.lastname," +
"t.departmentid," +
"t.subcompanyid1," +
"t.jobtitle," +
"t.mobile," +
"t.telephone," +
"t.manager_id, " +
"t.show_order ",
fromSql = "FROM jcl_org_hrmresource t ",
orderby = " show_order ",
"t.managerid, " +
"t.dsporder ",
fromSql = "FROM hrmresource t left join cus_fielddata t0 on t.id = t0.id and t0.scopeid ='-1' left join cus_fielddata t1 on t.id = t1.id and t1.scopeid ='1' left join cus_fielddata t2 on t.id = t2.id and t2.scopeid ='3' left join HRMJOBTITLES t3 on t.JOBTITLE=t3.id left join HRMJOBACTIVITIES t4 on t3.JOBACTIVITYID=t4.ID left join HRMJOBGROUPS t5 on t4.JOBGROUPID=t5.ID ",
orderby = " t.dsporder ",
sortway = " asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(text = "查看")
@OrganizationTableOperate(text = "查看"),
@OrganizationTableOperate(index = "1", text = "另存为版本")
},
tableType = WeaTableType.CHECKBOX
)
@ -45,21 +46,21 @@ public class HrmResourceVO {
/**
*
*/
@OrganizationTableColumn(text = "姓名", width = "25%", column = "last_name")
@OrganizationTableColumn(text = "姓名", width = "25%", column = "lastname")
private String lastName;
/**
*
*/
@OrganizationTableColumn(text = "部门", width = "25%", column = "department_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getDepartmentName")
@OrganizationTableColumn(text = "部门", width = "25%", column = "departmentid", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getDepartmentName")
private String departmentName;
/**
*
*/
@OrganizationTableColumn(text = "分部", width = "25%", column = "company_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getCompanyName")
@OrganizationTableColumn(text = "分部", width = "25%", column = "subcompanyid1", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getCompanyName")
private String companyName;
@OrganizationTableColumn(text = "岗位", width = "25%", column = "job_title", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getJobName")
@OrganizationTableColumn(text = "岗位", width = "25%", column = "jobtitle", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getJobName")
private String jobName;
/**
@ -75,9 +76,9 @@ public class HrmResourceVO {
/**
*
*/
@OrganizationTableColumn(text = "直接上级", width = "25%", column = "manager_id", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getManagerName")
@OrganizationTableColumn(text = "直接上级", width = "25%", column = "managerid", transmethod = "com.engine.organization.transmethod.HrmResourceTransMethod.getManagerName")
private String managerName;
@OrganizationTableColumn(text = "显示顺序", width = "25%", column = "show_order", orderkey = "show_order")
@OrganizationTableColumn(text = "显示顺序", width = "25%", column = "dsporder", orderkey = "dsporder")
private Integer showOrder;
}

@ -0,0 +1,67 @@
package com.engine.organization.entity.hrmresource.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;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "8df45b09-0cda-4f57-a93a-ca9f96a4c111",
fields = "t.id," +
"t.name," +
"t.basic_fields," +
"t.personal_fields," +
"t.work_fields," +
"t.isused," +
"t.creator," +
"t.create_time," +
"t.update_time",
fromSql = "FROM jcl_org_custom_template t ",
orderby = "id",
sortway = "asc",
primarykey = "id",
operates = {
@OrganizationTableOperate(index = "0", text = "编辑"),
@OrganizationTableOperate(index = "1", text = "另存为"),
@OrganizationTableOperate(index = "2", text = "删除")
},
tableType = WeaTableType.CHECKBOX
)
public class JclOrgCustomTemplateVO {
@OrganizationTableColumn(column = "id", display = false)
private Integer id;
@OrganizationTableColumn(text = "模板名称", width = "30%", column = "name")
private String name;
@OrganizationTableColumn(column = "basic_fields", display = false)
private String basicFields;
@OrganizationTableColumn(column = "personal_fields", display = false)
private String personalFields;
@OrganizationTableColumn(column = "work_fields", display = false)
private String workFields;
@OrganizationTableColumn(column = "isused", display = false)
private Integer isUsed;
@OrganizationTableColumn(column = "creator", display = false)
private Integer creator;
@OrganizationTableColumn(text = "创建时间",column = "create_time", width = "30%")
private Date createTime;
@OrganizationTableColumn(text = "更新时间",column = "update_time", display = false)
private Date updateTime;
}

@ -0,0 +1,42 @@
package com.engine.organization.entity.jclimport.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.json.JSONException;
import org.json.JSONObject;
import weaver.general.Util;
/**
* @author:dxfeng
* @createTime: 2022/12/06
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class HrmFormFieldPO {
private Integer fieldId;
private String fieldName;
private String labelName;
private Integer isSystem;
private Integer isMand;
private String fieldDbType;
private String fieldHtmlType;
private String type;
private String dmlUrl;
public JSONObject getJsonObject(String fieldValue) throws JSONException {
JSONObject jsonObject = new JSONObject();
jsonObject.put("fieldid", Util.null2String(this.fieldId));
jsonObject.put("fieldhtmltype", Util.null2String(this.fieldHtmlType));
jsonObject.put("type", Util.null2String(this.type));
jsonObject.put("dmlurl", Util.null2String(this.dmlUrl));
jsonObject.put("fieldvalue", fieldValue);
return jsonObject;
}
}

@ -10,6 +10,7 @@ import com.engine.organization.transmethod.JobTransMethod;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils;
import weaver.general.Util;
import weaver.hrm.job.JobTitlesComInfo;
import java.util.*;
import java.util.stream.Collectors;
@ -30,11 +31,10 @@ public class JobBO {
.builder()
.id(param.getId() == null ? 0 : param.getId())
.jobNo(param.getJobNo())
.jobName(param.getJobName())
.ecCompany(param.getEcCompany())
.ecDepartment(param.getEcDepartment())
.parentComp(param.getSubcompanyid1())
.parentDept( param.getDepartmentid())
.jobTitleName(param.getJobTitleName())
.ecJobTitle(param.getEcJobTitle())
.ecCompany(param.getSubcompanyid1())
.ecDepartment(param.getDepartmentid())
.sequenceId(param.getSequenceId())
.schemeId(param.getSchemeId())
.parentJob(param.getParentJob())
@ -53,7 +53,7 @@ public class JobBO {
}
public static List<SingleJobTreeVO> buildSingleJobTreeVOS(List<JobPO> jobPOS, Long parentDept) {
public static List<SingleJobTreeVO> buildSingleJobTreeVOS(List<JobPO> jobPOS, Integer parentDept) {
if (CollectionUtils.isEmpty(jobPOS)) {
return Collections.emptyList();
}
@ -64,10 +64,10 @@ public class JobBO {
.builder()
.id(e.getId())
.jobNo(e.getJobNo())
.jobName(e.getJobName())
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
.jobName(e.getJobTitleName())
//.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobTitleName())
.parentJob(e.getParentJob())
.parentDept(e.getParentDept())
.parentDept(e.getEcDepartment())
.build()).collect(Collectors.toList());
//获取非一级部门
Map<Long, List<SingleJobTreeVO>> collects = singleJobTreeVOS.stream().filter(item -> null != item.getParentJob()).collect(Collectors.groupingBy(SingleJobTreeVO::getParentJob));
@ -78,32 +78,30 @@ public class JobBO {
public static List<JobListDTO> buildDTOList(Collection<JobListDTO> list) {
// 递归添加父级数据
Map<Long, JobListDTO> poMaps = list.stream().collect(Collectors.toMap(JobListDTO::getId, item -> item));
List<JobListDTO> dtoList = list.stream().map(e ->
JobListDTO.builder()
.id(e.getId())
.jobNo(e.getJobNo())
.jobName(e.getJobName())
.compName(e.getCompName())
.deptName(e.getDeptName())
.sequenceName(e.getSequenceName())
.schemeName(e.getSchemeName())
.jobTitleName(e.getJobTitleName())
.subCompanyName(e.getSubCompanyName())
.departmentName(e.getDepartmentName())
//.sequenceName(e.getSequenceName())
//.schemeName(e.getSchemeName())
//.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())
//.forbiddenTag(e.getForbiddenTag())
.isUsed(0)
.build()).collect(Collectors.toList());
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
// 处理被引用数据
List<String> usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId();
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
return dtoList.stream().peek(e -> {
List<JobListDTO> childList = collects.get(e.getId());
if (CollectionUtils.isNotEmpty(childList)) {
e.setChildren(childList);
e.setIsUsed(1);
} else {
}else{
if (usedIds.contains(Util.null2String(e.getId()))) {
e.setIsUsed(1);
} else {
@ -151,19 +149,30 @@ public class JobBO {
return builderJobs.stream().map(item -> {
SearchTree tree = new SearchTree();
tree.setCanClick(true);
tree.setCanceled(false);
tree.setCanceled(item.getForbiddenTag() != 0);
tree.setIcon("icon-coms-content-o");
tree.setId(item.getId().toString());
tree.setIsParent(false);
tree.setIsVirtual("0");
tree.setName(item.getJobName());
tree.setName(item.getJobTitleName());
tree.setPid(null == item.getParentJob() ? "0" : item.getParentJob().toString());
tree.setSelected(false);
tree.setType("3");
tree.setParentComp(null == item.getParentDept() ? "0" : item.getParentDept().toString());
tree.setParentComp(null == item.getEcDepartment() ? "0" : item.getEcDepartment().toString());
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
return tree;
}).collect(Collectors.toList());
}
public static String getJobTitleNameByEcJobTitle(String ecJobTitle) {
return new JobTitlesComInfo().getJobTitlesname(ecJobTitle);
}
public static JobPO getEcJobTitleByJobId(Long jobId) {
if (null == jobId) {
return null;
}
return MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId);
}
}

@ -34,8 +34,8 @@ public class JobListDTO {
/**
*
*/
@TableTitle(title = "名称", dataIndex = "jobName", key = "jobName",width = "150")
private String jobName;
@TableTitle(title = "名称", dataIndex = "jobTitleName", key = "jobTitleName", width = "150")
private String jobTitleName;
/**
*
*/
@ -44,23 +44,23 @@ public class JobListDTO {
/**
*
*/
@TableTitle(title = "所属分部", dataIndex = "compName", key = "compName")
private String compName;
@TableTitle(title = "所属分部", dataIndex = "subCompanyName", key = "subCompanyName")
private String subCompanyName;
/**
*
*/
@TableTitle(title = "所属部门", dataIndex = "deptName", key = "deptName")
private String deptName;
@TableTitle(title = "所属部门", dataIndex = "departmentName", key = "departmentName")
private String departmentName;
/**
*
*/
@TableTitle(title = "岗位序列", dataIndex = "sequenceName", key = "sequenceName")
private String sequenceName;
//@TableTitle(title = "岗位序列", dataIndex = "sequenceName", key = "sequenceName")
//private String sequenceName;
/**
*
*/
@TableTitle(title = "等级方案", dataIndex = "schemeName", key = "schemeName")
private String schemeName;
//@TableTitle(title = "等级方案", dataIndex = "schemeName", key = "schemeName")
//private String schemeName;
/**
*
*/
@ -68,7 +68,7 @@ public class JobListDTO {
//@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName")
private String parentJobName;
private Long parentJob;
private Long parentComp;
private Integer ecCompany;
/**
*
*/
@ -84,8 +84,8 @@ public class JobListDTO {
/**
*
*/
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
private Integer forbiddenTag;
//@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
//private Integer forbiddenTag;
/**
*

@ -1,10 +1,7 @@
package com.engine.organization.entity.job.param;
import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.*;
/**
* @description:
@ -16,6 +13,7 @@ import lombok.NoArgsConstructor;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class JobSearchParam extends BaseQueryParam {
/**
*
@ -28,15 +26,15 @@ public class JobSearchParam extends BaseQueryParam {
/**
*
*/
private String jobName;
private String jobTitleName;
/**
* ec
*/
private Long ecCompany;
private Integer ecCompany;
/**
* ec
*/
private Long ecDepartment;
private Integer ecDepartment;
/**
*
*/
@ -79,7 +77,9 @@ public class JobSearchParam extends BaseQueryParam {
*/
private Integer showOrder;
private Long subcompanyid1;
private Integer subcompanyid1;
private Long departmentid;
private Integer departmentid;
private Integer ecJobTitle;
}

@ -29,24 +29,24 @@ public class JobPO {
/**
*
*/
private String jobName;
/**
*
*/
private Long parentComp;
private String jobTitleName;
///**
// * 所属分部
// */
//private Integer parentComp;
/**
* ec
*/
private Long ecCompany;
/**
*
*/
private Long parentDept;
private Integer ecCompany;
///**
// * 所属部门
// */
//private Integer parentDept;
/**
* ec
*/
private Long ecDepartment;
private Integer ecDepartment;
/**
*
@ -93,6 +93,8 @@ public class JobPO {
private String levelId;
private Integer ecJobTitle;
private Long creator;
private int deleteType;

@ -19,8 +19,8 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "98e9c62f-cd12-11ec-a15f-00ffcbed7123",
fields = "t.id, t.job_no, t.job_name as name, t.sequence_id, t.scheme_id , t.grade_id , t.level_id",
fromSql = "FROM jcl_org_job t ",
fields = "t.id, t.job_no, h.jobtitlename as name, t.sequence_id, t.scheme_id , t.grade_id , t.level_id",
fromSql = "FROM jcl_org_job t left join hrmjobtitles h on t.ec_jobTitle = h.id ",
orderby = "id",
sortway = "asc",
primarykey = "id",
@ -41,12 +41,12 @@ public class JobBrowserVO {
@OrganizationTableColumn(text = "岗位名称", width = "25%", column = "name")
private String jobName;
@OrganizationTableColumn(text = "等级方案", width = "25%", column = "scheme_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getSchemeName")
private String schemeName;
@OrganizationTableColumn(text = "职等", width = "25%", column = "level_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getLevelName")
private String levelName;
@OrganizationTableColumn(text = "职级", width = "25%", column = "grade_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getGradeName")
private String gradeName;
@OrganizationTableColumn(text = "岗位序列", width = "25%", column = "sequence_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getSequenceName")
private String sequenceName;
//@OrganizationTableColumn(text = "等级方案", width = "25%", column = "scheme_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getSchemeName")
//private String schemeName;
//@OrganizationTableColumn(text = "职等", width = "25%", column = "level_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getLevelName")
//private String levelName;
//@OrganizationTableColumn(text = "职级", width = "25%", column = "grade_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getGradeName")
//private String gradeName;
//@OrganizationTableColumn(text = "岗位序列", width = "25%", column = "sequence_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getSequenceName")
//private String sequenceName;
}

@ -32,12 +32,12 @@ public class SingleJobTreeVO {
@TableTitle(title = "岗位名称", dataIndex = "jobName", key = "jobName")
private String jobName;
@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName")
private String parentJobName;
//@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName")
//private String parentJobName;
private Long parentJob;
private Long parentDept;
private Integer parentDept;
private List<SingleJobTreeVO> children;

@ -98,8 +98,12 @@ public class FieldInfo {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FieldInfo fieldInfo = (FieldInfo) o;
return Objects.equals(fieldName, fieldInfo.fieldName) &&
Objects.equals(firstFieldType, fieldInfo.firstFieldType) &&

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
@ -20,4 +21,6 @@ public class FormItem {
private String id;
private String title;
private List<Item> items;
private List<Map<String, Object>> tables;
}

@ -27,10 +27,14 @@ public class UserCard {
private String email;
private String phone;
private String belongTo;
private String accountType;
private String status;
public String getBelongTo() {
return StringUtils.isBlank(belongTo) ? "主账号" : "次账号";
public String getAccountType() {
if ("1".equals(accountType)) {
return "次账号";
}
return "主账号";
}
public String getStatus() {
@ -43,7 +47,7 @@ public class UserCard {
public String getImage() {
weaver.hrm.User user = new weaver.hrm.User();
user.setLanguage(LanguageService.getDefaultLang());
if(StringUtils.isNotBlank(image)&& image.contains("/")){
if (StringUtils.isNotBlank(image) && image.contains("/")) {
return image;
}
return FieldDefinedValueUtil.getFieldValue(user, ExtendInfoPO.builder().controlType(6).browserType("1").build(), image);

@ -29,6 +29,10 @@ public class CardButtonPO {
private String sysDefault;
private Integer showOrder;
private Integer openType;
private Long creator;
private int deleteType;

@ -0,0 +1,24 @@
package com.engine.organization.entity.personnelcard.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2022/12/05
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CusTreeFormPO {
private String scope;
private String formLabel;
private Integer id;
private Integer parentId;
private String viewType;
private Integer scopeOrder;
}

@ -0,0 +1,24 @@
package com.engine.organization.entity.personnelcard.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2022/12/05
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class HrmFieldGroupPO {
private Integer id;
private Integer groupLabel;
private Integer groupOrder;
private Integer groupType;
private Integer isShow;
private String labelName;
}

@ -33,7 +33,7 @@ import lombok.NoArgsConstructor;
orderby = "id",
sortway = "asc",
primarykey = "id",
tableType = WeaTableType.CHECKBOX
tableType = WeaTableType.NONE
)
public class CardAccessVO {
@ -55,7 +55,7 @@ public class CardAccessVO {
@OrganizationTableColumn(text = "所有上级可见", width = "15%", column = "all_superior")
private Integer allSuperior;
@OrganizationTableColumn(text = "查看自定义", width = "15%", column = "custom",transmethod = "com.engine.organization.transmethod.SystemTransMethod.getRoleName")
@OrganizationTableColumn(text = "查看自定义", width = "30%", column = "custom",transmethod = "com.engine.organization.transmethod.SystemTransMethod.getRoleName")
private String custom;
}

@ -0,0 +1,21 @@
package com.engine.organization.entity.resume.po;
import lombok.Data;
/**
* @author:dxfeng
* @createTime: 2022/12/30
* @version: 1.0
*/
@Data
public class HrmFamilyInfoPO {
private Integer resourceId;
private String member;
private String title;
private String company;
private String jobTitle;
private String address;
private String uuid;
private String birthday;
private Integer whetherChildren;
}

@ -0,0 +1,22 @@
package com.engine.organization.entity.resume.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2022/12/29
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PersonnelResumeColumn {
private String name;
private String value;
private Integer colspans;
private Integer rowspans;
}

@ -0,0 +1,102 @@
package com.engine.organization.entity.resume.po;
import lombok.Data;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.IOUtils;
import weaver.file.ImageFileManager;
import weaver.general.GCONST;
import weaver.general.Util;
import java.io.*;
import java.nio.file.Files;
import java.util.Base64;
/**
* @author:dxfeng
* @createTime: 2022/12/29
* @version: 1.0
*/
@Data
public class PersonnelResumePO {
private Integer id;
private String lastName;
private String sex;
private String birthday;
// resourceImageId;
private String image;
private String imageId;
private String nativePlace;
// policy;
private String politics;
// departmentid;
private String department;
// maritalStatus;
private String marriage;
private String jobTitle;
private String companyStartDate;
private String workStartDate;
// certificatenum
private String idCard;
// homeaddress
private String address;
private String telephone;
private String email;
private String selfStatement;
public String getSex() {
if ("1".equals(sex)) {
return "女";
}
return "男";
}
public String getImage() {
if (StringUtils.isBlank(image)) {
return "";
}
ImageFileManager manager = new ImageFileManager();
manager.getImageFileInfoById(Util.getIntValue(image));
InputStream inputStream = manager.getInputStream();
String imageStr = "";
try {
String outPutPath = GCONST.getRootPath() + "hrm" + File.separator + "import" + File.separator + "template" + File.separator
+ manager.getImageFileName();
File f = new File(outPutPath);
if (!f.exists()) {
String substring = outPutPath.substring(0, outPutPath.lastIndexOf(File.separator));
File file = new File(substring);
if (file.mkdirs()) {
boolean newFile = f.createNewFile();
if (!newFile) {
throw new IOException(outPutPath + "文件创建失败");
}
}
}
Thumbnails.of(inputStream).forceSize(100, 120).toFile(f);
InputStream fileInputStream = Files.newInputStream(f.toPath());
imageStr = "data:image/" + manager.getImageFileType() + ";base64," + Base64.getEncoder().encodeToString(IOUtils.toByteArray(fileInputStream));
// 删除文件
f.delete();
} catch (IOException e) {
throw new RuntimeException(e);
}
return imageStr;
}
public String getMarriage() {
if (StringUtils.isBlank(marriage)) {
return "未婚";
}
switch (marriage) {
case "1":
return "已婚";
case "2":
return "离异";
case "0":
default:
return "未婚";
}
}
}

@ -0,0 +1,23 @@
package com.engine.organization.entity.resume.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2022/12/29
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PersonnelResumeTable {
private String title;
private List<PersonnelResumeColumn> columns;
private List<List<PersonnelResumeColumn>> datas;
}

@ -1,7 +1,6 @@
package com.engine.organization.entity.searchtree;
import com.api.hrm.bean.TreeNode;
import lombok.Data;
import java.util.Objects;
@ -11,7 +10,6 @@ import java.util.Objects;
* @createTime: 2022/05/26
* @version: 1.0
*/
@Data
public class SearchTree extends TreeNode {
private String companyid;
private String isVirtual;
@ -22,10 +20,78 @@ public class SearchTree extends TreeNode {
private String parentComp;
private Integer orderNum;
public String getCompanyid() {
return companyid;
}
public void setCompanyid(String companyid) {
this.companyid = companyid;
}
public String getIsVirtual() {
return isVirtual;
}
public void setIsVirtual(String isVirtual) {
this.isVirtual = isVirtual;
}
public String getPsubcompanyid() {
return psubcompanyid;
}
public void setPsubcompanyid(String psubcompanyid) {
this.psubcompanyid = psubcompanyid;
}
public String getDisplayType() {
return displayType;
}
public void setDisplayType(String displayType) {
this.displayType = displayType;
}
public boolean isCanceled() {
return isCanceled;
}
public void setCanceled(boolean canceled) {
isCanceled = canceled;
}
public String getRequestParams() {
return requestParams;
}
public void setRequestParams(String requestParams) {
this.requestParams = requestParams;
}
public String getParentComp() {
return parentComp;
}
public void setParentComp(String parentComp) {
this.parentComp = parentComp;
}
public Integer getOrderNum() {
return orderNum;
}
public void setOrderNum(Integer orderNum) {
this.orderNum = orderNum;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
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);
}

@ -1,6 +1,12 @@
package com.engine.organization.entity.searchtree;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @description:
@ -26,5 +32,38 @@ public class SearchTreeParams {
private String virtualCompanyid;
private String isLoadSubDepartment;
// 人员筛选,添加分部、部门、岗位、人员搜索条件
private String subcompanyid1;
private String departmentid;
private String jobId;
private String resourceId;
private boolean personnelScreening;
public List<Integer> getSubcompanyid1() {
if (StringUtils.isBlank(subcompanyid1)) {
return new ArrayList<>();
}
return Arrays.stream(subcompanyid1.split(",")).map(Integer::parseInt).collect(Collectors.toList());
}
public List<Integer> getDepartmentid() {
if (StringUtils.isBlank(departmentid)) {
return new ArrayList<>();
}
return Arrays.stream(departmentid.split(",")).map(Integer::parseInt).collect(Collectors.toList());
}
public List<Long> getJobId() {
if (StringUtils.isBlank(jobId)) {
return new ArrayList<>();
}
return Arrays.stream(jobId.split(",")).map(Long::parseLong).collect(Collectors.toList());
}
public List<Long> getResourceId() {
if (StringUtils.isBlank(resourceId)) {
return new ArrayList<>();
}
return Arrays.stream(resourceId.split(",")).map(Long::parseLong).collect(Collectors.toList());
}
}

@ -27,13 +27,13 @@ public class StaffSearchParam {
/**
*
*/
private Long compId;
private Long ecCompany;
private Integer compId;
private Integer ecCompany;
/**
*
*/
private Long deptId;
private Long ecDepartment;
private Integer deptId;
private Integer ecDepartment;
/**
*
*/

@ -29,13 +29,13 @@ public class StaffPO {
/**
*
*/
private Long compId;
private Long ecCompany;
private Integer compId;
private Integer ecCompany;
/**
*
*/
private Long deptId;
private Long ecDepartment;
private Integer deptId;
private Integer ecDepartment;
/**
*
*/

@ -0,0 +1,18 @@
package com.engine.organization.entity.version;
import lombok.Data;
@Data
public class HrmDepartmentDto {
int id;
String departmentmark;
String departmentcode;
String departmentname;
String subcompanyid1;
String supdepid;
String bmfzr;
String showorder;
String canceled;
}

@ -0,0 +1,28 @@
package com.engine.organization.entity.version;
import lombok.Data;
import java.util.Date;
@Data
public class HrmDepartmentVersion {
int id;
Integer departmentId;
String departmentMark;
String departmentCode;
String departmentName;
Integer subCompanyId1;
Integer supDepId;
String bmfzr;
Integer showOrder;
Integer canceled;
String description;
String operator;
Double version;
Date operateTime;
String subcompanyname;
String supDepName;
String bmfzrName;
}

@ -0,0 +1,25 @@
package com.engine.organization.entity.version;
import lombok.Data;
@Data
public class HrmResourceDto {
private Integer id;
private Integer departmentid;
private String dsporder;
private Integer subcompanyid1;
private Integer jobtitle;
private String mobile;
private String telephone;
private String managerid;
private String lastname;
}

@ -0,0 +1,166 @@
package com.engine.organization.entity.version;
import lombok.Data;
import java.util.Date;
@Data
public class HrmResourceVersion {
private Integer id;
private Integer resourceid;
private Date companystartdate;
private Integer companyworkyear;
private Date workstartdate;
private Integer workyear;
private Integer usekind;
private Integer jobcall;
private String accumfundaccount;
private String birthplace;
private String folk;
private String residentphone;
private String residentpostcode;
private String extphone;
private String managerstr;
private Integer status;
private String fax;
private String islabouunion;
private Integer weight;
private String tempresidentnumber;
private Date probationenddate;
private Integer countryid;
private Date passwdchgdate;
private String lloginid;
private Integer dsporder;
private Integer passwordstate;
private Integer accounttype;
private Integer belongto;
private String messagerurl;
private String accountname;
private String loginid;
private String password;
private String lastname;
private String sex;
private String birthday;
private Integer nationality;
private String maritalstatus;
private String telephone;
private String mobile;
private String mobilecall;
private String email;
private Integer locationid;
private String workroom;
private String homeaddress;
private String resourcetype;
private Date startdate;
private Date enddate;
private Integer jobtitle;
private String jobactivitydesc;
private Integer joblevel;
private Integer seclevel;
private Integer departmentid;
private Integer subcompanyid1;
private Integer costcenterid;
private Integer managerid;
private Integer assistantid;
private Integer bankid1;
private String accountid1;
private Integer resourceimageid;
private String certificatenum;
private String nativeplace;
private Integer educationlevel;
private Date bememberdate;
private Date bepartydate;
private String workcode;
private String regresidentplace;
private String healthinfo;
private String residentplace;
private String policy;
private String degree;
private String height;
private String classification;
private String description;
private String operator;
private Double version;
private Date operateTime;
String departmentname;
String subcompanyname;
String jobtitlename;
}

@ -0,0 +1,15 @@
package com.engine.organization.entity.version;
import lombok.Data;
@Data
public class HrmSubCompanyDto {
int id;
String subcompanydesc;
String subcompanycode;
String subcompanyname;
String supsubcomid;
String showorder;
String canceled;
}

@ -0,0 +1,24 @@
package com.engine.organization.entity.version;
import lombok.Data;
import java.util.Date;
@Data
public class HrmSubCompanyVersion {
Integer id;
Integer subComId;
String subCompanyDesc;
String subCompanyCode;
String subCompanyName;
Integer supSubComId;
Integer showOrder;
Integer canceled;
String description;
String operator;
Double version;
Date operateTime;
String supSubComName;
}

@ -0,0 +1,15 @@
package com.engine.organization.entity.version;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class VersionData {
private String fieldId;
private String fieldValue;
}

@ -0,0 +1,20 @@
package com.engine.organization.enums;
/**
* @author:dxfeng
* @createTime: 2022/12/06
* @version: 1.0
*/
public enum HrmGroupEnum {
HRM_BASIC(-1), HRM_PERSONAL(1), HRM_WORK(3), COMPANY(4), DEPARTMENT(5);
HrmGroupEnum(Integer groupType) {
this.groupType = groupType;
}
private Integer groupType;
public Integer getGroupType() {
return groupType;
}
}

@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @description:
@ -19,7 +18,9 @@ public interface CompMapper {
*
* @return
*/
List<CompPO> list(@Param("orderSql") String orderSql);
List<CompPO> listAll(@Param("orderSql") String orderSql);
List<CompPO> listByFilter(@Param("CompanyPO") CompPO CompanyPO, @Param("orderSql") String orderSql);
/**
* ID
@ -30,48 +31,13 @@ public interface CompMapper {
List<String> listUsedIds();
List<String> hasSubs();
List<String> hasDetachSubs(@Param("companyIds") Collection<Long> companyIds);
/**
*
*
* @return
*/
List<CompPO> listByFilter(@Param("compPO") CompPO compPO, @Param("orderSql") String orderSql);
/**
*
*
* @return
*/
List<CompPO> listParent();
/**
*
*
* @param ids
* @return
*/
List<CompPO> listChild(@Param("ids") Collection ids);
/**
* ID
*
* @param pid
* @return
*/
List<CompPO> listChildByPID(@Param("pid") String pid);
/**
* ID
*
* @param pid
* @return
*/
int countChildByPID(@Param("pid") long pid);
List<CompPO> listChild(@Param("ids") Collection<Integer> ids);
/**
* ID
@ -79,33 +45,7 @@ public interface CompMapper {
* @param id
* @return
*/
CompPO listById(@Param("id") Long id);
/**
* UUID
*
* @param uuid
* @return
*/
CompPO getCompanyByUUID(@Param("uuid") String uuid);
/**
* No
*
* @param compNo
* @return
*/
List<CompPO> listByNo(@Param("compNo") String compNo);
/**
*
*
* @param ids
* @return
*/
List<Map<String, Object>> listCompsByIds(@Param("ids") Collection<Long> ids);
CompPO listById(@Param("id") Integer id);
/**
* ID
@ -115,38 +55,25 @@ public interface CompMapper {
*/
List<CompPO> getCompsByIds(@Param("ids") Collection<Long> ids);
/**
* /
*
*
* @param compPO
* @return
*/
int insertIgnoreNull(CompPO compPO);
List<CompPO> listParent();
List<String> hasSubs();
/**
*
*
* @param compPO
* @return
*/
int updateBaseComp(CompPO compPO);
List<String> hasDetachSubs(@Param("companyIds") Collection<Long> companyIds);
/**
*
* ID
*
* @param compPO
* @param subCompanyName
* @param supSubComId
* @return
*/
int updateForbiddenTagById(CompPO compPO);
/**
*
*
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
Integer getIdByNameAndPid(@Param("subCompanyName") String subCompanyName, @Param("supSubComId") Integer supSubComId);
/**
*
@ -155,27 +82,5 @@ public interface CompMapper {
*/
Integer getMaxShowOrder();
/**
* ID
*
* @param companyName
* @param parentCompany
* @return
*/
Long getIdByNameAndPid(@Param("companyName") String companyName, @Param("parentCompany") Long parentCompany);
/**
*
*
* @param parentCompany
* @return
*/
Integer countTopCompany(@Param("parentCompany") Long parentCompany);
int checkRepeatNo(@Param("companyNo") String companyNo, @Param("id") Long id);
CompPO getCompanyByNo(@Param("companyNo") String companyNo);
List<Long> getCompanyIdsByUuid(@Param("uuids") List<String> uuids);
Integer getIdBySubCompanyCode(@Param("subCompanyCode") String subCompanyCode);
}

@ -3,23 +3,18 @@
<mapper namespace="com.engine.organization.mapper.comp.CompMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.company.po.CompPO">
<result column="id" property="id"/>
<result column="comp_no" property="compNo"/>
<result column="comp_name" property="compName"/>
<result column="comp_name_short" property="compNameShort"/>
<result column="parent_company" property="parentCompany"/>
<result column="ec_company" property="ecCompany"/>
<result column="org_code" property="orgCode"/>
<result column="industry" property="industry"/>
<result column="comp_principal" property="compPrincipal"/>
<result column="description" property="description"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="show_order" property="showOrder"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="subCompanyName" property="subCompanyName"/>
<result column="subCompanyDesc" property="subCompanyDesc"/>
<result column="companyId" property="companyId"/>
<result column="supSubComId" property="supSubComId"/>
<result column="url" property="url"/>
<result column="canceled" property="canceled"/>
<result column="subCompanyCode" property="subCompanyCode"/>
<result column="outKey" property="outKey"/>
<result column="limitUsers" property="limitUsers"/>
<result column="uuid" property="uuid"/>
<result column="showOrder" property="showOrder"/>
<result column="showOrderOfTree" property="showOrderOfTree"/>
</resultMap>
<!-- 表字段 -->
@ -27,524 +22,229 @@
t
.
id
, t.comp_no
, t.comp_name
, t.comp_name_short
, t.parent_company
, t.ec_company
, t.org_code
, t.industry
, t.comp_principal
, t.description
, t.forbidden_tag
, t.show_order
, t.creator
, t.delete_type
, t.create_time
, t.update_time
, t.subCompanyName
, t.subCompanyDesc
, t.companyId
, t.supSubComId
, t.url
, t.canceled
, t.subCompanyCode
, t.outKey
, t.limitUsers
, t.uuid
, t.showOrder
, t.showOrderOfTree
</sql>
<sql id="nullSql">
and ifnull(parent_company,'0')='0'
</sql>
<sql id="nullSql" databaseId="sqlserver">
and isnull(parent_company,'0')='0'
</sql>
<sql id="nullSql" databaseId="oracle">
and NVL(parent_company,'0')='0'
</sql>
<sql id="nullParentCompany">
and ifnull(parent_company,0) =
#{parentCompany}
</sql>
<sql id="nullParentCompany" databaseId="sqlserver">
and isnull(parent_company,0) =
#{parentCompany}
</sql>
<sql id="nullParentCompany" databaseId="oracle">
and NVL(parent_company,0) =
#{parentCompany}
</sql>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.company.po.CompPO" keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_comp
<trim prefix="(" suffix=")" suffixOverrides=",">
<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>
<if test="compNo != null ">
comp_no,
</if>
<if test="compName != null ">
comp_name,
</if>
<if test="compNameShort != null ">
comp_name_short,
</if>
<if test="parentCompany != null ">
parent_company,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null ">
org_code,
</if>
<if test="industry != null ">
industry,
</if>
<if test="compPrincipal != null ">
comp_principal,
</if>
<if test="description != null ">
description,
</if>
forbidden_tag,
<if test="showOrder != null ">
show_order,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="compNo != null ">
#{compNo},
</if>
<if test="compName != null ">
#{compName},
</if>
<if test="compNameShort != null ">
#{compNameShort},
</if>
<if test="parentCompany != null ">
#{parentCompany},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="orgCode != null ">
#{orgCode},
</if>
<if test="industry != null ">
#{industry},
</if>
<if test="compPrincipal != null ">
#{compPrincipal},
</if>
<if test="description != null ">
#{description},
</if>
0,
<if test="showOrder != null ">
#{showOrder},
</if>
</trim>
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.company.po.CompPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_COMP_ID.currval from dual
</selectKey>
INSERT INTO jcl_org_comp
<trim prefix="(" suffix=")" suffixOverrides=",">
<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>
<if test="compNo != null ">
comp_no,
</if>
<if test="compName != null ">
comp_name,
</if>
<if test="compNameShort != null ">
comp_name_short,
</if>
<if test="parentCompany != null ">
parent_company,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null ">
org_code,
</if>
<if test="industry != null ">
industry,
</if>
<if test="compPrincipal != null ">
comp_principal,
</if>
<if test="description != null ">
description,
</if>
forbidden_tag,
<if test="showOrder != null ">
show_order,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="compNo != null ">
#{compNo},
</if>
<if test="compName != null ">
#{compName},
</if>
<if test="compNameShort != null ">
#{compNameShort},
</if>
<if test="parentCompany != null ">
#{parentCompany},
</if>
<if test="ec_company != null ">
#{ecCompany},
</if>
<if test="orgCode != null ">
#{orgCode},
</if>
<if test="industry != null ">
#{industry},
</if>
<if test="compPrincipal != null ">
#{compPrincipal},
</if>
<if test="description != null ">
#{description},
</if>
0,
<if test="showOrder != null ">
#{showOrder},
</if>
</trim>
</insert>
<select id="list" resultMap="BaseResultMap">
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0 order by ${orderSql}
</select>
<select id="listParent" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
<include refid="nullSql"/>
</select>
<select id="listChild" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
AND parent_company IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="listById" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
and id = #{id}
hrmsubcompany t
order by ${orderSql}
</select>
<select id="listByNo" parameterType="com.engine.organization.entity.company.po.CompPO" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_comp t where comp_no = #{compNo} AND delete_type = 0
</select>
<select id="listByFilter" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
hrmsubcompany t
WHERE 1=1
<include refid="likeSQL"/>
<if test=" compPO.parentCompany != null ">
and t.parent_company = #{compPO.parentCompany}
</if>
<if test=" compPO.ecCompany != null ">
and t.ec_company = #{compPO.ecCompany}
</if>
<if test=" compPO.industry != null ">
and t.industry = #{compPO.industry}
<if test=" CompanyPO.supSubComId != null ">
and t.supSubComId = #{CompanyPO.supSubComId}
</if>
<if test=" compPO.compPrincipal != null ">
and t.comp_principal = #{compPO.compPrincipal}
</if>
<if test=" compPO.forbiddenTag != null ">
and t.forbidden_tag = #{compPO.forbiddenTag}
<if test=" CompanyPO.canceled != null ">
<include refid="isCanceled"/>
</if>
order by ${orderSql}
</select>
<select id="listCompsByIds" resultType="java.util.Map">
select
id as "id",
comp_name as "name"
from jcl_org_comp t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="listChildByPID" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
and parent_company = #{pid}
</select>
<select id="countChildByPID" resultType="java.lang.Integer">
SELECT count(1)
FROM jcl_org_comp t
WHERE t.delete_type = 0
and parent_company = #{pid}
</select>
<select id="getCompsByIds" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_comp t
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="listUsedId" resultType="java.lang.String">
select parent_comp
from JCL_ORG_DEPT
where delete_type = 0
select SUBCOMPANYID1
from hrmdepartment
union
select parent_comp
select ec_company
from JCL_ORG_JOB
where delete_type = 0
union
select comp_id
select ec_company
from JCL_ORG_STAFF
where delete_type = 0
</select>
<select id="getMaxShowOrder" resultType="java.lang.Integer">
select max(show_order)
from jcl_org_comp
</select>
<select id="getIdByNameAndPid" resultType="java.lang.Long">
select id
from jcl_org_comp
where delete_type = 0 and comp_name = #{companyName}
<include refid="nullParentCompany"/>
</select>
<select id="countTopCompany" resultType="java.lang.Integer">
select COUNT(id) from jcl_org_comp where 1=1
<include refid="nullParentCompany"/>
</select>
<select id="listUsedIds" resultType="java.lang.String">
select company_id
select ec_company
from JCL_ORG_STAFFPLAN
where delete_type = 0
union
select jcl_rolelevel
select ec_rolelevel
from jcl_org_detach
where delete_type = 0
</select>
<select id="getCompanyByUUID" resultMap="BaseResultMap">
<select id="listChild" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_org_comp t
WHERE t.delete_type = 0
and uuid = #{uuid}
hrmsubcompany t
WHERE supsubcomid IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="checkRepeatNo" resultType="java.lang.Integer">
select count(1)
from jcl_org_comp t
where t.delete_type = 0
AND comp_no = #{companyNo}
<if test=" id != null ">
and t.id != #{id}
</if>
<select id="listById" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
hrmsubcompany t
WHERE id = #{id}
</select>
<select id="getCompanyByNo" resultMap="BaseResultMap">
<select id="getCompsByIds" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from from jcl_org_comp t
where t.delete_type = 0
AND comp_no = #{companyNo}
from hrmsubcompany t
WHERE id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="listParent" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
hrmsubcompany t
WHERE t.SUPSUBCOMID = 0
</select>
<select id="hasSubs" resultType="java.lang.String">
select parent_company
from jcl_org_comp
where forbidden_tag = 0
and delete_type = 0
select supsubcomid
from hrmsubcompany
where 1=1
<include refid="subsWhere"/>
union
select parent_comp
from jcl_org_dept
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 subcompanyid1
from hrmdepartment
where 1=1
<include refid="subsWhere"/>
</select>
<select id="hasDetachSubs" resultType="java.lang.String">
select parent_company
from jcl_org_comp
where forbidden_tag = 0
and delete_type = 0
select supsubcomid
from hrmsubcompany
where 1=1
<include refid="subsWhere"/>
and id in
<foreach collection="companyIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
union
select parent_comp
from jcl_org_dept
where forbidden_tag = 0
and delete_type = 0
and parent_comp in
select subcompanyid1
from hrmdepartment
where 1=1
<include refid="subsWhere"/>
and subcompanyid1 in
<foreach collection="companyIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.sequence.po.SequencePO">
update jcl_org_comp
<set>
forbidden_tag=#{forbiddenTag},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<select id="getIdByNameAndPid" resultType="java.lang.Integer">
select id
from hrmsubcompany
where subcompanyname = #{subCompanyName}
and supsubcomid = #{supSubComId}
</select>
<update id="deleteByIds">
UPDATE jcl_org_comp
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<select id="getMaxShowOrder" resultType="java.lang.Integer">
select max(showorder)
from hrmsubcompany
</select>
<select id="getIdBySubCompanyCode" resultType="java.lang.Integer">
select id
from hrmsubcompany
where subcompanycode = #{subCompanyCode}
</select>
<update id="updateBaseComp" parameterType="com.engine.organization.entity.company.po.CompPO">
update jcl_org_comp
<set>
creator=#{creator},
update_time=#{updateTime},
comp_name=#{compName},
comp_name_short=#{compNameShort},
parent_company=#{parentCompany},
ec_company=#{ecCompany},
org_code=#{orgCode},
industry=#{industry},
comp_principal=#{compPrincipal},
description=#{description},
show_order=#{showOrder},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<sql id="likeSQL">
<if test=" compPO.compNo != null and compPO.compNo != '' ">
and t.comp_no like CONCAT('%',#{compPO.compNo},'%')
</if>
<if test=" compPO.compName != null and compPO.compName != '' ">
and t.comp_name like CONCAT('%',#{compPO.compName},'%')
<if test=" CompanyPO.subCompanyCode != null and CompanyPO.subCompanyCode != '' ">
and t.subCompanyCode like CONCAT('%',#{CompanyPO.subCompanyCode},'%')
</if>
<if test=" compPO.compNameShort != null and compPO.compNameShort != '' ">
and t.comp_name_short like CONCAT('%',#{compPO.compNameShort},'%')
<if test=" CompanyPO.subCompanyDesc != null and CompanyPO.subCompanyDesc != '' ">
and t.subCompanyDesc like CONCAT('%',#{CompanyPO.subCompanyDesc},'%')
</if>
<if test=" compPO.orgCode != null and compPO.orgCode != '' ">
and t.org_code like CONCAT('%',#{compPO.orgCode},'%')
<if test=" CompanyPO.subCompanyName != null and CompanyPO.subCompanyName != '' ">
and t.subCompanyName like CONCAT('%',#{CompanyPO.subCompanyName},'%')
</if>
</sql>
<sql id="likeSQL" databaseId="oracle">
<if test=" compPO.compNo != null and compPO.compNo != '' ">
and t.comp_no like '%'||#{compPO.compNo}||'%'
<if test=" CompanyPO.subCompanyCode != null and CompanyPO.subCompanyCode != '' ">
and t.subCompanyCode like '%'||#{CompanyPO.subCompanyCode}||'%'
</if>
<if test=" compPO.compName != null and compPO.compName != '' ">
and t.comp_name like '%'||#{compPO.compName}||'%'
<if test=" CompanyPO.subCompanyDesc != null and CompanyPO.subCompanyDesc != '' ">
and t.subCompanyDesc like '%'||#{CompanyPO.subCompanyDesc}||'%'
</if>
<if test=" compPO.compNameShort != null and compPO.compNameShort != '' ">
and t.comp_name_short like '%'||#{compPO.compNameShort}||'%'
<if test=" CompanyPO.subCompanyName != null and CompanyPO.subCompanyName != '' ">
and t.subCompanyName like '%'||#{CompanyPO.subCompanyName}||'%'
</if>
<if test=" compPO.orgCode != null and compPO.orgCode != '' ">
and t.org_code like '%'||#{compPO.orgCode}||'%'
</sql>
<sql id="likeSQL" databaseId="postgresql">
<if test=" CompanyPO.subCompanyCode != null and CompanyPO.subCompanyCode != '' ">
and t.subCompanyCode like '%'||#{CompanyPO.subCompanyCode}||'%'
</if>
<if test=" CompanyPO.subCompanyDesc != null and CompanyPO.subCompanyDesc != '' ">
and t.subCompanyDesc like '%'||#{CompanyPO.subCompanyDesc}||'%'
</if>
<if test=" CompanyPO.subCompanyName != null and CompanyPO.subCompanyName != '' ">
and t.subCompanyName like '%'||#{CompanyPO.subCompanyName}||'%'
</if>
</sql>
<sql id="likeSQL" databaseId="sqlserver">
<if test=" compPO.compNo != null and compPO.compNo != '' ">
and t.comp_no like '%'+#{compPO.compNo}+'%'
</if>
<if test=" compPO.compName != null and compPO.compName != '' ">
and t.comp_name like '%'+#{compPO.compName}+'%'
<if test=" CompanyPO.subCompanyCode != null and CompanyPO.subCompanyCode != '' ">
and t.subCompanyCode like '%'+#{CompanyPO.subCompanyCode}+'%'
</if>
<if test=" compPO.compNameShort != null and compPO.compNameShort != '' ">
and t.comp_name_short like '%'+#{compPO.compNameShort}+'%'
<if test=" CompanyPO.subCompanyDesc != null and CompanyPO.subCompanyDesc != '' ">
and t.subCompanyDesc like '%'+#{CompanyPO.subCompanyDesc}+'%'
</if>
<if test=" compPO.orgCode != null and compPO.orgCode != '' ">
and t.org_code like '%'+#{compPO.orgCode}+'%'
<if test=" CompanyPO.subCompanyName != null and CompanyPO.subCompanyName != '' ">
and t.subCompanyName like '%'+#{CompanyPO.subCompanyName}+'%'
</if>
</sql>
<sql id="subsWhere">
and ifnull(canceled,0)=0
</sql>
<sql id="subsWhere" databaseId="oracle">
and nvl(canceled,0)=0
</sql>
<sql id="subsWhere" databaseId="sqlserver">
and isnull(canceled,0)=0
</sql>
<sql id="subsWhere" databaseId="postgresql">
and COALESCE(canceled,'0')='0'
</sql>
<sql id="isCanceled">
and ifnull(canceled,0)=
#{CompanyPO.canceled}
</sql>
<sql id="isCanceled" databaseId="oracle">
and nvl(canceled,0)=
#{CompanyPO.canceled}
</sql>
<sql id="isCanceled" databaseId="sqlserver">
and isnull(canceled,0)=
#{CompanyPO.canceled}
</sql>
<sql id="isCanceled" databaseId="postgresql">
and COALESCE(canceled,'0')=
#{CompanyPO.canceled}
</sql>
</mapper>

@ -14,28 +14,22 @@ import java.util.Map;
* @Version V1.0
**/
public interface DepartmentMapper {
List<DepartmentPO> getDeptListByCompId(@Param("parentComp") Integer parentComp);
List<DepartmentPO> getDeptListByPId(@Param("PId") Long PId);
int countChildByPID(@Param("pid") Long pid);
List<DepartmentPO> getDeptListByPId(@Param("PId") Integer PId);
/**
*
*
* @return
*/
List<DepartmentPO> list(@Param("orderSql") String orderSql);
List<DepartmentPO> listAll(@Param("orderSql") String orderSql);
/**
* No
*
* @param deptNo
* @param departmentCode
* @return
*/
List<DepartmentPO> listByNo(@Param("deptNo") String deptNo);
List<DepartmentPO> listByNo(@Param("departmentCode") String departmentCode);
/**
*
@ -60,15 +54,7 @@ public interface DepartmentMapper {
* @param id
* @return
*/
DepartmentPO getDeptById(@Param("id") Long id);
/**
* UUID
*
* @param uuid
* @return
*/
DepartmentPO getDepartmentByUUID(@Param("uuid") String uuid);
DepartmentPO getDeptById(@Param("id") Integer id);
/**
* ID
@ -76,38 +62,7 @@ public interface DepartmentMapper {
* @param id
* @return
*/
String getDeptNameById(@Param("id") Long id);
/**
*
*
* @param departmentPO
* @return
*/
int insertIgnoreNull(DepartmentPO departmentPO);
/**
*
*
* @param departmentPO
* @return
*/
int updateBaseDept(DepartmentPO departmentPO);
/**
*
*
* @param departmentPO
* @return
*/
int updateForbiddenTagById(DepartmentPO departmentPO);
/**
*
*
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
String getDeptNameById(@Param("id") Integer id);
/**
* ID
@ -121,21 +76,26 @@ public interface DepartmentMapper {
*
* @return
*/
Integer getMaxShowOrder();
Double getMaxShowOrder();
/**
*
*
* @param departmentName
* @param parentCompany
* @param parentDepartment
* @param subCompanyId1
* @param supDepId
* @return
*/
Long getIdByNameAndPid(@Param("departmentName") String departmentName, @Param("parentCompany") Long parentCompany, @Param("parentDepartment") Long parentDepartment);
Integer getIdByNameAndPid(@Param("departmentName") String departmentName, @Param("subCompanyId1") Integer subCompanyId1, @Param("supDepId") Integer supDepId);
int checkRepeatNo(@Param("departmentNo") String departmentNo, @Param("id") Long id);
int checkRepeatNo(@Param("departmentCode") String departmentCode, @Param("id") Long id);
List<String> hasSubs();
int countUsedInJob(@Param("departmentId") Long departmentId);
int countUsedInJob(@Param("supDepId") Long supDepId);
String getIdByDepartmentCode(@Param("departmentCode") String departmentCode);
String getDepartmentPrincipal(@Param("deptId") Integer deptId);
}

@ -3,22 +3,15 @@
<mapper namespace="com.engine.organization.mapper.department.DepartmentMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.department.po.DepartmentPO">
<result column="id" property="id"/>
<result column="dept_no" property="deptNo"/>
<result column="dept_name" property="deptName"/>
<result column="dept_name_short" property="deptNameShort"/>
<result column="parent_comp" property="parentComp"/>
<result column="ec_company" property="ecCompany"/>
<result column="parent_dept" property="parentDept"/>
<result column="ec_department" property="ecDepartment"/>
<result column="dept_principal" property="deptPrincipal"/>
<result column="show_order" property="showOrder"/>
<result column="description" property="description"/>
<result column="forbidden_tag" property="forbiddenTag"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="departmentMark" property="departmentMark"/>
<result column="departmentName" property="departmentName"/>
<result column="subCompanyId1" property="subCompanyId1"/>
<result column="supDepId" property="supDepId"/>
<result column="allSupDepId" property="allSupDepId"/>
<result column="canceled" property="canceled"/>
<result column="departmentCode" property="departmentCode"/>
<result column="coadjutant" property="coadjutant"/>
<result column="showOrder" property="showOrder"/>
<result column="uuid" property="uuid"/>
</resultMap>
@ -28,39 +21,28 @@
.
id
,
t.dept_no,
t.dept_name,
t.dept_name_short,
t.parent_comp,
t.ec_company,
t.parent_dept,
t.ec_department,
t.dept_principal,
t.show_order,
t.description,
t.forbidden_tag,
t.departmentMark,
t.departmentName,
t.subCompanyId1,
t.supDepId,
t.allSupDepId,
t.canceled,
t.departmentCode,
t.coadjutant,
t.showOrder,
t.uuid
</sql>
<select id="getDeptListByCompId" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
and parent_comp = #{parentComp}
</select>
<select id="getDeptListByPId" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
and parent_dept = #{PId}
from hrmdepartment t
where supDepId = #{PId}
</select>
<select id="getDeptNameById" resultType="string">
select t.dept_name
from jcl_org_dept t
select t.departmentName
from hrmdepartment t
where id = #{id}
</select>
@ -68,437 +50,168 @@
resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
from hrmdepartment t
where 1=1
<include refid="likeSQL"/>
<if test=" departmentPO.ecCompany != null ">
and t.ec_company = #{departmentPO.ecCompany}
</if>
<if test=" departmentPO.ecDepartment != null ">
and t.ec_department = #{departmentPO.ecDepartment}
</if>
<if test=" departmentPO.parentComp != null ">
and t.parent_comp = #{departmentPO.parentComp}
</if>
<if test=" departmentPO.parentDept != null ">
and t.parent_dept = #{departmentPO.parentDept}
<if test=" departmentPO.subCompanyId1 != null ">
and t.subCompanyId1 = #{departmentPO.subCompanyId1}
</if>
<if test=" departmentPO.deptPrincipal != null ">
and t.dept_principal = #{departmentPO.deptPrincipal}
<if test=" departmentPO.supDepId != null ">
and t.supDepId = #{departmentPO.supDepId}
</if>
<if test=" departmentPO.showOrder != null ">
and t.show_order = #{departmentPO.showOrder}
</if>
<if test=" departmentPO.forbiddenTag != null ">
and t.forbidden_tag = #{departmentPO.forbiddenTag}
<if test=" departmentPO.departmentId != null ">
and t.id = #{departmentPO.departmentId}
</if>
<include refid="isCanceled"/>
order by ${orderSql}
</select>
<select id="getDeptById" resultType="com.engine.organization.entity.department.po.DepartmentPO">
<select id="getDeptById" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
and id = #{id}
from hrmdepartment t
where id = #{id}
</select>
<select id="listDeptsByIds" resultType="java.util.Map">
select
id as "id",
dept_name as "name"
from jcl_org_dept t
WHERE delete_type = 0
AND id IN
departmentName as "name"
from hrmdepartment t
WHERE id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="list" resultType="com.engine.organization.entity.department.po.DepartmentPO">
<select id="listAll" resultType="com.engine.organization.entity.department.po.DepartmentPO">
SELECT
<include refid="baseColumns"/>
FROM jcl_org_dept t
WHERE t.delete_type = 0 order by ${orderSql}
FROM hrmdepartment t order by ${orderSql}
</select>
<select id="listByNo" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select
<include refid="baseColumns"/>
from jcl_org_dept t where dept_no = #{deptNo} AND delete_type = 0
</select>
<select id="countChildByPID" resultType="java.lang.Integer">
select count(1)
from jcl_org_dept t
where delete_type = 0
and parent_dept = #{pid}
from hrmdepartment t where departmentCode = #{departmentCode}
</select>
<select id="listUsedId" resultType="java.lang.String">
select parent_dept
select ec_department
from JCL_ORG_JOB
where delete_type = 0
union
select dept_id
from JCL_ORG_STAFF
where delete_type = 0
union
select departmentid
from hrmresource
</select>
<select id="getDeptsByIds" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
AND id IN
from hrmdepartment t
where id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="getMaxShowOrder" resultType="java.lang.Integer">
select max(show_order)
from jcl_org_dept
<select id="getMaxShowOrder" resultType="java.lang.Double">
select max(showOrder)
from hrmdepartment
</select>
<select id="getIdByNameAndPid" resultType="java.lang.Long">
<select id="getIdByNameAndPid" resultType="java.lang.Integer">
select id
from jcl_org_dept
where delete_type = 0 and dept_name = #{departmentName}
and parent_comp = #{parentCompany}
<include refid="nullParentDepartment"/>
</select>
<select id="getDepartmentByUUID" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
and uuid = #{uuid}
from hrmdepartment
where departmentName = #{departmentName}
and subCompanyId1 = #{subCompanyId1}
and supDepId = #{supDepId}
</select>
<select id="checkRepeatNo" resultType="java.lang.Integer">
select count(1)
from jcl_org_dept t
where t.delete_type = 0
AND dept_no = #{departmentNo}
from hrmdepartment t
where departmentCode = #{departmentCode}
<if test=" id != null ">
and t.id != #{id}
</if>
</select>
<select id="hasSubs" resultType="java.lang.String">
select distinct parent_dept
from jcl_org_dept
where forbidden_tag = 0
and delete_type = 0
select distinct supDepId
from hrmdepartment
where 1=1
<include refid="com.engine.organization.mapper.comp.CompMapper.subsWhere"/>
</select>
<select id="countUsedInJob" resultType="java.lang.Integer">
select count(1)
from jcl_org_job
where forbidden_tag = 0
and delete_type = 0
and parent_dept = #{departmentId}
and parent_dept = #{supDepId}
</select>
<select id="getIdByDepartmentCode" resultType="java.lang.String">
select id
from hrmdepartment
where departmentcode = #{departmentCode}
</select>
<select id="getDepartmentPrincipal" resultType="java.lang.String">
select bmfzr
from hrmdepartmentdefined
where deptid = #{deptId}
</select>
<sql id="nullParentDepartment">
and ifnull(parent_dept,0) =
#{parentDepartment}
</sql>
<sql id="nullParentDepartment" databaseId="sqlserver">
and isnull(parent_dept,0) =
#{parentDepartment}
</sql>
<sql id="nullParentDepartment" databaseId="oracle">
and NVL(parent_dept,0) =
#{parentDepartment}
</sql>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.department.po.DepartmentPO"
keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO jcl_org_dept
<trim prefix="(" suffix=")" suffixOverrides=",">
<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>
<if test="deptNo != null ">
dept_no,
</if>
<if test="deptName != null ">
dept_name,
</if>
<if test="deptNameShort != null ">
dept_name_short,
</if>
<if test="parentComp != null ">
parent_comp,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="parentDept != null ">
parent_dept,
</if>
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="deptPrincipal != null ">
dept_principal,
</if>
<if test="showOrder != null ">
show_order,
</if>
<if test="description != null ">
description,
</if>
<if test="uuid != null ">
uuid,
</if>
forbidden_tag,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="deptNo != null ">
#{deptNo},
</if>
<if test="deptName != null ">
#{deptName},
</if>
<if test="deptNameShort != null ">
#{deptNameShort},
</if>
<if test="parentComp != null ">
#{parentComp},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="parentDept != null ">
#{parentDept},
</if>
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="deptPrincipal != null ">
#{deptPrincipal},
</if>
<if test="showOrder != null ">
#{showOrder},
</if>
<if test="description != null ">
#{description},
</if>
<if test="uuid != null ">
#{uuid},
</if>
0,
</trim>
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.department.po.DepartmentPO"
databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_DEPT_ID.currval from dual
</selectKey>
INSERT INTO jcl_org_dept
<trim prefix="(" suffix=")" suffixOverrides=",">
<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>
<if test="deptNo != null ">
dept_no,
</if>
<if test="deptName != null ">
dept_name,
</if>
<if test="deptNameShort != null ">
dept_name_short,
</if>
<if test="parentComp != null ">
parent_comp,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="parentDept != null ">
parent_dept,
</if>
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="deptPrincipal != null ">
dept_principal,
</if>
<if test="showOrder != null ">
show_order,
</if>
<if test="description != null ">
description,
</if>
<if test="uuid != null ">
uuid,
</if>
forbidden_tag,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="deptNo != null ">
#{deptNo},
</if>
<if test="deptName != null ">
#{deptName},
</if>
<if test="deptNameShort != null ">
#{deptNameShort},
</if>
<if test="parentComp != null ">
#{parentComp},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="parentDept != null ">
#{parentDept},
</if>
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="deptPrincipal != null ">
#{deptPrincipal},
</if>
<if test="showOrder != null ">
#{showOrder},
</if>
<if test="description != null ">
#{description},
</if>
<if test="uuid != null ">
#{uuid},
</if>
0,
</trim>
</insert>
<update id="updateBaseDept" parameterType="com.engine.organization.entity.department.po.DepartmentPO">
update jcl_org_dept
<set>
creator=#{creator},
update_time=#{updateTime},
dept_name=#{deptName},
dept_name_short=#{deptNameShort},
parent_comp=#{parentComp},
ec_company=#{ecCompany},
parent_dept=#{parentDept},
ec_department=#{ecDepartment},
dept_principal=#{deptPrincipal},
show_order=#{showOrder},
description=#{description},
<if test="forbiddenTag !=null">
forbidden_tag=#{forbiddenTag},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="updateForbiddenTagById" parameterType="com.engine.organization.entity.department.po.DepartmentPO">
update jcl_org_dept
<set>
forbidden_tag=#{forbiddenTag},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="deleteByIds">
UPDATE jcl_org_dept
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<sql id="likeSQL">
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' ">
and t.dept_no like CONCAT('%',#{departmentPO.deptNo},'%')
<if test=" departmentPO.departmentCode != null and departmentPO.departmentCode != '' ">
and t.departmentCode like CONCAT('%',#{departmentPO.departmentCode},'%')
</if>
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' ">
and t.dept_name like CONCAT('%',#{departmentPO.deptName},'%')
</if>
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' ">
and t.dept_name_short like CONCAT('%',#{departmentPO.deptNameShort},'%')
<if test=" departmentPO.departmentName != null and departmentPO.departmentName != '' ">
and t.departmentName like CONCAT('%',#{departmentPO.departmentName},'%')
</if>
</sql>
<sql id="likeSQL" databaseId="oracle">
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' ">
and t.dept_no like '%'||#{departmentPO.deptNo}||'%'
<if test=" departmentPO.departmentCode != null and departmentPO.departmentCode != '' ">
and t.departmentCode like '%'||#{departmentPO.departmentCode}||'%'
</if>
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' ">
and t.dept_name like '%'||#{departmentPO.deptName}||'%'
<if test=" departmentPO.departmentName != null and departmentPO.departmentName != '' ">
and t.departmentName like '%'||#{departmentPO.departmentName}||'%'
</if>
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' ">
and t.dept_name_short like '%'||#{departmentPO.deptNameShort}||'%'
</sql>
<sql id="likeSQL" databaseId="postgresql">
<if test=" departmentPO.departmentCode != null and departmentPO.departmentCode != '' ">
and t.departmentCode like '%'||#{departmentPO.departmentCode}||'%'
</if>
<if test=" departmentPO.departmentName != null and departmentPO.departmentName != '' ">
and t.departmentName like '%'||#{departmentPO.departmentName}||'%'
</if>
</sql>
<sql id="likeSQL" databaseId="sqlserver">
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' ">
and t.dept_no like '%'+#{departmentPO.deptNo}+'%'
</if>
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' ">
and t.dept_name like '%'+#{departmentPO.deptName}+'%'
<if test=" departmentPO.departmentCode != null and departmentPO.departmentCode != '' ">
and t.departmentCode like '%'+#{departmentPO.departmentCode}+'%'
</if>
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' ">
and t.dept_name_short like '%'+#{departmentPO.deptNameShort}+'%'
<if test=" departmentPO.departmentName != null and departmentPO.departmentName != '' ">
and t.departmentName like '%'+#{departmentPO.departmentName}+'%'
</if>
</sql>
<sql id="nullSql">
and ifnull(parent_dept,'0')='0'
<sql id="isCanceled">
<if test=" departmentPO.canceled != null ">
and ifnull(canceled,0)= #{departmentPO.canceled}
</if>
</sql>
<sql id="nullSql" databaseId="sqlserver">
and isnull(parent_dept,'0')='0'
<sql id="isCanceled" databaseId="oracle">
<if test=" departmentPO.canceled != null">
and nvl(canceled,0)= #{departmentPO.canceled}
</if>
</sql>
<sql id="nullSql" databaseId="oracle">
and NVL(parent_dept,'0')='0'
<sql id="isCanceled" databaseId="sqlserver">
<if test=" departmentPO.canceled != null">
and isnull(canceled,0)= #{departmentPO.canceled}
</if>
</sql>
<sql id="isCanceled" databaseId="postgresql">
<if test=" departmentPO.canceled != null">
and COALESCE(canceled,'0')= #{departmentPO.canceled}
</if>
</sql>
</mapper>

@ -15,9 +15,12 @@ import java.util.Map;
**/
public interface EmployeeMapper {
String getEmployeeNameById(@Param("employeeId") Long id);
List<String> getEmployeeNameById(@Param("ids") Collection<Long> ids);
List<Long> getResourceIds(@Param("lastName") String lastName);
List<Map<String,Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
List<Long> getResourceIdsByName(@Param("lastName") String lastName);
List<Map<String, Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
}

@ -12,6 +12,11 @@
AND t.lastname like '%'||#{lastName}||'%'
</if>
</sql>
<sql id="likeSql" databaseId="postgresql">
<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}+'%'
@ -21,7 +26,10 @@
<select id="getEmployeeNameById" resultType="string">
select t.lastname
from hrmresource t
where id = #{employeeId}
where id in
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
@ -43,5 +51,10 @@
#{id}
</foreach>
</select>
<select id="getResourceIdsByName" resultType="java.lang.Long">
select t.id
from hrmresource t
where t.lastname = #{lastName}
</select>
</mapper>

@ -37,5 +37,5 @@ public interface ExtDTMapper {
* @param mainId
* @return
*/
int deleteByMainID(@Param("tableName") String tableName, @Param("mainId") long mainId);
int deleteByMainID(@Param("tableName") String tableName, @Param("mainId") long mainId, @Param("groupId") Long groupId);
}

@ -19,6 +19,9 @@
delete
from ${tableName}
where mainid = #{mainId}
<if test=" null!=groupId ">
and group_id = #{groupId}
</if>
</delete>
<select id="listCompExtDT" resultType="map">

@ -37,7 +37,7 @@ public interface ExtendInfoMapper {
int updateExtendGroupId(@Param("groupId") Long groupId, @Param("ids") Collection<Long> ids);
ExtendInfoPO getInfoByExtendAndLabelName(@Param("extendType") Long extendType, @Param("labelName") String labelName);
List<ExtendInfoPO> getInfoByExtendAndLabelName(@Param("extendType") Long extendType, @Param("labelName") String labelName);
}

@ -1,51 +0,0 @@
package com.engine.organization.mapper.hrmresource;
import org.apache.ibatis.annotations.Param;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/05/20
* @version: 1.0
*/
public interface HrmResourceMapper {
/**
* ID
*
* @return
*/
Long getMaxId();
Long getMaxShowOrder();
/**
* ID
*
* @param id
* @return
*/
String getLastNameById(@Param("id") Long id);
/**
* ID
*
* @param keyField
* @param keyFieldValue
* @return
*/
Long getIdByKeyField(@Param("keyField") String keyField, @Param("keyFieldValue") String keyFieldValue);
///**
// * 根据所选关键字段,查询关键列
// *
// * @param keyField
// * @return
// */
//List<JSONObject> getKeyMapByKetField(@Param("keyField") String keyField);
String getEcResourceId(@Param("jclResourceId") String jclResourceId);
Long getJclResourceId(@Param("ecResourceId") String ecResourceId);
}

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.hrmresource.HrmResourceMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.hrmresource.po.HrmResourcePO">
<result column="id" property="id"/>
<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.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getMaxId" resultType="java.lang.Long">
select max(id)
from jcl_org_hrmresource
</select>
<select id="getLastNameById" resultType="java.lang.String">
select last_name
from jcl_org_hrmresource
where delete_type = 0
and id = #{id}
</select>
<select id="getIdByKeyField" resultType="java.lang.Long">
select id
from jcl_org_hrmresource
where delete_type = 0
and ${keyField} = #{keyFieldValue}
</select>
<select id="getEcResourceId" resultType="java.lang.String">
select a.id
from hrmresource a
inner join jcl_org_hrmresource b on a.uuid = b.uuid
where b.id = #{jclResourceId}
</select>
<select id="getJclResourceId" resultType="java.lang.Long">
select a.id
from jcl_org_hrmresource a
inner join hrmresource b on a.uuid = b.uuid
where b.id = #{ecResourceId}
</select>
<select id="getMaxShowOrder" resultType="java.lang.Long">
select max(show_order)
from jcl_org_hrmresource
</select>
<!-- <select id="getKeyMapByKetField" resultType="com.alibaba.fastjson.JSONObject">-->
<!-- select id, account_type, certificate_num, login_id, work_code, ${keyField}-->
<!-- from jcl_org_hrmresource-->
<!-- </select>-->
</mapper>

@ -19,7 +19,7 @@ public interface SystemDataMapper {
String getScCompanyNameById(@Param("companyId") String companyId);
List<Map<String,Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
List<Map<String, Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
String getScDepartmentNameById(@Param("departmentId") String departmentId);
@ -31,7 +31,7 @@ public interface SystemDataMapper {
RecordInfo getHrmJobTitleByName(@Param("name") String name);
List<Long> getHrmResourceIds(@Param("departmentId") Long departmentId, @Param("jobTitle") String jobTitle);
List<Long> getHrmResourceIds(@Param("departmentId") Integer departmentId, @Param("jobTitle") String jobTitle);
List<Long> getHrmResourceIdsByDept(@Param("departmentId") String departmentId);
@ -59,6 +59,9 @@ public interface SystemDataMapper {
Long getHrmResourceMaxId();
List<String> getBatchUuidByIds(@Param("tableName") String tableName,@Param("ecIds") List<String> ecIds);
List<String> getBatchUuidByIds(@Param("tableName") String tableName, @Param("ecIds") List<String> ecIds);
List<CusFormFieldPO> getHrmFieldsByScopeId(@Param("scopeId") String scopeId);
List<Integer> getJobTitleIds(@Param("jobActivityId") String jobActivityId, @Param("jobGroupId") String jobGroupId);
}

@ -12,6 +12,8 @@
<result column="dmlurl" property="dmlUrl"/>
<result column="scopeid" property="scopeId"/>
<result column="tablename" property="tableName"/>
<!-- <result column="fielddbtype" property="fielddbtype"/>-->
<!-- <result column="fieldorder" property="fieldorder"/>-->
</resultMap>
<resultMap id="SelectItemMap" type="com.engine.organization.entity.jclimport.po.JclSelectItem">
@ -100,7 +102,7 @@
</select>
<select id="getHrmFieldBeanList" resultMap="CustomFieldMap">
select b.labelname as fieldlable,
'0' as scopeid,
'0' as scopeid,
a.fieldid,
a.fieldname,
a.ismand,
@ -165,6 +167,57 @@
#{ecId}
</foreach>
</select>
<select id="getHrmFieldsByScopeId" resultMap="CustomFieldMap">
SELECT *
FROM (SELECT t1.fieldid,
t2.fieldname,
t1.fieldlable,
t1.ismand,
t2.fielddbtype,
t2.fieldhtmltype,
t2.type,
t1.dmlurl,
fieldorder,
groupid,
#{scopeId} as scopeId,
'cus' as tablename
FROM cus_formfield t1,
cus_formdict t2
WHERE t1.fieldid = t2.id
AND t1.scope = 'HrmCustomFieldByInfoType'
AND t1.scopeid = #{scopeId}
UNION ALL
SELECT fieldid,
fieldname,
fieldlabel,
ismand,
fielddbtype,
fieldhtmltype,
TYPE,
dmlurl,
fieldorder,
groupid,
#{scopeId} as scopeId,
'hrm' as tablename
FROM hrm_formfield) hrmallfield
WHERE FIELDHTMLTYPE != '6' and groupid IN (SELECT id FROM hrm_fieldgroup WHERE grouptype = #{scopeId})
ORDER BY hrmallfield.groupid, hrmallfield.fieldorder
</select>
<select id="getJobTitleIds" resultType="java.lang.Integer">
SELECT h.ID
FROM HRMJOBTITLES h
INNER JOIN HRMJOBACTIVITIES h1 ON
h.JOBACTIVITYID = h1.ID
INNER JOIN HRMJOBGROUPS h2 ON
h1.JOBGROUPID = h2.ID
WHERE 1 = 1
<if test="jobActivityId !=null and jobActivityId != ''">
AND h1.ID =#{jobActivityId}
</if>
<if test="jobGroupId !=null and jobGroupId != ''">
AND h2.ID =#{jobGroupId}
</if>
</select>
</mapper>

@ -0,0 +1,20 @@
package com.engine.organization.mapper.jclimport;
import com.engine.organization.entity.jclimport.po.HrmFormFieldPO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2022/12/06
* @version: 1.0
*/
public interface ImportMapper {
List<HrmFormFieldPO> getImportFields(@Param("languageId") Integer languageId, @Param("groupType") Integer groupType);
List<HrmFormFieldPO> getImportFieldInfo(@Param("languageId") Integer languageId, @Param("groupType") Integer groupType, @Param("labelName") String labelName);
List<String> getResourceExceptedFields();
}

@ -0,0 +1,47 @@
<?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.jclimport.ImportMapper">
<select id="getImportFields" resultType="com.engine.organization.entity.jclimport.po.HrmFormFieldPO">
select a.fieldid, a.fieldname, b.labelname, a.issystem, a.ismand
from hrm_formfield a
inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = #{languageId}
inner join hrm_fieldgroup c on a.groupid = c.id
where a.fieldhtmltype != '6' and c.grouptype = #{groupType}
and a.isuse = 1
</select>
<select id="getImportFieldInfo" resultType="com.engine.organization.entity.jclimport.po.HrmFormFieldPO">
select a.fieldid,
a.fieldname,
b.labelname,
a.issystem,
a.ismand,
a.fielddbtype,
a.fieldhtmltype,
a.type,
a.dmlurl
from hrm_formfield a
inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = #{languageId}
inner join hrm_fieldgroup c on a.groupid = c.id
where a.fieldhtmltype != '6' and c.grouptype = #{groupType}
and b.labelname = #{labelName}
and a.isuse = 1
</select>
<select id="getResourceExceptedFields" resultType="java.lang.String">
select FIELDNAME
from cus_formdict
where id in (select fieldid
from cus_formfield
where scope = 'HrmCustomFieldByInfoType'
and scopeid = 3
and dmlUrl in ('sequenceBrowser', 'schemeBrowser', 'LevelBrowser', 'gradeBrowser')
union
select fieldid
from cus_formfield
where scope = 'HrmCustomFieldByInfoType'
and hrm_fieldlable = '职等职级'
and scopeid = 3
and dmlUrl = (select max(mainid) from mode_customtreedetail where tablename = 'v_jcl_zdzjs'))
</select>
</mapper>

@ -4,6 +4,7 @@ import com.engine.organization.entity.map.JclOrgMap;
import org.apache.ibatis.annotations.Param;
import java.sql.Date;
import java.util.List;
/**
* @author:dxfeng
@ -26,4 +27,25 @@ public interface JclOrgMapper {
JclOrgMap getSumPlanAndJobByFParentId(@Param("currentDate") Date currentDate, @Param("fparentid") String fparentid);
int updateMapById(@Param("id") Integer id,@Param("fplan") Integer fplan,@Param("fonjob") Integer fonjob,@Param("currentDate") Date currentDate);
List<JclOrgMap> getJclOrgMapByType(@Param("fType") String fType, @Param("currentDate") Date currentDate);
int deleteAllMap(@Param("currentDate") Date currentDate);
int updateAllMap(@Param("currentDate") Date currentDate, @Param("yesterday") Date yesterday);
int insertResToMap(@Param("level") String level, @Param("grade") String grade);
int insertJobToMap();
int insertDeptToMap(@Param("level") String level, @Param("grade") String grade);
int insertSubComToMap();
int insertComToMap();
int deleteJobNull(@Param("currentDate") Date currentDate);
JclOrgMap getResInfo(@Param("level") String level, @Param("grade") String grade, @Param("id") String id);
}

@ -59,11 +59,352 @@
<update id="updateMapById">
update jcl_org_map
<set>
fplan=#{fplan},
fonjob=#{fonjob},
<if test="fplan != null">
fplan=#{fplan},
</if>
<if test="fonjob != null">
fonjob=#{fonjob},
</if>
</set>
where id=#{id}
AND FDATEBEGIN &lt;= #{currentDate}
AND FDATEEND &gt;= #{currentDate}
</update>
<select id="getJclOrgMapByType" resultType="com.engine.organization.entity.map.JclOrgMap">
select * from jcl_org_map where ftype = #{fType} AND FDATEBEGIN &lt;= #{currentDate} AND FDATEEND &gt;= #{currentDate}
</select>
<!--删除当天所有数据-->
<delete id="deleteAllMap">
delete from jcl_org_map where fdatebegin = #{currentDate}
</delete>
<!--修改所有失效日期-->
<update id="updateAllMap">
update jcl_org_map
<set>
fdateend=#{yesterday},
</set>
where fdateend &gt; #{currentDate}
</update>
<!--初始化人员数据-->
<insert id="insertResToMap" databaseId="sqlserver">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fisvitual,fdatebegin,fdateend)
select a.id+300000000,4,a.id,a.uuid,0,'行政维度',a.workcode,a.LASTNAME,a.messagerurl,
c.id,c.jobtitlename,e.level_name,f.grade_name, isnull( b.id, '' ) +200000000,b.id,
0,convert(varchar(100),getDate(),23),'2099-12-31'
from hrmresource a
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
left join HrmJobTitles c on b.ec_jobTitle = c.id
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
left join jcl_org_level e on d.${level}=e.id
left join jcl_org_grade f on d.${grade}=f.id
where a.status &lt; 4
</insert>
<insert id="insertResToMap" databaseId="mysql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fisvitual,fdatebegin,fdateend)
select a.id+300000000,4,a.id,a.uuid,0,'行政维度',a.workcode,a.LASTNAME,a.messagerurl,
c.id,c.jobtitlename,e.level_name,f.grade_name, ifnull( b.id, '' ) +200000000,b.id,
0,NOW(),'2099-12-31'
from hrmresource a
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
left join HrmJobTitles c on b.ec_jobTitle = c.id
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
left join jcl_org_level e on d.${level}=e.id
left join jcl_org_grade f on d.${grade}=f.id
where a.status &lt; 4
</insert>
<insert id="insertResToMap" databaseId="postgresql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fisvitual,fdatebegin,fdateend)
select a.id+300000000,4,a.id,a.uuid,0,'行政维度',a.workcode,a.LASTNAME,a.messagerurl,
c.id,c.jobtitlename,e.level_name,f.grade_name, COALESCE( b.id, 0 ) +200000000,b.id,
0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'2099-12-31'
from hrmresource a
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
left join HrmJobTitles c on b.ec_jobTitle = c.id
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
left join jcl_org_level e on NULLIF(d.${level},'')=e.id
left join jcl_org_grade f on NULLIF(d.${grade},'')=f.id
where a.status &lt; 4
</insert>
<insert id="insertResToMap" parameterType="java.lang.String" databaseId="oracle">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleaderimg,
fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fisvitual,fdatebegin,fdateend)
select a.id+300000000,4,a.id,a.uuid,0,'行政维度',a.workcode,a.LASTNAME,a.messagerurl,
c.id,c.jobtitlename,e.level_name,f.grade_name, nvl( b.id, '' ) +200000000,b.id,
0,TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd'), TO_DATE('2099-12-31','yyyy-MM-dd')
from hrmresource a
left join jcl_org_job b ON a.JOBTITLE = b.ec_jobTitle and a.subcompanyid1=b.ec_company and a.departmentid=b.ec_department
left join HrmJobTitles c on b.ec_jobTitle = c.id
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
left join jcl_org_level e on ${level}=e.id
left join jcl_org_grade f on ${grade}=f.id
where a.status &lt; 4
</insert>
<!--初始化岗位-->
<insert id="insertJobToMap" databaseId="sqlserver">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,
fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+200000000,3,a.id,g.uuid,0,'行政维度',a.job_no,g.jobtitlename,
ec_department+100000000,
ec_department,
isnull(e.fcnt,0),isnull(f.fcnt,0),0,convert(varchar(100),getDate(),23),'2099-12-31'
from JCL_ORG_job as a
left join (select job_id,sum(isnull(staff_num,0)) fcnt from JCL_ORG_STAFF
where plan_id in (select id from JCL_ORG_STAFFPLAN
where time_start &lt;= convert(varchar(100),getDate(),23) and time_end &gt; convert(varchar(100),getDate(),23)) and delete_type=0
group by job_id) e on a.id=e.job_id
left join ( select c.id,count(1) fcnt from hrmresource a
left join Hrmjobtitles b on a.jobtitle=b.id and a.status&lt;4
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
group by c.id) f
on f.id=a.id
left join HrmJobTitles g on a.ec_jobTitle = g.id
where isnull(a.delete_type,0) &lt;&gt; 1 and isnull(a.forbidden_tag,0) &lt;&gt; 1
</insert>
<insert id="insertJobToMap" databaseId="mysql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,
fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+200000000,3,a.id,g.uuid,0,'行政维度',a.job_no,g.jobtitlename,
ec_department+100000000,
ec_department,
ifnull(e.fcnt,0),ifnull(f.fcnt,0),0,NOW(),'2099-12-31'
from JCL_ORG_job as a
left join (select job_id,sum(ifnull(staff_num,0)) fcnt from JCL_ORG_STAFF
where plan_id in (select id from JCL_ORG_STAFFPLAN
where time_start&lt;=NOW() and time_end &gt; NOW() and delete_type=0)
group by job_id) e on a.id=e.job_id
left join ( select c.id,count(1) fcnt from hrmresource a
left join Hrmjobtitles b on a.jobtitle=b.id and a.status&lt;4
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
group by c.id) f
on f.id=a.id
left join HrmJobTitles g on a.ec_jobTitle = g.id
where ifnull(a.delete_type,0) &lt;&gt; 1 and ifnull(a.forbidden_tag,0) &lt;&gt; 1
</insert>
<insert id="insertJobToMap" databaseId="postgresql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,
fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+200000000,3,a.id,g.uuid,0,'行政维度',a.job_no,g.jobtitlename,
ec_department+100000000,
ec_department,
COALESCE(e.fcnt,0),COALESCE(f.fcnt,0),0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'2099-12-31'
from JCL_ORG_job as a
left join (select job_id,sum(COALESCE(staff_num,0)) fcnt from JCL_ORG_STAFF
where plan_id in (select id from JCL_ORG_STAFFPLAN
where time_start&lt;=TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd') and time_end &gt; TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd') and delete_type=0)
group by job_id) e on a.id=e.job_id
left join ( select c.id,count(1) fcnt from hrmresource a
left join Hrmjobtitles b on a.jobtitle=b.id and a.status&lt;4
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
group by c.id) f
on f.id=a.id
left join HrmJobTitles g on a.ec_jobTitle = g.id
where COALESCE(a.delete_type,0) &lt;&gt; 1 and COALESCE(a.forbidden_tag,0) &lt;&gt; 1
</insert>
<insert id="insertJobToMap" databaseId="oracle">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,
fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+200000000,3,a.id,g.uuid,0,'行政维度',a.job_no,g.jobtitlename,
ec_department+100000000,
ec_department,
nvl(e.fcnt,0),nvl(f.fcnt,0),0,TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd'), TO_DATE('2099-12-31','yyyy-MM-dd')
from JCL_ORG_job a
left join (select job_id,sum(nvl(staff_num,0)) fcnt from JCL_ORG_STAFF
where plan_id in (select id from JCL_ORG_STAFFPLAN
where time_start&lt;=TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd') and time_end&gt;TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd')) and delete_type=0
group by job_id) e on a.id=e.job_id
left join ( select c.id,count(1) fcnt from hrmresource a
left join Hrmjobtitles b on a.jobtitle=b.id and a.status&lt;4
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
group by c.id) f
on f.id=a.id
left join HrmJobTitles g on a.ec_jobTitle = g.id
where nvl(a.delete_type,0) &lt;&gt; 1 and nvl(a.forbidden_tag,0) &lt;&gt; 1
</insert>
<!--同步部门信息-->
<insert id="insertDeptToMap" databaseId="sqlserver">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+100000000,2,a.id,a.uuid,0,'行政维度',a.DEPARTMENTCODE,a.departmentname,cast(b.BMFZR as varchar(10)),c.messagerurl,
c.lastname,c.jobtitle,d.jobtitlemark,f.level_name,g.grade_name,
(case isnull(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid+100000000 end),
(case isnull(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid end),
0,0,0,convert(varchar(100),getDate(),23),'2099-12-31'
from
HrmDepartment as a
left join hrmdepartmentdefined as b on a.id=b.deptid
left join hrmresource as c on cast(b.BMFZR as varchar(10))=cast(c.ID as varchar(10))
left join hrmjobtitles as d on c.JOBTITLE=d.id
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
left join jcl_org_level f on e.${level}=f.id
left join jcl_org_grade g on e.${grade}=g.id
where isnull(a.canceled,0) &lt;&gt; 1
</insert>
<insert id="insertDeptToMap" databaseId="mysql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+100000000,2,a.id,a.uuid,0,'行政维度',a.DEPARTMENTCODE,a.departmentname,b.BMFZR,c.messagerurl,
c.lastname,c.jobtitle,d.jobtitlemark,f.level_name,g.grade_name,
(case ifnull(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid+100000000 end),
(case ifnull(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid end),
0,0,0,NOW(),'2099-12-31'
from
HrmDepartment as a
left join hrmdepartmentdefined as b on a.id=b.deptid
left join hrmresource as c on b.BMFZR=c.ID
left join hrmjobtitles as d on c.JOBTITLE=d.id
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
left join jcl_org_level f on e.${level}=f.id
left join jcl_org_grade g on e.${grade}=g.id
where ifnull(a.canceled,0) &lt;&gt; 1
</insert>
<insert id="insertDeptToMap" databaseId="postgresql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+100000000,2,a.id,a.uuid,0,'行政维度',a.DEPARTMENTCODE,a.departmentname,b.BMFZR,c.messagerurl,
c.lastname,c.jobtitle,d.jobtitlemark,f.level_name,g.grade_name,
(case COALESCE(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid+100000000 end),
(case COALESCE(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid end),
0,0,0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'2099-12-31'
from
HrmDepartment as a
left join hrmdepartmentdefined as b on a.id=b.deptid
left join hrmresource as c on NULLIF(b.BMFZR,'')=c.ID
left join hrmjobtitles as d on c.JOBTITLE=d.id
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
left join jcl_org_level f on NULLIF(e.${level},'')=f.id
left join jcl_org_grade g on NULLIF(e.${grade},'')=g.id
where COALESCE(a.canceled,'0') &lt;&gt; '1'
</insert>
<insert id="insertDeptToMap" databaseId="oracle">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id+100000000,2,a.id,a.uuid,0,'行政维度',a.DEPARTMENTCODE,a.departmentname,to_char(b.BMFZR),c.messagerurl,
c.lastname,c.jobtitle,d.jobtitlemark,f.level_name,g.grade_name,
(case nvl(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid+100000000 end),
(case nvl(a.supdepid,0) when 0 then a.subcompanyid1 else a.supdepid end),
0,0,0,TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd'), TO_DATE('2099-12-31','yyyy-MM-dd')
from HrmDepartment a
left join hrmdepartmentdefined b on a.id=b.deptid
left join hrmresource c on to_char(b.BMFZR)=to_char(c.ID)
left join hrmjobtitles d on c.JOBTITLE=d.id
left join cus_fielddata e on c.id = e.id and e.scope='HrmCustomFieldByInfoType' and e.scopeid=3
left join jcl_org_level f on e.${level}=f.id
left join jcl_org_grade g on e.${grade}=g.id
where nvl(a.canceled,0) &lt;&gt; 1
</insert>
<!--同步分部信息-->
<insert id="insertSubComToMap" databaseId="sqlserver">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id,1,a.id,a.uuid,0,'行政维度', '',a.subcompanyname,null,'',
'',NULL,'','','',isnull(a.supsubcomid,0),isnull(a.supsubcomid,0),
0,0,0,convert(varchar(100),getDate(),23),'2099-12-31' from hrmsubcompany as a
where isnull(a.canceled,0) &lt;&gt; 1
</insert>
<insert id="insertSubComToMap" databaseId="mysql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id,1,a.id,a.uuid,0,'行政维度', '',a.subcompanyname,null,'',
'',NULL,'','','',ifnull(a.supsubcomid,0),ifnull(a.supsubcomid,0),
0,0,0,NOW(),'2099-12-31' from hrmsubcompany as a
where IFNULL(a.canceled,0) &lt;&gt; 1
</insert>
<insert id="insertSubComToMap" databaseId="postgresql">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id,1,a.id,a.uuid,0,'行政维度', '',a.subcompanyname,null,'',
'',NULL,'','','',COALESCE(a.supsubcomid,0),COALESCE(a.supsubcomid,0),
0,0,0,TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'),'2099-12-31' from hrmsubcompany as a
where COALESCE(a.canceled,'0') &lt;&gt; '1'
</insert>
<insert id="insertSubComToMap" databaseId="oracle">
insert into jcl_org_map
(id,ftype,fobjid,uuid,fclass,fclassname,fnumber,fname,fleader,fleaderimg,
fleadername,fleaderjobid,fleaderjob,fleaderlv,fleaderst,fparentid,fobjparentid,
fplan,fonjob,fisvitual,fdatebegin,fdateend)
select a.id,1,a.id,a.uuid,0,'行政维度', '',a.subcompanyname,null,'',
'',NULL,'','','',nvl(a.supsubcomid,0),nvl(a.supsubcomid,0),
0,0,0,TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd'), TO_DATE('2099-12-31','yyyy-MM-dd') from hrmsubcompany a
where nvl(a.canceled,0) &lt;&gt; 1
</insert>
<!--同步集团信息-->
<insert id="insertComToMap" databaseId="sqlserver">
INSERT INTO jcl_org_map ( id, ftype, fobjid, uuid,fclass, fclassname, fnumber, fname,
fleader, fleaderimg, fleadername, fleaderjobid, fleaderjob, fparentid,fobjparentid,
fplan, fonjob, fisvitual, fdatebegin, fdateend)
SELECT 0, 0, 0, uuid, 0, '行政维度', '00', companyname,
0, NULL, NULL, 0, NULL, -1, 0,
0, 0, 0, convert(varchar(100),getDate(),23), '2099-12-31' FROM hrmcompany
</insert>
<insert id="insertComToMap" databaseId="oracle">
INSERT INTO jcl_org_map ( id, ftype, fobjid, uuid,fclass, fclassname, fnumber, fname,
fleader, fleaderimg, fleadername, fleaderjobid, fleaderjob, fparentid,fobjparentid,
fplan, fonjob, fisvitual, fdatebegin, fdateend)
SELECT 0, 0, 0, uuid, 0, '行政维度', '00', companyname,
0, NULL, NULL, 0, NULL, -1, 0,
0, 0, 0, TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd'), TO_DATE('2099-12-31','yyyy-MM-dd') FROM hrmcompany
</insert>
<insert id="insertComToMap" databaseId="mysql">
INSERT INTO jcl_org_map ( id, ftype, fobjid, uuid,fclass, fclassname, fnumber, fname,
fleader, fleaderimg, fleadername, fleaderjobid, fleaderjob, fparentid,fobjparentid,
fplan, fonjob, fisvitual, fdatebegin, fdateend)
SELECT 0, 0, 0, uuid, 0, '行政维度', '00', companyname,
0, NULL, NULL, 0, NULL, -1, 0,
0, 0, 0, NOW(), '2099-12-31' FROM hrmcompany
</insert>
<insert id="insertComToMap" databaseId="postgresql">
INSERT INTO jcl_org_map ( id, ftype, fobjid, uuid,fclass, fclassname, fnumber, fname,
fleader, fleaderimg, fleadername, fleaderjobid, fleaderjob, fparentid,fobjparentid,
fplan, fonjob, fisvitual, fdatebegin, fdateend)
SELECT 0, 0, 0, uuid, 0, '行政维度', '00', companyname,
0, NULL, NULL, 0, NULL, -1, 0,
0, 0, 0, TO_DATE(to_char(NOW(),'yyyy-MM-dd'),'yyyy-MM-dd'), '2099-12-31' FROM hrmcompany
</insert>
<delete id="deleteJobNull">
delete from jcl_org_map where ftype =3 and fdateend &gt; #{currentDate} and id not in (select a.FPARENTID from (select FPARENTID from jcl_org_map where ftype=4 and fdateend &gt; #{currentDate}) a)
</delete>
<select id="getResInfo" resultType="com.engine.organization.entity.map.JclOrgMap">
select a.id as fLeader,a.messagerurl as fLeaderImg,a.LASTNAME as fLeaderName,a.jobtitle as fLeaderJobId,b.JOBTITLEMARK as fLeaderJob,e.level_name as fLeaderLv,f.grade_name as fLeaderSt
from hrmresource a
left join hrmjobtitles b on a.JOBTITLE=b.ID
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3
left join jcl_org_level e on d.${level}=e.id
left join jcl_org_grade f on d.${grade}=f.id
where a.id=#{id}
</select>
</mapper>

@ -1,5 +1,6 @@
package com.engine.organization.mapper.job;
import com.engine.organization.entity.hrmresource.po.ResourcePO;
import com.engine.organization.entity.job.dto.JobListDTO;
import com.engine.organization.entity.job.po.JobPO;
import org.apache.ibatis.annotations.Param;
@ -79,24 +80,6 @@ public interface JobMapper {
*/
List<JobPO> listByNo(@Param("jobNo") String jobNo);
/**
*
*
* @param jobName
* @param id
* @return
*/
List<JobPO> listByNameExceptId(@Param("jobName") String jobName, @Param("id") Long id);
/**
*
* @param jobName
* @param id
* @param parentJob
* @param ecDepartment
* @return
*/
Integer countRepeatNameByPid(@Param("jobName") String jobName, @Param("id") Long id, @Param("parentJob") Long parentJob, @Param("ecDepartment") Long ecDepartment);
/**
*
@ -139,14 +122,6 @@ public interface JobMapper {
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
/**
* ID
*
* @return
*/
List<String> listUsedId();
/**
*
*
@ -163,20 +138,15 @@ public interface JobMapper {
* @param parentJob
* @return
*/
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Long parentCompany, @Param("parentDepartment") Long parentDepartment, @Param("parentJob") Long parentJob);
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob);
Long getIdByNameAndEcId(@Param("jobName") String jobName, @Param("ecCompany") String ecCompany, @Param("ecDepartment") String ecDepartment);
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
int checkRepeatNo(@Param("jobNo") String jobNo, @Param("id") Long id);
int selectByConditions(@Param("resourcePO") ResourcePO resourcePO);
/**
*
*
* @param ids
* @param parentCompany
* @return
*/
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Long parentCompany, @Param("ecCompany") String ecCompany);
List<String> listUsedId();
List<String> isAllowDelete(@Param("jobId") Long jobId);
int isHasResource(@Param("jobId") Long jobId);
JobPO getJobByResource(@Param("resourcePO") ResourcePO resourcePO);
}

@ -4,11 +4,11 @@
<resultMap id="BaseResultMap" type="com.engine.organization.entity.job.po.JobPO">
<result column="id" property="id"/>
<result column="job_no" property="jobNo"/>
<result column="job_name" property="jobName"/>
<result column="parent_comp" property="parentComp"/>
<result column="parent_dept" property="parentDept"/>
<result column="jobtitlename" property="jobTitleName"/>
<result column="ec_jobTitle" property="ecJobTitle"/>
<result column="ec_company" property="ecCompany"/>
<result column="ec_department" property="ecDepartment"/>
<result column="ec_jobTitle" property="ecJobTitle"/>
<result column="sequence_id" property="sequenceId"/>
<result column="scheme_id" property="schemeId"/>
<result column="parent_job" property="parentJob"/>
@ -34,9 +34,8 @@
id
,
t.job_no,
t.job_name,
t.parent_comp,
t.parent_dept,
h.jobtitlename,
t.ec_jobTitle,
t.ec_company,
t.ec_department,
t.sequence_id,
@ -73,15 +72,6 @@
<if test="jobNo != null ">
job_no,
</if>
<if test="jobName != null ">
job_name,
</if>
<if test="parentComp != null ">
parent_comp,
</if>
<if test="parentDept != null ">
parent_dept,
</if>
<if test="sequenceId != null ">
sequence_id,
</if>
@ -115,6 +105,9 @@
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="ecJobTitle != null ">
ec_jobTitle,
</if>
forbidden_tag,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
@ -133,16 +126,6 @@
<if test="jobNo != null ">
#{jobNo},
</if>
<if test="jobName != null ">
#{jobName},
</if>
<if test="parentComp != null ">
#{parentComp},
</if>
<if test="parentDept != null ">
#{parentDept},
</if>
<if test="sequenceId != null ">
#{sequenceId},
</if>
@ -176,6 +159,9 @@
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="ecJobTitle != null ">
#{ecJobTitle},
</if>
0,
</trim>
</insert>
@ -202,15 +188,6 @@
<if test="jobNo != null ">
job_no,
</if>
<if test="jobName != null ">
job_name,
</if>
<if test="parentComp != null ">
parent_comp,
</if>
<if test="parentDept != null ">
parent_dept,
</if>
<if test="sequenceId != null ">
sequence_id,
</if>
@ -244,6 +221,9 @@
<if test="ecDepartment != null ">
ec_department,
</if>
<if test="ecJobTitle != null ">
ec_jobTitle,
</if>
forbidden_tag,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
@ -262,16 +242,6 @@
<if test="jobNo != null ">
#{jobNo},
</if>
<if test="jobName != null ">
#{jobName},
</if>
<if test="parentComp != null ">
#{parentComp},
</if>
<if test="parentDept != null ">
#{parentDept},
</if>
<if test="sequenceId != null ">
#{sequenceId},
</if>
@ -305,6 +275,9 @@
<if test="ecDepartment != null ">
#{ecDepartment},
</if>
<if test="ecJobTitle != null ">
#{ecJobTitle},
</if>
0,
</trim>
</insert>
@ -314,9 +287,6 @@
<set>
creator=#{creator},
update_time=#{updateTime},
job_name=#{jobName},
parent_comp=#{parentComp},
parent_dept=#{parentDept},
ec_company=#{ecCompany},
ec_department=#{ecDepartment},
sequence_id=#{sequenceId},
@ -351,44 +321,29 @@
#{id}
</foreach>
</update>
<update id="updateJobCompany">
update jcl_org_job
<set>
parent_comp = #{parentCompany},
ec_company =#{ecCompany},
</set>
where delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<select id="listByFilter" resultType="com.engine.organization.entity.job.dto.JobListDTO"
parameterType="com.engine.organization.entity.job.po.JobPO">
SELECT
a.comp_name ,
b.dept_name ,
a.subcompanyname ,
b.departmentname ,
c.sequence_name,
d.scheme_name,
<include refid="baseColumns"/>
FROM jcl_org_job t
left join jcl_org_comp a on
t.parent_comp = a.id
left join jcl_org_dept b on
t.parent_dept = b.id
left join hrmjobtitles h on
t.ec_jobTitle = h.id
left join hrmsubcompany a on
t.ec_company = a.id
left join hrmdepartment b on
t.ec_department = b.id
left join jcl_org_sequence c on
t.sequence_id = c.id
left join jcl_org_scheme d on
t.scheme_id = d.id
WHERE t.delete_type = 0
<include refid="likeSQL"/>
<if test=" jobPO.parentComp != null ">
and t.parent_comp = #{jobPO.parentComp}
</if>
<if test=" jobPO.parentDept != null ">
and t.parent_dept = #{jobPO.parentDept}
</if>
<if test=" jobPO.parentJob != null ">
and t.parent_job = #{jobPO.parentJob}
</if>
@ -415,20 +370,21 @@
<select id="listNoFilter" resultType="com.engine.organization.entity.job.dto.JobListDTO">
SELECT
a.comp_name ,
b.dept_name ,
a.subcompanyname ,
b.departmentname ,
c.sequence_name,
d.scheme_name,
<include refid="baseColumns"/>
FROM jcl_org_job t
left join jcl_org_comp a on
t.parent_comp = a.id
left join jcl_org_dept b on
t.parent_dept = b.id
left join hrmsubcompany a on
t.ec_company = a.id
left join hrmdepartment b on
t.ec_department = b.id
left join jcl_org_sequence c on
t.sequence_id = c.id
left join jcl_org_scheme d on
t.scheme_id = d.id
left join hrmjobtitles h on t.ec_jobTitle = h.id
WHERE t.delete_type = 0 order by ${orderSql}
</select>
@ -436,16 +392,18 @@
select
<include refid="baseColumns"/>
from jcl_org_job t
where delete_type = 0
and id = #{id}
left join hrmjobtitles h on t.ec_jobTitle = h.id
where t.delete_type = 0
and t.id = #{id}
</select>
<select id="listJobsByIds" resultType="java.util.Map">
select
id as "id",
job_name as "name"
t.id as "id",
h.jobtitlename as "name"
from jcl_org_job t
WHERE delete_type = 0
AND id IN
left join hrmjobtitles h on t.ec_jobTitle = h.id
WHERE t.delete_type = 0
AND t.id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
@ -453,50 +411,41 @@
<select id="listByNo" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_job t where job_no = #{jobNo} AND delete_type = 0
from jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
where job_no = #{jobNo} AND delete_type = 0
</select>
<select id="getJobsByPid" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
where delete_type = 0
and parent_job = #{pid}
</select>
<select id="listUsedId" resultType="java.lang.String">
select job_id
from JCL_ORG_STAFF
where delete_type = 0
union
select job_title
from jcl_org_hrmresource
where STATUS &lt; 4
</select>
<select id="listJobsByDepartmentId" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
where delete_type = 0
and parent_dept = #{departmentId}
and ec_department = #{departmentId}
</select>
<select id="listAll" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
where delete_type = 0
</select>
<select id="listPOsByFilter" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
FROM jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
WHERE t.delete_type = 0
<include refid="likeSQL"/>
<if test=" jobPO.parentComp != null ">
and t.parent_comp = #{jobPO.parentComp}
</if>
<if test=" jobPO.parentDept != null ">
and t.parent_dept = #{jobPO.parentDept}
</if>
<if test=" jobPO.sequenceId != null ">
and t.sequence_id = #{jobPO.sequenceId}
</if>
@ -514,95 +463,106 @@
select max(show_order)
from jcl_org_job
</select>
<select id="getIdByNameAndPid" resultType="java.lang.Long">
select id
<select id="selectByConditions" resultType="java.lang.Integer">
select count(1)
from jcl_org_job
where delete_type = 0 and job_name = #{jobName}
and parent_comp = #{parentCompany}
where ec_company = #{resourcePO.subcompanyid1}
and ec_department = #{resourcePO.departmentid}
and ec_jobtitle = #{resourcePO.jobtitle}
and delete_type = 0
</select>
<select id="getIdByNameAndPid" resultType="java.lang.Long">
select
t.id
from
jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
where
delete_type = 0
and h.JOBTITLENAME = #{jobName}
and ec_company = #{parentCompany}
<include refid="nullparentDept"/>
<include refid="nullparentJob"/>
</select>
<select id="getJobsByIds" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
where delete_type = 0
AND id IN
AND t.id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="listByNameExceptId" resultType="com.engine.organization.entity.job.po.JobPO">
select
<include refid="baseColumns"/>
<select id="listUsedId" resultType="java.lang.String">
select t.id
from jcl_org_job t
where delete_type = 0
AND job_name = #{jobName}
AND id != #{id}
inner join hrmresource h on t.ec_jobtitle = h.jobtitle and t.ec_company = h.subcompanyid1 and
t.ec_department = h.departmentid
</select>
<select id="checkRepeatNo" resultType="java.lang.Integer">
select count(1)
<select id="isAllowDelete" resultType="java.lang.String">
select t.id
from jcl_org_job t
inner join hrmresource h on t.ec_jobtitle = h.jobtitle and t.ec_company = h.subcompanyid1 and
t.ec_department = h.departmentid and t.id = #{jobId}
</select>
<select id="getJobByResource" resultType="com.engine.organization.entity.job.po.JobPO">
select
<include refid="baseColumns"/>
from jcl_org_job t
left join hrmjobtitles h on t.ec_jobTitle = h.id
where t.delete_type = 0
AND job_no = #{jobNo}
<if test=" id != null ">
and t.id != #{id}
<if test="resourcePO.subcompanyid1 != null">
and t.ec_company = #{resourcePO.subcompanyid1}
</if>
</select>
<select id="getIdByNameAndEcId" resultType="java.lang.Long">
select id
from jcl_org_job
where delete_type = 0
and job_name = #{jobName}
and ec_company = #{ecCompany}
and ec_department = #{ecDepartment}
</select>
<select id="countRepeatNameByPid" resultType="java.lang.Integer">
select count(1) from jcl_org_job
where delete_type = 0
AND job_name = #{jobName}
<if test="id != null">
AND id != #{id}
<if test="resourcePO.subcompanyid1 == null">
and t.ec_company is null
</if>
AND ec_department =#{ecDepartment}
<if test="parentJob != null">
AND parent_job = #{parentJob}
<if test="resourcePO.departmentid != null">
and t.ec_department = #{resourcePO.departmentid}
</if>
<if test="resourcePO.departmentid == null">
and t.ec_department is null
</if>
<if test="resourcePO.jobtitle != null">
and t.ec_jobTitle = #{resourcePO.jobtitle}
</if>
</select>
<select id="isHasResource" resultType="java.lang.Integer">
select count(a.id)
from jcl_org_hrmresource a
inner join jcl_org_job b on a.job_title = b.id
where a.status &lt; 4
and b.id = #{jobId}
</select>
<sql id="nullparentJob">
and ifnull(parent_job,0) =
#{parentJob}
</sql>
<sql id="nullparentJob" databaseId="sqlserver">
and isnull(parent_job,0) =
#{parentJob}
</sql>
<update id="updateJobCompany">
update jcl_org_job
<set>
parent_comp = #{parentCompany},
ec_company =#{ecCompany},
</set>
where delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<sql id="nullparentJob" databaseId="oracle">
and NVL(parent_job,0) =
#{parentJob}
</sql>
<sql id="nullparentDept">
and ifnull(parent_dept,0) =
and ifnull(ec_department,0) =
#{parentDepartment}
</sql>
<sql id="nullparentDept" databaseId="sqlserver">
and isnull(parent_dept,0) =
and isnull(ec_department,0) =
#{parentDepartment}
</sql>
<sql id="nullparentDept" databaseId="oracle">
and NVL(parent_dept,0) =
and NVL(ec_department,0) =
#{parentDepartment}
</sql>
<sql id="nullparentDept" databaseId="postgresql">
and COALESCE(ec_department,0) =
#{parentDepartment}
</sql>
@ -611,8 +571,8 @@
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
and t.job_no like CONCAT('%',#{jobPO.jobNo},'%')
</if>
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
and t.job_name like CONCAT('%',#{jobPO.jobName},'%')
<if test=" jobPO.jobTitleName != null and jobPO.jobTitleName != '' ">
and h.jobtitlename like CONCAT('%',#{jobPO.jobTitleName},'%')
</if>
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
and t.workplace like CONCAT('%',#{jobPO.workplace},'%')
@ -632,8 +592,28 @@
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
and t.job_no like '%'||#{jobPO.jobNo}||'%'
</if>
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
and t.job_name like '%'||#{jobPO.jobName}||'%'
<if test=" jobPO.jobTitleName != null and jobPO.jobTitleName != '' ">
and h.jobtitlename like '%'||#{jobPO.jobTitleName}||'%'
</if>
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
and t.workplace like '%'||#{jobPO.workplace}||'%'
</if>
<if test=" jobPO.description != null and jobPO.description != '' ">
and t.description like '%'||#{jobPO.description}||'%'
</if>
<if test=" jobPO.workDuty != null and jobPO.workDuty != '' ">
and t.work_duty like '%'||#{jobPO.workDuty}||'%'
</if>
<if test=" jobPO.workAuthority != null and jobPO.workAuthority != '' ">
and t.work_authority like '%'||#{jobPO.workAuthority}||'%'
</if>
</sql>
<sql id="likeSQL" databaseId="postgresql">
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
and t.job_no like '%'||#{jobPO.jobNo}||'%'
</if>
<if test=" jobPO.jobTitleName != null and jobPO.jobTitleName != '' ">
and h.jobtitlename like '%'||#{jobPO.jobTitleName}||'%'
</if>
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
and t.workplace like '%'||#{jobPO.workplace}||'%'
@ -653,8 +633,8 @@
<if test=" jobPO.jobNo != null and jobPO.jobNo != '' ">
and t.job_no like '%'+#{jobPO.jobNo}+'%'
</if>
<if test=" jobPO.jobName != null and jobPO.jobName != '' ">
and t.job_name like '%'+#{jobPO.jobName}+'%'
<if test=" jobPO.jobTitleName != null and jobPO.jobTitleName != '' ">
and h.jobTitleName like '%'+#{jobPO.jobTitleName}+'%'
</if>
<if test=" jobPO.workplace != null and jobPO.workplace != '' ">
and t.workplace like '%'+#{jobPO.workplace}+'%'

@ -12,8 +12,6 @@
<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>
@ -29,8 +27,6 @@
, t.custom
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
@ -110,8 +106,9 @@
</trim>
</insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
<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
@ -222,7 +219,7 @@
</trim>
<trim prefix="custom =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
when id=#{item.id} then #{item.custom}
when id=#{item.id} then #{item.custom}
</foreach>
</trim>
<trim prefix="update_time =case" suffix="end,">
@ -239,6 +236,50 @@
</foreach>
</update>
<update id="saveCardAccess" parameterType="java.util.List" databaseId="postgresql">
update jcl_org_cardaccess
<trim prefix="set" suffixOverrides=",">
<trim prefix="status =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.status != null">
when id=#{item.id} then #{item.status}
</if>
</foreach>
</trim>
<trim prefix="all_people =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.allPeople != null">
when id=#{item.id} then #{item.allPeople}
</if>
</foreach>
</trim>
<trim prefix="superior =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.superior != null">
when id=#{item.id} then #{item.superior}
</if>
</foreach>
</trim>
<trim prefix="all_superior =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.allSuperior != null">
when id=#{item.id} then #{item.allSuperior}
</if>
</foreach>
</trim>
<trim prefix="custom =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
when id=#{item.id} then #{item.custom}
</foreach>
</trim>
update_time=now(),
</trim>
where
<foreach collection="dataList" separator="or" item="item" index="index">
id=#{item.id}
</foreach>
</update>
<update id="deleteByIds">
UPDATE jcl_org_cardaccess
SET delete_type = 1

@ -1,7 +1,9 @@
package com.engine.organization.mapper.personnelcard;
import com.engine.organization.entity.personnelcard.po.CardButtonPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
@ -16,4 +18,10 @@ public interface CardButtonMapper {
List<CardButtonPO> listEnableButton();
List<Long> listAllId();
int deleteByIds(@Param("ids")Collection<Long> ids);
CardButtonPO getEditButton();
}

@ -8,10 +8,10 @@
<result column="url" property="url"/>
<result column="roles" property="roles"/>
<result column="sys_default" property="sysDefault"/>
<result column="show_order" property="showOrder"/>
<result column="open_type" property="openType"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
@ -25,21 +25,40 @@
, t.url
, t.roles
, t.sys_default
, t.show_order
, t.open_type
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<delete id="deleteByIds">
delete from jcl_org_cardbutton where id in
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="listAll" resultType="com.engine.organization.entity.personnelcard.po.CardButtonPO">
select
<include refid="baseColumns"/>
from jcl_org_cardbutton t where delete_type = 0
from jcl_org_cardbutton t where t.delete_type = 0 order by t.show_order
</select>
<select id="listEnableButton" resultType="com.engine.organization.entity.personnelcard.po.CardButtonPO">
select
<include refid="baseColumns"/>
from jcl_org_cardbutton t where t.delete_type = 0 and t.status = 1
from jcl_org_cardbutton t where t.delete_type = 0 and t.status = 1 order by t.show_order
</select>
<select id="listAllId" resultType="java.lang.Long">
select t.id
from jcl_org_cardbutton t
where t.delete_type = 0
</select>
<select id="getEditButton" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_cardbutton t
where t.delete_type = 0
and sys_default = 0
and id = 1
</select>
</mapper>

@ -2,6 +2,7 @@ package com.engine.organization.mapper.personnelcard;
import com.engine.organization.entity.personnelcard.ResourceBaseTab;
import com.engine.organization.entity.personnelcard.UserCard;
import com.engine.organization.entity.personnelcard.po.CusTreeFormPO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -22,7 +23,16 @@ public interface PersonnelCardMapper {
/**
*
*
* @return
*/
List<ResourceBaseTab> getResourceBaseTabList();
/**
*
*
* @return
*/
List<CusTreeFormPO> getCusTreeForms(@Param("parentId") Integer parentId);
}

@ -3,12 +3,12 @@
<mapper namespace="com.engine.organization.mapper.personnelcard.PersonnelCardMapper">
<resultMap id="UserMap" type="com.engine.organization.entity.personnelcard.UserCard">
<result column="id" property="id"/>
<result column="resource_image_id" property="image"/>
<result column="last_name" property="name"/>
<result column="resourceimageid" property="image"/>
<result column="lastname" property="name"/>
<result column="sex" property="sex"/>
<result column="email" property="email"/>
<result column="mobile" property="phone"/>
<result column="belong_to" property="belongTo"/>
<result column="accounttype" property="accountType"/>
<result column="status" property="status"/>
</resultMap>
@ -25,17 +25,26 @@
<result column="tabnum" property="tabNum"/>
</resultMap>
<resultMap id="CusTreeFormMap" type="com.engine.organization.entity.personnelcard.po.CusTreeFormPO">
<result column="scope" property="scope"/>
<result column="formLabel" property="formLabel"/>
<result column="id" property="id"/>
<result column="parentId" property="parentId"/>
<result column="viewType" property="viewType"/>
<result column="scopeOrder" property="scopeOrder"/>
</resultMap>
<select id="getUserById" resultMap="UserMap">
select id,
resource_image_id,
last_name,
resourceimageid,
lastname,
sex,
email,
mobile,
belong_to,
accounttype,
status
from jcl_org_hrmresource
from hrmresource
where id = #{id}
</select>
@ -45,4 +54,12 @@
where isopen = 1
order by dsporder
</select>
<select id="getCusTreeForms" resultMap="CusTreeFormMap">
select *
from cus_treeform
where parentid = #{parentId}
<if test="null!=parentId and parentId !=0">
and viewtype = 1
</if>
</select>
</mapper>

@ -0,0 +1,81 @@
package com.engine.organization.mapper.resource;
import com.alibaba.fastjson.JSONObject;
import com.engine.organization.entity.hrmresource.po.ResourcePO;
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
import com.engine.organization.entity.resume.po.HrmFamilyInfoPO;
import com.engine.organization.entity.resume.po.PersonnelResumePO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/12/15
* @Version V1.0
**/
public interface HrmResourceMapper {
List<ResourcePO> selectFilterDatas();
List<ResourcePO> listByFilter(@Param("resourcePO") ResourcePO resourcePO);
PersonnelResumePO getPersonnelResumeById(@Param("id") Integer id);
List<PersonnelResumePO> getPersonnelResumeList();
List<HrmFamilyInfoPO> getHrmFamilyInfoByUser(@Param("resourceId") Integer resourceId);
/**
*
*
* @param subcompanyid1
* @param departmentid
* @param jobId
* @param resourceId
* @return
*/
List<ResourcePO> getPersonnelScreening(@Param("subCompanyIds") List<Integer> subcompanyid1, @Param("departmentIds") List<Integer> departmentid, @Param("jobIds") List<Long> jobId, @Param("resourceIds") List<Long> resourceId);
/**
* ID
*
* @param userId
* @return
*/
List<SearchTemplateParam> getSearchTemplatesByUser(@Param("userId") Integer userId);
/**
* ID
*
* @param userId
* @return
*/
List<SearchTemplateParam> getCustomTemplatesByUser(@Param("userId") Integer userId);
SearchTemplatePO getSearchTemplateById(@Param("id") String id);
SearchTemplatePO getSearchTemplateByName(@Param("userId") Integer userId, @Param("name") String name);
SearchTemplatePO getCustomTemplateById(@Param("id") String id);
SearchTemplatePO getCustomTemplateByName(@Param("userId") Integer userId, @Param("name") String name);
SearchTemplatePO getUsedCustomTemplateByUser(@Param("userId") Integer userId);
Integer insertSearchTemplate(SearchTemplatePO templatePO);
Integer deleteSearchTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
Integer insertCustomTemplate(SearchTemplatePO templatePO);
Integer deleteCustomTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
List<JSONObject> queryAllResColumns(@Param("level") String level, @Param("grade") String grade);
String queryLabelName(@Param("fieldName") String fieldName, @Param("scopeId") String scopeId);
}

@ -0,0 +1,446 @@
<?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.resource.HrmResourceMapper">
<resultMap id="HrmResourceMap" type="com.engine.organization.entity.hrmresource.po.ResourcePO">
<result column="id" property="id"/>
<result column="subcompanyid1" property="subcompanyid1"/>
<result column="departmentid" property="departmentid"/>
<result column="jobtitle" property="jobtitle"/>
<result column="lastname" property="lastName"/>
<result column="dspOrder" property="dspOrder"/>
</resultMap>
<resultMap id="SearchTemplateMap" type="com.engine.organization.entity.hrmresource.param.SearchTemplateParam">
<result column="id" property="key"/>
<result column="name" property="showname"/>
<!-- <result column="selected" property="selected"/>-->
</resultMap>
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
SELECT DISTINCT subcompanyid1, departmentid, jobtitle
from hrmresource where status &lt; 4
</select>
<select id="listByFilter" resultMap="HrmResourceMap">
select id, subcompanyid1 , departmentid , jobtitle , lastname , dspOrder from hrmresource t
where 1=1
<include refid="likeSql"/>
<if test="resourcePO.subcompanyid1 != null">
and subcompanyid1 = #{resourcePO.subcompanyid1}
</if>
<if test="resourcePO.departmentid != null">
and departmentid = #{resourcePO.departmentid}
</if>
<if test="resourcePO.jobtitle != null">
and jobtitle = #{resourcePO.jobtitle}
</if>
</select>
<select id="getPersonnelResumeById"
resultType="com.engine.organization.entity.resume.po.PersonnelResumePO">
select lastname,
sex,
birthday,
resourceimageid as image,
nativeplace,
policy as politics,
a.departmentname as department,
maritalstatus as marriage,
b.jobtitlename as jobTitle,
companystartdate,
workstartdate,
certificatenum as idCard,
residentplace as address,
mobile as telephone,
email
from hrmresource h
inner join hrmdepartment a on a.id = h.departmentid
inner join hrmjobtitles b on b.id = h.jobtitle
where h.id = #{id}
</select>
<select id="getPersonnelResumeList"
resultType="com.engine.organization.entity.resume.po.PersonnelResumePO">
select h.id,
lastname,
sex,
birthday,
resourceimageid as image,
resourceimageid as imageId,
nativeplace,
policy as politics,
a.departmentname as department,
maritalstatus as marriage,
b.jobtitlename as jobTitle,
companystartdate,
workstartdate,
certificatenum as idCard,
residentplace as address,
mobile as telephone,
email
from hrmresource h
inner join hrmdepartment a on a.id = h.departmentid
inner join hrmjobtitles b on b.id = h.jobtitle
where h.status &lt; 4
</select>
<select id="getHrmFamilyInfoByUser" resultType="com.engine.organization.entity.resume.po.HrmFamilyInfoPO">
select *
from HrmFamilyInfo
where resourceid = #{resourceId}
</select>
<select id="getPersonnelScreening" resultMap="HrmResourceMap">
select t.id, t.subcompanyid1 , t.departmentid , t.jobtitle , t.lastname , t.dspOrder
from hrmresource t inner join JCL_ORG_JOB a ON a.EC_COMPANY =t.SUBCOMPANYID1 AND a.EC_DEPARTMENT =t.DEPARTMENTID
AND a.EC_JOBTITLE =t.JOBTITLE
where 1 = 1
<if test="subCompanyIds != null and subCompanyIds.size > 0">
AND t.subcompanyid1 IN
<foreach collection="subCompanyIds" open="(" item="subcompanyid1" separator="," close=")">
#{subcompanyid1}
</foreach>
</if>
<if test="departmentIds != null and departmentIds.size > 0">
AND t.departmentid IN
<foreach collection="departmentIds" open="(" item="departmentid" separator="," close=")">
#{departmentid}
</foreach>
</if>
<if test="jobIds != null and jobIds.size > 0">
AND a.id IN
<foreach collection="jobIds" open="(" item="jobId" separator="," close=")">
#{jobId}
</foreach>
</if>
<if test="resourceIds != null and resourceIds.size > 0">
AND t.id IN
<foreach collection="resourceIds" open="(" item="resourceId" separator="," close=")">
#{resourceId}
</foreach>
</if>
</select>
<select id="getSearchTemplatesByUser" resultMap="SearchTemplateMap">
select id,
name
from jcl_org_search_template
where creator = #{userId}
</select>
<select id="getSearchTemplateById"
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
select *
from jcl_org_search_template
where id = #{id}
</select>
<select id="getCustomTemplateById"
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
select *
from jcl_org_custom_template
where id = #{id}
</select>
<select id="getCustomTemplatesByUser"
resultMap="SearchTemplateMap">
select id,
name
from jcl_org_custom_template
where creator = #{userId}
</select>
<insert id="insertSearchTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO JCL_ORG_SEARCH_TEMPLATE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="creator != null">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="name != null">
name,
</if>
<if test="basicFields != null">
basic_fields,
</if>
<if test="personalFields != null">
personal_fields,
</if>
<if test="workFields != null">
work_fields,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="name != null">
#{name},
</if>
<if test="basicFields != null">
#{basicFields},
</if>
<if test="personalFields != null">
#{personalFields},
</if>
<if test="workFields != null">
#{workFields},
</if>
</trim>
</insert>
<insert id="insertSearchTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
databaseId="oracle">
<selectKey keyProperty="id" resultType="int" order="AFTER">
select JCL_ORG_SEARCH_TEMPLATE_ID.currval from dual
</selectKey>
INSERT INTO JCL_ORG_SEARCH_TEMPLATE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="creator != null">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="name != null">
name,
</if>
<if test="basicFields != null">
basic_fields,
</if>
<if test="personalFields != null">
personal_fields,
</if>
<if test="workFields != null">
work_fields,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="name != null">
#{name},
</if>
<if test="basicFields != null">
#{basicFields},
</if>
<if test="personalFields != null">
#{personalFields},
</if>
<if test="workFields != null">
#{workFields},
</if>
</trim>
</insert>
<insert id="insertCustomTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
keyProperty="id"
keyColumn="id" useGeneratedKeys="true">
INSERT INTO JCL_ORG_CUSTOM_TEMPLATE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="creator != null">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="name != null">
name,
</if>
<if test="basicFields != null">
basic_fields,
</if>
<if test="personalFields != null">
personal_fields,
</if>
<if test="workFields != null">
work_fields,
</if>
<if test="isused != null">
isused,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="name != null">
#{name},
</if>
<if test="basicFields != null">
#{basicFields},
</if>
<if test="personalFields != null">
#{personalFields},
</if>
<if test="workFields != null">
#{workFields},
</if>
<if test="isused != null">
#{isused},
</if>
</trim>
</insert>
<insert id="insertCustomTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
databaseId="oracle">
<selectKey keyProperty="id" resultType="int" order="AFTER">
select JCL_ORG_CUSTOM_TEMPLATE_ID.currval from dual
</selectKey>
INSERT INTO JCL_ORG_CUSTOM_TEMPLATE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="creator != null">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="name != null">
name,
</if>
<if test="basicFields != null">
basic_fields,
</if>
<if test="personalFields != null">
personal_fields,
</if>
<if test="workFields != null">
work_fields,
</if>
<if test="isused != null">
isused,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="creator != null">
#{creator},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="name != null">
#{name},
</if>
<if test="basicFields != null">
#{basicFields},
</if>
<if test="personalFields != null">
#{personalFields},
</if>
<if test="workFields != null">
#{workFields},
</if>
<if test="isused != null">
#{isused},
</if>
</trim>
</insert>
<delete id="deleteSearchTemplate">
delete
from jcl_org_search_template
where id = #{id}
and creator = #{userId}
</delete>
<delete id="deleteCustomTemplate">
delete
from jcl_org_custom_template
where id = #{id}
and creator = #{userId}
</delete>
<sql id="likeSql">
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
AND t.lastname like CONCAT('%',#{resourcePO.lastName},'%')
</if>
</sql>
<sql id="likeSql" databaseId="oracle">
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
AND t.lastname like '%'||#{resourcePO.lastName}||'%'
</if>
</sql>
<sql id="likeSql" databaseId="postgresql">
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
AND t.lastname like '%'||#{resourcePO.lastName}||'%'
</if>
</sql>
<sql id="likeSql" databaseId="sqlserver">
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
AND t.lastname like '%'+#{resourcePO.lastName}+'%'
</if>
</sql>
<select id="queryAllResColumns" parameterType="java.lang.String" resultType="com.alibaba.fastjson.JSONObject">
select a.fieldid, a.fieldname, b.labelname, a.issystem, a.ismand
from hrm_formfield a
inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = 7
</select>
<select id="getSearchTemplateByName"
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
select *
from jcl_org_search_template
where creator = #{userId}
and name = #{name}
</select>
<select id="getCustomTemplateByName"
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
select *
from jcl_org_custom_template
where creator = #{userId}
and name = #{name}
</select>
<select id="queryLabelName" parameterType="java.lang.String" resultType="java.lang.String">
select b.LABELNAME
from hrm_formfield a
inner join htmllabelinfo b on a.fieldlabel = b.indexid
where a.FIELDNAME = #{fieldName}
and b.LANGUAGEID = '7'
union all
SELECT t1.hrm_fieldlable as labelname
FROM cus_formfield t1,
cus_formdict t2
WHERE t1.fieldid = t2.id
AND t1.scope = 'HrmCustomFieldByInfoType'
and t1.SCOPEID = #{scopeId}
and t2.fieldname = #{fieldName}
</select>
<select id="getUsedCustomTemplateByUser"
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
select *
from jcl_org_custom_template
where ISUSED = 1
and creator = #{userId}
</select>
</mapper>

@ -0,0 +1,39 @@
package com.engine.organization.mapper.resource;
import com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* @author Mlin
* @description jcl_org_custom_templateMapper
* @createDate 2023-01-12 10:28:52
* @Entity com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplate
*/
public interface JclOrgCustomTemplateMapper {
int deleteByPrimaryKey(Long id);
int insert(JclOrgCustomTemplatePO record);
int insertSelective(JclOrgCustomTemplatePO record);
JclOrgCustomTemplatePO selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(JclOrgCustomTemplatePO record);
int updateByPrimaryKey(JclOrgCustomTemplatePO record);
List<JclOrgCustomTemplatePO> listAll();
List<Long> listAllId();
int deleteByIds(@Param("ids") Collection<Long> ids);
int updateUsed(@Param("isused")String isused,@Param("id") String id,@Param("creator") String creator);
JclOrgCustomTemplatePO queryIsusedTemp(@Param("isused")String isused,@Param("creator") String creator);
}

@ -0,0 +1,150 @@
<?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.resource.JclOrgCustomTemplateMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="basicFields" column="basic_fields" jdbcType="VARCHAR"/>
<result property="personalFields" column="personal_fields" jdbcType="VARCHAR"/>
<result property="workFields" column="work_fields" jdbcType="VARCHAR"/>
<result property="isused" column="isused" jdbcType="INTEGER"/>
<result property="creator" column="creator" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="DATE"/>
<result property="updateTime" column="update_time" jdbcType="DATE"/>
</resultMap>
<sql id="Base_Column_List">
id,name,basic_fields,
personal_fields,work_fields,isused,
creator,create_time,update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jcl_org_custom_template
where id = #{id,jdbcType=INTEGER}
</select>
<select id="listAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jcl_org_custom_template order by id
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jcl_org_custom_template
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO" useGeneratedKeys="true">
insert into jcl_org_custom_template
(name,basic_fields
,personal_fields,work_fields,isused
,creator,create_time,update_time
)
values (#{name,jdbcType=VARCHAR},#{basicFields,jdbcType=VARCHAR}
,#{personalFields,jdbcType=VARCHAR},#{workFields,jdbcType=VARCHAR},#{isused,jdbcType=INTEGER}
,#{creator,jdbcType=INTEGER},#{createTime,jdbcType=DATE},#{updateTime,jdbcType=DATE}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO" useGeneratedKeys="true">
insert into jcl_org_custom_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="basicFields != null">basic_fields,</if>
<if test="personalFields != null">personal_fields,</if>
<if test="workFields != null">work_fields,</if>
<if test="isused != null">isused,</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="id != null">#{id,jdbcType=INTEGER},</if>
<if test="name != null">#{name,jdbcType=VARCHAR},</if>
<if test="basicFields != null">#{basicFields,jdbcType=VARCHAR},</if>
<if test="personalFields != null">#{personalFields,jdbcType=VARCHAR},</if>
<if test="workFields != null">#{workFields,jdbcType=VARCHAR},</if>
<if test="isused != null">#{isused,jdbcType=INTEGER},</if>
<if test="creator != null">#{creator,jdbcType=INTEGER},</if>
<if test="createTime != null">#{createTime,jdbcType=DATE},</if>
<if test="updateTime != null">#{updateTime,jdbcType=DATE},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO">
update jcl_org_custom_template
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="basicFields != null">
basic_fields = #{basicFields,jdbcType=VARCHAR},
</if>
<if test="personalFields != null">
personal_fields = #{personalFields,jdbcType=VARCHAR},
</if>
<if test="workFields != null">
work_fields = #{workFields,jdbcType=VARCHAR},
</if>
<if test="isused != null">
isused = #{isused,jdbcType=INTEGER},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=DATE},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=DATE},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO">
update jcl_org_custom_template
set
name = #{name,jdbcType=VARCHAR},
basic_fields = #{basicFields,jdbcType=VARCHAR},
personal_fields = #{personalFields,jdbcType=VARCHAR},
work_fields = #{workFields,jdbcType=VARCHAR},
isused = #{isused,jdbcType=INTEGER},
creator = #{creator,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=DATE},
update_time = #{updateTime,jdbcType=DATE}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="listAllId" resultType="java.lang.Long">
select t.id from jcl_org_custom_template t
</select>
<delete id="deleteByIds">
delete from jcl_org_custom_template where id in
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateUsed" parameterType="java.lang.String">
update JCL_ORG_CUSTOM_TEMPLATE set isused = #{isused}
<where>
<if test="id !=null">
id = #{id}
</if>
<if test="creator !=null">
and creator = #{creator}
</if>
</where>
</update>
<select id="queryIsusedTemp" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from JCL_ORG_CUSTOM_TEMPLATE t where t.isused = #{isused} and t.creator = #{creator}
</select>
</mapper>

@ -15,15 +15,28 @@ import java.util.List;
**/
public interface ResourceMapper {
List<HrmResourceVO> listAll(@Param("ids")List<Long> ids);
List<HrmResourceVO> listAll(@Param("ids") List<Long> ids);
List<HrmResourceVO> listDetachAll(@Param("ids") List<Long> ids, @Param("companyIds") List<Long> companyIds);
List<HrmResourcePO> getResourceListByJobId(@Param("jobId") Long jobId);
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);
int updateResourceJob(@Param("originalJobId") Long originalJobId, @Param("targetJobId") Long targetJobId, @Param("parentComp") Integer parentComp, @Param("parentDept") Integer parentDept, @Param("ecCompany") Integer ecCompany, @Param("ecDepartment") Integer ecDepartment);
HrmResourcePO getResourceById(@Param("id") String id);
List<HrmResourcePO> listByNo(@Param("workCode") String workCode);
Long getMaxShowOrder();
/**
* ID
*
* @param keyField
* @param keyFieldValue
* @return
*/
List<Long> getIdByKeyField(@Param("keyField") String keyField, @Param("keyFieldValue") String keyFieldValue);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save