develop #169

Merged
liang.cheng merged 386 commits from develop into master 2 years ago

@ -3,35 +3,16 @@
#### 介绍 #### 介绍
聚才林组织模块代码 聚才林组织模块代码
#### 软件架构 #### 版本1.0 已封版
软件架构说明
该版本组织分为2套数据 采用单向同步的方式
#### 安装教程 #### 功能介绍
1. xxxx 组织架构图
2. xxxx 组织分权
3. xxxx 人员卡片等自定义功能
#### 使用说明
1. xxxx #### 迭代计划
2. xxxx 由于当前版本两套数据不好管理 下版计划将数据源统一换成ecology数据源
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/)

@ -594,3 +594,16 @@ create table JCL_ORG_CARDBUTTON (
update_time date null, update_time date null,
constraint JCL_ORG_CARDBUTTON_PK primary key (id) 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.conn.RecordSet;
import weaver.general.Util; import weaver.general.Util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -70,6 +72,45 @@ public class JobBrowserService extends BrowserService {
return resultMap; 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 @Override
public Map getBrowserConditionInfo(Map<String, Object> map) { public Map getBrowserConditionInfo(Map<String, Object> map) {
Map<String, List<SearchConditionItem>> apiDatas = new HashMap<>(); Map<String, List<SearchConditionItem>> apiDatas = new HashMap<>();
@ -99,14 +140,14 @@ public class JobBrowserService extends BrowserService {
*/ */
private String buildSqlWhere(Map<String, Object> params) { private String buildSqlWhere(Map<String, Object> params) {
DBType dbType = DBType.get(new RecordSet().getDBType()); 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")); String jobNo = Util.null2String(params.get("jobNo"));
if (StringUtils.isNotBlank(jobNo)) { if (StringUtils.isNotBlank(jobNo)) {
sqlWhere += " AND t.job_no " + dbType.like(jobNo); sqlWhere += " AND t.job_no " + dbType.like(jobNo);
} }
String jobName = Util.null2String(params.get("jobName")); String jobName = Util.null2String(params.get("jobName"));
if (StringUtils.isNotBlank(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")); String ecCompany = Util.null2String(params.get("ecCompany"));
if (StringUtils.isNotBlank(ecCompany)) { if (StringUtils.isNotBlank(ecCompany)) {
@ -121,16 +162,16 @@ public class JobBrowserService extends BrowserService {
String[] keyArray = treeKey.split("_"); String[] keyArray = treeKey.split("_");
if (keyArray.length == 2) { if (keyArray.length == 2) {
if (TreeNodeTypeEnum.TYPE_COMP.getName().equals(keyArray[0])) { 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])) { } 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()) { if (detachUtil.isDETACH()) {
sqlWhere += " AND t.parent_comp in (" + detachUtil.getJclRoleLevels() + ")"; sqlWhere += " AND t.ec_company in (" + detachUtil.getJclRoleLevels() + ")";
} }
return sqlWhere; return sqlWhere;
} }
@ -143,7 +184,7 @@ public class JobBrowserService extends BrowserService {
*/ */
private List<TreeNode> getCurrentTreeNode(SearchTreeParams params) { private List<TreeNode> getCurrentTreeNode(SearchTreeParams params) {
// 分权 // 分权
DetachUtil detachUtil = new DetachUtil(user.getUID()); DetachUtil detachUtil = new DetachUtil(user);
List<Long> jclRoleLevelList; List<Long> jclRoleLevelList;
if (StringUtils.isNotBlank(detachUtil.getJclRoleLevels())) { if (StringUtils.isNotBlank(detachUtil.getJclRoleLevels())) {
jclRoleLevelList = Arrays.stream(detachUtil.getJclRoleLevels().split(",")).map(Long::parseLong).collect(Collectors.toList()); 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)) { if (CollectionUtils.isNotEmpty(jclRoleLevelList)) {
compList = MapperProxyFactory.getProxy(CompMapper.class).getCompsByIds(jclRoleLevelList); compList = MapperProxyFactory.getProxy(CompMapper.class).getCompsByIds(jclRoleLevelList);
// 处理上下级关系 // 处理上下级关系
Set<Long> collectIds = compList.stream().map(CompPO::getId).collect(Collectors.toSet()); Set<Integer> collectIds = compList.stream().map(CompPO::getId).collect(Collectors.toSet());
compList.removeIf(item->collectIds.contains(item.getParentCompany())); compList.removeIf(item -> collectIds.contains(item.getSupSubComId()));
} else { } else {
compList = new ArrayList<>(); compList = new ArrayList<>();
@ -191,22 +232,22 @@ public class JobBrowserService extends BrowserService {
compList = MapperProxyFactory.getProxy(CompMapper.class).listParent(); 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())) { } else if ("1".equals(params.getType())) {
// 当前节点下的元素 // 当前节点下的元素
CompPO compBuild = CompPO.builder().parentCompany(Long.parseLong(params.getId())).forbiddenTag(0).deleteType(0).build(); CompPO compBuild = CompPO.builder().supSubComId(Integer.parseInt(params.getId())).canceled(0).build();
List<CompPO> compList = MapperProxyFactory.getProxy(CompMapper.class).listByFilter(compBuild, "show_order"); List<CompPO> compList = MapperProxyFactory.getProxy(CompMapper.class).listByFilter(compBuild, "showorder");
if (detachUtil.isDETACH()) { if (detachUtil.isDETACH()) {
detachUtil.filterCompanyList(compList); detachUtil.filterCompanyList(compList);
} }
DepartmentPO departmentBuild = DepartmentPO.builder().parentComp(Long.parseLong(params.getId())).forbiddenTag(0).deleteType(0).build(); DepartmentPO departmentBuild = DepartmentPO.builder().subCompanyId1(Integer.parseInt(params.getId())).canceled(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "show_order"); List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "showorder");
compList.forEach(item -> buildCompNodes(treeNodes, compHasSubs, item)); 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())) { } else if ("2".equals(params.getType())) {
DepartmentPO departmentBuild = DepartmentPO.builder().parentDept(Long.parseLong(params.getId())).forbiddenTag(0).deleteType(0).build(); DepartmentPO departmentBuild = DepartmentPO.builder().supDepId(Integer.parseInt(params.getId())).canceled(0).build();
List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "show_order"); List<DepartmentPO> departmentList = MapperProxyFactory.getProxy(DepartmentMapper.class).listByFilter(departmentBuild, "showorder");
departmentList.forEach(item -> buildDeptNodes(treeNodes, hasSubDepartment, item)); departmentList.forEach(item -> buildDeptNodes(treeNodes, hasSubDepartment, item));
} }
@ -226,7 +267,7 @@ public class JobBrowserService extends BrowserService {
SearchTree searchTree = new SearchTree(); SearchTree searchTree = new SearchTree();
searchTree.setId(company.getId().toString()); searchTree.setId(company.getId().toString());
searchTree.setType(TreeNodeTypeEnum.TYPE_COMP.getValue()); searchTree.setType(TreeNodeTypeEnum.TYPE_COMP.getValue());
searchTree.setName(company.getCompName()); searchTree.setName(company.getSubCompanyName());
searchTree.setIsParent(compHasSubs.contains(company.getId().toString())); searchTree.setIsParent(compHasSubs.contains(company.getId().toString()));
treeNodes.add(searchTree); treeNodes.add(searchTree);
} }
@ -241,7 +282,7 @@ public class JobBrowserService extends BrowserService {
private void buildDeptNodes(List<TreeNode> treeNodes, List<String> hasSubDepartment, DepartmentPO department) { private void buildDeptNodes(List<TreeNode> treeNodes, List<String> hasSubDepartment, DepartmentPO department) {
SearchTree searchTree = new SearchTree(); SearchTree searchTree = new SearchTree();
searchTree.setId(department.getId().toString()); searchTree.setId(department.getId().toString());
searchTree.setName(department.getDeptName()); searchTree.setName(department.getDepartmentName());
searchTree.setType(TreeNodeTypeEnum.TYPE_DEPT.getValue()); searchTree.setType(TreeNodeTypeEnum.TYPE_DEPT.getValue());
searchTree.setIsParent(hasSubDepartment.contains(department.getId().toString())); searchTree.setIsParent(hasSubDepartment.contains(department.getId().toString()));
treeNodes.add(searchTree); treeNodes.add(searchTree);

@ -2,12 +2,7 @@ package com.api.organization.web;
import javax.ws.rs.Path; import javax.ws.rs.Path;
/**
* @className: OrgChartController
* @author: dengjp
* @date: 2022/7/7
* @description:
**/
@Path("/bs/hrmorganization/orgchart") @Path("/bs/hrmorganization/orgchart")
public class OrgChartController extends com.engine.organization.web.OrgChartController { 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.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -24,7 +24,7 @@ import java.util.stream.Collectors;
public class DeleteParam { public class DeleteParam {
private String ids; private String ids;
public Collection<Long> getIds() { public List<Long> getIds() {
if(StringUtil.isEmpty(ids)){ if(StringUtil.isEmpty(ids)){
return new ArrayList<>(); return new ArrayList<>();
} }

@ -1,10 +1,7 @@
package com.engine.organization.entity.browser.po; package com.engine.organization.entity.browser.po;
import com.api.browser.bean.BrowserBean; import com.api.browser.bean.BrowserBean;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map; import java.util.Map;
@ -17,6 +14,7 @@ import java.util.Map;
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class CustomBrowserBean extends BrowserBean { 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)) { if(Objects.nonNull(param)) {
String enable = Util.null2String(param.getEnable(),"0"); String enable = Util.null2String(param.getEnable(),"0");
String key = param.getKey(); String key = param.getKey();
if (enable.equals("1") && StringUtils.isNotEmpty(key)) { if ("1".equals(enable) && StringUtils.isNotEmpty(key)) {
sb.append(key); sb.append(key);
sb.append(","); sb.append(",");
} }

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

@ -1,54 +1,121 @@
package com.engine.organization.entity.company.bo; package com.engine.organization.entity.company.bo;
import com.engine.organization.entity.company.dto.CompListDTO; 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.company.po.CompPO;
import com.engine.organization.entity.searchtree.SearchTree; import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import weaver.crm.Maint.SectorInfoComInfo;
import weaver.general.StringUtil;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.resource.ResourceComInfo;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @description:
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/05/16 * @createTime: 2022/11/24
* @version: 1.0 * @version: 1.0
*/ */
public class CompBO { 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 -> List<CompListDTO> dtoList = list.stream().map(e ->
CompListDTO CompListDTO
.builder() .builder()
.id(e.getId()) .id(e.getId())
.compNo(e.getCompNo()) .subCompanyCode(e.getSubCompanyCode())
.compName(e.getCompName()) .subCompanyDesc(e.getSubCompanyDesc())
.compNameShort(e.getCompNameShort()) .subCompanyName(e.getSubCompanyName())
.parentCompany(e.getParentCompany()) .supSubComId(e.getSupSubComId())
.parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName()) .supSubComName(null == poMaps.get(e.getSupSubComId()) ? "" : poMaps.get(e.getSupSubComId()).getSubCompanyName())
.orgCode(e.getOrgCode())
.industry(new SectorInfoComInfo().getSectorInfoname(Util.null2String(e.getIndustry())))
.compPrincipal(getUserNameById( Util.null2String(e.getCompPrincipal())))
.showOrder(e.getShowOrder()) .showOrder(e.getShowOrder())
.forbiddenTag(e.getForbiddenTag()) .canceled(null == e.getCanceled() ? 0 : e.getCanceled())
.build()).collect(Collectors.toList()); .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 // 兼容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()); 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> collectTree = dtoList.stream().peek(e -> {
List<CompListDTO> childList = collects.get(e.getId()); List<CompListDTO> childList = collects.get(e.getId());
leafs.add(e.getId()); leafs.add(e.getId());
@ -63,65 +130,7 @@ public class CompBO {
} }
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return collectTree.stream().filter(item->!leafs.contains(item.getParentCompany())).collect(Collectors.toList()); return collectTree.stream().filter(item -> !leafs.contains(item.getSupSubComId())).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());
} }
/** /**
@ -131,24 +140,13 @@ public class CompBO {
* @param po * @param po
* @param poMaps * @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)) { if (!addedList.contains(po)) {
addedList.add(po); addedList.add(po);
} }
CompPO parentCompPO = poMaps.get(po.getParentCompany()); CompPO parentCompPO = poMaps.get(po.getSupSubComId());
if (null != parentCompPO) { if (null != parentCompPO) {
dealParentData(addedList, parentCompPO, poMaps); 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; import java.util.List;
/** /**
* @description:
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/05/16 * @createTime: 2022/11/24
* @version: 1.0 * @version: 1.0
*/ */
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@OrganizationTable(pageId = "2c66b3a4-d4f8-11ec-9774-00ffcbed7508") @OrganizationTable(pageId = "dcfd9d27-6ba2-11ed-996a-00ffcbed7508")
public class CompListDTO { public class CompListDTO {
/** /**
* id * id
*/ */
private Long id; private Integer id;
/** /**
* *
*/ */
@ -32,46 +31,29 @@ public class CompListDTO {
/** /**
* *
*/ */
@TableTitle(title = "名称", dataIndex = "compName", key = "compName") @TableTitle(title = "名称", dataIndex = "subCompanyDesc", key = "subCompanyDesc")
private String compName; private String subCompanyDesc;
/** /**
* *
*/ */
@TableTitle(title = "编号", dataIndex = "compNo", key = "compNo") @TableTitle(title = "编号", dataIndex = "subCompanyCode", key = "subCompanyCode")
private String compNo; private String subCompanyCode;
/** /**
* *
*/ */
@TableTitle(title = "简称", dataIndex = "compNameShort", key = "compNameShort") @TableTitle(title = "简称", dataIndex = "subCompanyName", key = "subCompanyName")
private String compNameShort; private String subCompanyName;
/** /**
* *
*/ */
@TableTitle(title = "上级分部", dataIndex = "parentCompName", key = "parentCompName") @TableTitle(title = "上级分部", dataIndex = "supSubComName", key = "supSubComName")
private String parentCompName; 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) @TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
private Integer showOrder; private Integer showOrder;
@ -79,8 +61,8 @@ public class CompListDTO {
/** /**
* *
*/ */
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag") @TableTitle(title = "启用", dataIndex = "canceled", key = "canceled")
private int forbiddenTag; 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; import java.util.Date;
/** /**
* @description:
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/05/16 * @createTime: 2022/11/24
* @version: 1.0 * @version: 1.0
*/ */
@Data @Data
@ -18,68 +17,21 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class CompPO { public class CompPO {
private Integer id;
/** private String subCompanyName;
* private String subCompanyDesc;
*/ private Integer companyId;
private Long id; private Integer supSubComId;
private String url;
/** private Integer canceled;
* private String subCompanyCode;
*/ private String outKey;
private String compNo; private Integer limitUsers;
private Date created;
/** private Integer creater;
* private Date modified;
*/ private Integer modifier;
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 String uuid; private String uuid;
private Integer showOrder;
private Long creator; private Integer showOrderOfTree;
private int deleteType;
private Date createTime;
private Date updateTime;
} }

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

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

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

@ -1,10 +1,7 @@
package com.engine.organization.entity.department.param; package com.engine.organization.entity.department.param;
import com.engine.organization.common.BaseQueryParam; import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* @Author weaver_cl * @Author weaver_cl
@ -16,10 +13,11 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class QuerySingleDeptListParam extends BaseQueryParam { 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 @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class DepartmentPO { public class DepartmentPO {
private Integer id;
private Long id; private String departmentMark;
private String departmentName;
private String deptNo; private Integer subCompanyId1;
private Integer supDepId;
private String deptName; private String allSupDepId;
private Integer canceled;
private String deptNameShort; private String departmentCode;
private Integer coadjutant;
private Long parentComp; private String departmentId;
private Long ecCompany;
private Date created;
private Long parentDept; private Integer creater;
private Long ecDepartment; private Date modified;
private Integer modifier;
private Long deptPrincipal; //部门负责人
private Integer showOrder;
private String description;
private Integer forbiddenTag;
private String uuid; 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) tableType = WeaTableType.NONE)
public class SingleDeptTreeVO { public class SingleDeptTreeVO {
private Long id; private Integer id;
@TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo") @TableTitle(title = "编号", dataIndex = "departmentCode", key = "departmentCode")
private String deptNo; private String departmentCode;
@TableTitle(title = "部门名称", dataIndex = "deptName", key = "deptName") @TableTitle(title = "部门名称", dataIndex = "departmentMark", key = "departmentMark")
private String deptName; private String departmentMark;
private Long parentComp; //上级分部 private Integer subCompanyId1; //上级分部
private Long parentDept; //上级部门id private Integer supDepId; //上级部门id
@TableTitle(title = "上级部门", dataIndex = "parentDeptName", key = "parentDeptName") @TableTitle(title = "上级部门", dataIndex = "supDepName", key = "supDepName")
private String parentDeptName; //上级部门 private String supDepName; //上级部门
@TableTitle(title = "部门负责人", dataIndex = "deptPrincipalName", key = "deptPrincipalName") //@TableTitle(title = "部门负责人", dataIndex = "deptPrincipalName", key = "deptPrincipalName")
private String deptPrincipalName; //部门负责人 //private String deptPrincipalName; //部门负责人
//子节点 //子节点
private List<SingleDeptTreeVO> children; private List<SingleDeptTreeVO> children;

@ -21,11 +21,11 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@OrganizationTable(pageId = "80e7830c-18e8-4e14-8241-18821195ef31", @OrganizationTable(pageId = "80e7830c-18e8-4e14-8241-18821195ef31",
fields = "t.id," + fields = "t.id," +
"t.last_name," + "t.lastname," +
"t.mobile," + "t.mobile," +
"t.company_start_date," + "t.companystartdate," +
"t.sex", "t.sex",
fromSql = "FROM jcl_org_hrmresource t ", fromSql = "FROM hrmresource t ",
orderby = "id", orderby = "id",
primarykey = "id", primarykey = "id",
tableType = WeaTableType.NONE tableType = WeaTableType.NONE
@ -35,7 +35,7 @@ public class EmployeeTableVO {
@OrganizationTableColumn(column = "id", display = false) @OrganizationTableColumn(column = "id", display = false)
private Long id; private Long id;
@OrganizationTableColumn(text = "姓名", width = "25%", column = "last_name") @OrganizationTableColumn(text = "姓名", width = "25%", column = "lastname")
private String lastname; private String lastname;
@OrganizationTableColumn(text = "性别", width = "25%", column = "sex",transmethod = "com.engine.organization.transmethod.JobTransMethod.getSexName") @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") @OrganizationTableColumn(text = "手机", width = "25%", column = "mobile")
private String mobile; private String mobile;
@OrganizationTableColumn(text = "入职日期", width = "25%", column = "company_start_date") @OrganizationTableColumn(text = "入职日期", width = "25%", column = "companystartdate")
private String 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.ConditionFactory;
import com.api.browser.util.ConditionType; import com.api.browser.util.ConditionType;
import com.api.hrm.bean.FieldItem; import com.api.hrm.bean.FieldItem;
import com.api.hrm.util.FieldType; import com.api.hrm.bean.HrmFieldBean;
import com.api.hrm.util.ServiceUtil; import com.api.hrm.util.*;
import com.cloudstore.dev.api.util.TextUtil;
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit; import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
import com.engine.organization.entity.SelectOptionParam; 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.param.ExtendInfoFieldParam;
import com.engine.organization.entity.extend.po.ExtendGroupPO; import com.engine.organization.entity.extend.po.ExtendGroupPO;
import com.engine.organization.entity.extend.po.ExtendInfoPO; import com.engine.organization.entity.extend.po.ExtendInfoPO;
import com.engine.organization.mapper.extend.ExtendInfoMapper; 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.OrganizationFormItemUtil;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.sensitive.biz.SensitiveWordTypeComInfo; import com.engine.sensitive.biz.SensitiveWordTypeComInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; 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.file.ImageFileManager;
import weaver.general.BaseBean;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User; import weaver.hrm.User;
import weaver.hrm.definedfield.HrmFieldGroupComInfo;
import weaver.hrm.definedfield.HrmFieldManager; 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.SystemEnv;
import weaver.systeminfo.systemright.CheckSubCompanyRight;
import java.util.*; import java.util.*;
@ -47,7 +59,7 @@ public class ExtendInfoBO {
public static String DATE_Time_TO = "_end"; public static String DATE_Time_TO = "_end";
// 封装对象为table组件 // 封装对象为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<>(); List<Map<String, Object>> lsCol = new ArrayList<>();
Map<String, Object> col; Map<String, Object> col;
@ -56,19 +68,53 @@ public class ExtendInfoBO {
String tmpkey = extendInfoPO.getFieldName(); String tmpkey = extendInfoPO.getFieldName();
col = new HashMap<>(); col = new HashMap<>();
col.put("title", extendInfoPO.getFieldNameDesc()); col.put("title", extendInfoPO.getFieldNameDesc());
col.put("key", tmpkey); col.put("key", tmpkey);
col.put("dataIndex", tmpkey); col.put("dataIndex", tmpkey);
col.put("com", getFieldDetailInfo(user, extendInfoPO, viewAttr, showLabel, width)); col.put("com", getFieldDetailInfo(user, extendInfoPO, viewAttr, showLabel, width));
col.put("width", 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); lsCol.add(col);
} }
return lsCol; 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);
}
/** /**
* *
* *
@ -202,12 +248,36 @@ public class ExtendInfoBO {
fieldItem.setViewAttr(2); fieldItem.setViewAttr(2);
} }
} }
switch (fieldItem.getType()) {
// 浏览按钮特殊处理 case BROWSER:
if (FieldType.BROWSER.equals(fieldItem.getType())) {
String browserId = SelectOptionParam.getCustomBrowserId(extendInfoPO.getCustomValue()); String browserId = SelectOptionParam.getCustomBrowserId(extendInfoPO.getCustomValue());
BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), browserId).getBrowserConditionParam(); BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), browserId).getBrowserConditionParam();
fieldItem.setBrowserConditionParam(browserConditionParam); 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 + "%"); fieldItem.setWidth(width + "%");
@ -268,7 +338,7 @@ public class ExtendInfoBO {
switch (fieldhtmltype) { switch (fieldhtmltype) {
case "1": //单行文本框 case "1": //单行文本框
if (detailtype.equals("2")) {//数字 if ("2".equals(detailtype)) {//数字
searchConditionItem = conditionFactory.createCondition(ConditionType.INPUTNUMBER, fieldlabel, fieldname, isQuickSearch); searchConditionItem = conditionFactory.createCondition(ConditionType.INPUTNUMBER, fieldlabel, fieldname, isQuickSearch);
} else { } else {
searchConditionItem = conditionFactory.createCondition(ConditionType.INPUT, "25034", fieldname, isQuickSearch); searchConditionItem = conditionFactory.createCondition(ConditionType.INPUT, "25034", fieldname, isQuickSearch);
@ -319,14 +389,14 @@ public class ExtendInfoBO {
break; break;
} }
default: default:
if (detailtype.equals("161") || detailtype.equals("162") || detailtype.equals("256") || detailtype.equals("257")) { if ("161".equals(detailtype) || "162".equals(detailtype) || "256".equals(detailtype) || "257".equals(detailtype)) {
BrowserBean browserbean = new BrowserBean(Util.null2String(detailtype)); BrowserBean browserbean = new BrowserBean(Util.null2String(detailtype));
BrowserInitUtil browserInitUtil = new BrowserInitUtil(); BrowserInitUtil browserInitUtil = new BrowserInitUtil();
String fielddbtype = customValue; String fielddbtype = customValue;
if (!customValue.startsWith("browser.")) { if (!customValue.startsWith("browser.")) {
fielddbtype = "browser." + customValue; 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()); browserInitUtil.initCustomizeBrow(browserbean, fielddbtype, Util.getIntValue(detailtype), user.getUID());
} else { } else {
browserbean.getDataParams().put("cube_treeid", customValue); browserbean.getDataParams().put("cube_treeid", customValue);
@ -354,7 +424,9 @@ public class ExtendInfoBO {
String[] fieldvalues = Util.splitString(tmpFieldValue, ","); String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) {
String fieldshowname = Util.null2String(shiftManagementToolKit.getShiftOnOffWorkSections(fieldvalues[i], user.getLanguage())); 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<>(); Map<String, Object> replaceData = new HashMap<>();
replaceData.put("id", fieldvalues[i]); replaceData.put("id", fieldvalues[i]);
replaceData.put("name", fieldshowname); replaceData.put("name", fieldshowname);
@ -367,7 +439,9 @@ public class ExtendInfoBO {
String[] fieldvalues = Util.splitString(tmpFieldValue, ","); String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) {
String fieldshowname = Util.null2String(sensitiveWordTypeComInfo.getName(fieldvalues[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<>(); Map<String, Object> replaceData = new HashMap<>();
replaceData.put("id", fieldvalues[i]); replaceData.put("id", fieldvalues[i]);
replaceData.put("name", fieldshowname); 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 fieldshowname = hrmFieldManager.getFieldvalue(user, customValue, Util.getIntValue(fieldid), Util.getIntValue(fieldhtmltype), Util.getIntValue(detailtype), tmpFieldValue, 0);
String[] fieldvalues = Util.splitString(tmpFieldValue, ","); String[] fieldvalues = Util.splitString(tmpFieldValue, ",");
String[] fieldshownames = Util.splitString(fieldshowname, ","); String[] fieldshownames = Util.splitString(fieldshowname, ",");
if (detailtype.equals("257")) { if ("257".equals(detailtype)) {
if (fieldshowname.endsWith("&nbsp")) { if (fieldshowname.endsWith("&nbsp")) {
fieldshowname = fieldshowname.substring(0, fieldshowname.length() - 5); fieldshowname = fieldshowname.substring(0, fieldshowname.length() - 5);
} }
@ -422,7 +496,7 @@ public class ExtendInfoBO {
break; break;
case "4": //Check框 case "4": //Check框
searchConditionItem = conditionFactory.createCondition(ConditionType.CHECKBOX, fieldlabel, fieldname); searchConditionItem = conditionFactory.createCondition(ConditionType.CHECKBOX, fieldlabel, fieldname);
if (detailtype.equals("2")) { if ("2".equals(detailtype)) {
searchConditionItem.setConditionType(ConditionType.SWITCH); searchConditionItem.setConditionType(ConditionType.SWITCH);
} }
@ -431,7 +505,7 @@ public class ExtendInfoBO {
List<SearchConditionOption> searchConditionOptions = SelectOptionParam.convertJsonToListOption(customValue); List<SearchConditionOption> searchConditionOptions = SelectOptionParam.convertJsonToListOption(customValue);
searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname, searchConditionOptions); searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname, searchConditionOptions);
if (detailtype.equals("") || detailtype.equals("0")) { if ("".equals(detailtype) || "0".equals(detailtype)) {
detailtype = "1"; detailtype = "1";
} }
searchConditionItem.setKey(Util.null2String(fieldvalue)); searchConditionItem.setKey(Util.null2String(fieldvalue));
@ -439,7 +513,7 @@ public class ExtendInfoBO {
searchConditionItem.setDetailtype(Util.getIntValue(detailtype, 3)); searchConditionItem.setDetailtype(Util.getIntValue(detailtype, 3));
break; break;
case "6": //附件 case "6": //附件
if (fieldname.equals("resourceimageid")) { if ("resourceimageid".equals(fieldname)) {
searchConditionItem = conditionFactory.createCondition(ConditionType.RESOURCEIMG, fieldlabel, fieldname, isQuickSearch); searchConditionItem = conditionFactory.createCondition(ConditionType.RESOURCEIMG, fieldlabel, fieldname, isQuickSearch);
} else { } else {
searchConditionItem = conditionFactory.createCondition(ConditionType.UPLOAD, fieldlabel, fieldname, isQuickSearch); searchConditionItem = conditionFactory.createCondition(ConditionType.UPLOAD, fieldlabel, fieldname, isQuickSearch);
@ -514,4 +588,334 @@ public class ExtendInfoBO {
return searchConditionItem; 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() { public String getControlType() {
JSONArray fieldType = (JSONArray) this.getFieldType(); JSONArray fieldType = (JSONArray) this.getFieldType();
String fieldHtmlType = Util.null2String(fieldType.get(0)); String fieldHtmlType = Util.null2String(fieldType.get(0));
if (fieldHtmlType.equals("input")) { if ("input".equals(fieldHtmlType)) {
fieldHtmlType = "1"; fieldHtmlType = "1";
} else if (fieldHtmlType.equals("textarea")) { } else if ("textarea".equals(fieldHtmlType)) {
fieldHtmlType = "2"; fieldHtmlType = "2";
} else if (fieldHtmlType.equals("browser")) { } else if ("browser".equals(fieldHtmlType)) {
fieldHtmlType = "3"; fieldHtmlType = "3";
} else if (fieldHtmlType.equals("check")) { } else if ("check".equals(fieldHtmlType)) {
fieldHtmlType = "4"; fieldHtmlType = "4";
} else if (fieldHtmlType.equals("select")) { } else if ("select".equals(fieldHtmlType)) {
fieldHtmlType = "5"; fieldHtmlType = "5";
} else if (fieldHtmlType.equals("upload")) { } else if ("upload".equals(fieldHtmlType)) {
fieldHtmlType = "6"; fieldHtmlType = "6";
} }
return fieldHtmlType; return fieldHtmlType;
@ -60,27 +60,27 @@ public class ExtendInfoFieldParam {
if (fieldType.size() > 1) { if (fieldType.size() > 1) {
browserType = Util.null2String(fieldType.get(1)); browserType = Util.null2String(fieldType.get(1));
} }
if (controlType.equals("1")) { if ("1".equals(controlType)) {
if (browserType.equals("text")) { if ("text".equals(browserType)) {
browserType = "1"; browserType = "1";
} else if (browserType.equals("int")) { } else if ("int".equals(browserType)) {
browserType = "2"; browserType = "2";
} else if (browserType.equals("float")) { } else if ("float".equals(browserType)) {
browserType = "3"; browserType = "3";
} else if (browserType.equals("file")) { } else if ("file".equals(browserType)) {
browserType = "1"; browserType = "1";
} }
} }
if (controlType.equals("2")) { if ("2".equals(controlType)) {
browserType = "1"; browserType = "1";
} else if (controlType.equals("3")) { } else if ("3".equals(controlType)) {
browserType = Util.null2String(((JSONObject) fieldType.get(1)).get("value")); browserType = Util.null2String(((JSONObject) fieldType.get(1)).get("value"));
} else if (controlType.equals("4")) { } else if ("4".equals(controlType)) {
browserType = "1"; browserType = "1";
} else if (controlType.equals("5")) { } else if ("5".equals(controlType)) {
browserType = "1"; browserType = "1";
} else if (controlType.equals("6")) { } else if ("6".equals(controlType)) {
if (browserType.equals("file")) { if ("file".equals(browserType)) {
browserType = "1"; browserType = "1";
} }
} }
@ -89,7 +89,7 @@ public class ExtendInfoFieldParam {
public String getDbType(String controlType, String browserType) { public String getDbType(String controlType, String browserType) {
FieldParam fp = new FieldParam(); FieldParam fp = new FieldParam();
if (controlType.equals("1")) { if ("1".equals(controlType)) {
JSONArray fieldType = (JSONArray) this.getFieldType(); JSONArray fieldType = (JSONArray) this.getFieldType();
String dbLength = "100"; String dbLength = "100";
if (fieldType.size() > 2) { if (fieldType.size() > 2) {
@ -101,15 +101,15 @@ public class ExtendInfoFieldParam {
} }
fp.setSimpleText(Util.getIntValue(browserType, -1), dbLength); fp.setSimpleText(Util.getIntValue(browserType, -1), dbLength);
} else if (controlType.equals("2")) { } else if ("2".equals(controlType)) {
fp.setText(); fp.setText();
} else if (controlType.equals("3")) { } else if ("3".equals(controlType)) {
fp.setBrowser(Util.getIntValue(browserType, -1)); fp.setBrowser(Util.getIntValue(browserType, -1));
} else if (controlType.equals("4")) { } else if ("4".equals(controlType)) {
fp.setCheck(); fp.setCheck();
} else if (controlType.equals("5")) { } else if ("5".equals(controlType)) {
fp.setSelect(); fp.setSelect();
} else if (controlType.equals("6")) { } else if ("6".equals(controlType)) {
fp.setAttach(); fp.setAttach();
} }
return fp.getFielddbtype(); return fp.getFielddbtype();

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

@ -17,4 +17,5 @@ import lombok.NoArgsConstructor;
public class FieldTransferParam { public class FieldTransferParam {
private String id; private String id;
private String name; 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; package com.engine.organization.entity.hrmresource.param;
import com.engine.organization.common.BaseQueryParam; import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* @author:dxfeng * @author:dxfeng
@ -15,6 +12,7 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class HrmResourceSearchParam extends BaseQueryParam { 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 @AllArgsConstructor
@OrganizationTable(pageId = "c0583f20-f10c-11ec-9947-00e04c680716", @OrganizationTable(pageId = "c0583f20-f10c-11ec-9947-00e04c680716",
fields = "t.id," + fields = "t.id," +
"t.last_name," + "t.lastname," +
"t.department_id," + "t.departmentid," +
"t.company_id," + "t.subcompanyid1," +
"t.job_title," + "t.jobtitle," +
"t.mobile," + "t.mobile," +
"t.telephone," + "t.telephone," +
"t.manager_id, " + "t.managerid, " +
"t.show_order ", "t.dsporder ",
fromSql = "FROM jcl_org_hrmresource t ", 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 = " show_order ", orderby = " t.dsporder ",
sortway = " asc", sortway = " asc",
primarykey = "id", primarykey = "id",
operates = { operates = {
@OrganizationTableOperate(text = "查看") @OrganizationTableOperate(text = "查看"),
@OrganizationTableOperate(index = "1", text = "另存为版本")
}, },
tableType = WeaTableType.CHECKBOX 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; 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; 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; 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; 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; private String managerName;
@OrganizationTableColumn(text = "显示顺序", width = "25%", column = "show_order", orderkey = "show_order") @OrganizationTableColumn(text = "显示顺序", width = "25%", column = "dsporder", orderkey = "dsporder")
private Integer showOrder; 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 com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.job.JobTitlesComInfo;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -30,11 +31,10 @@ public class JobBO {
.builder() .builder()
.id(param.getId() == null ? 0 : param.getId()) .id(param.getId() == null ? 0 : param.getId())
.jobNo(param.getJobNo()) .jobNo(param.getJobNo())
.jobName(param.getJobName()) .jobTitleName(param.getJobTitleName())
.ecCompany(param.getEcCompany()) .ecJobTitle(param.getEcJobTitle())
.ecDepartment(param.getEcDepartment()) .ecCompany(param.getSubcompanyid1())
.parentComp(param.getSubcompanyid1()) .ecDepartment(param.getDepartmentid())
.parentDept( param.getDepartmentid())
.sequenceId(param.getSequenceId()) .sequenceId(param.getSequenceId())
.schemeId(param.getSchemeId()) .schemeId(param.getSchemeId())
.parentJob(param.getParentJob()) .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)) { if (CollectionUtils.isEmpty(jobPOS)) {
return Collections.emptyList(); return Collections.emptyList();
} }
@ -64,10 +64,10 @@ public class JobBO {
.builder() .builder()
.id(e.getId()) .id(e.getId())
.jobNo(e.getJobNo()) .jobNo(e.getJobNo())
.jobName(e.getJobName()) .jobName(e.getJobTitleName())
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName()) //.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobTitleName())
.parentJob(e.getParentJob()) .parentJob(e.getParentJob())
.parentDept(e.getParentDept()) .parentDept(e.getEcDepartment())
.build()).collect(Collectors.toList()); .build()).collect(Collectors.toList());
//获取非一级部门 //获取非一级部门
Map<Long, List<SingleJobTreeVO>> collects = singleJobTreeVOS.stream().filter(item -> null != item.getParentJob()).collect(Collectors.groupingBy(SingleJobTreeVO::getParentJob)); Map<Long, List<SingleJobTreeVO>> collects = singleJobTreeVOS.stream().filter(item -> null != item.getParentJob()).collect(Collectors.groupingBy(SingleJobTreeVO::getParentJob));
@ -78,26 +78,24 @@ public class JobBO {
public static List<JobListDTO> buildDTOList(Collection<JobListDTO> list) { 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 -> List<JobListDTO> dtoList = list.stream().map(e ->
JobListDTO.builder() JobListDTO.builder()
.id(e.getId()) .id(e.getId())
.jobNo(e.getJobNo()) .jobNo(e.getJobNo())
.jobName(e.getJobName()) .jobTitleName(e.getJobTitleName())
.compName(e.getCompName()) .subCompanyName(e.getSubCompanyName())
.deptName(e.getDeptName()) .departmentName(e.getDepartmentName())
.sequenceName(e.getSequenceName()) //.sequenceName(e.getSequenceName())
.schemeName(e.getSchemeName()) //.schemeName(e.getSchemeName())
//.parentJob(e.getParentJob()) //.parentJob(e.getParentJob())
//.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName()) //.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
.isKey(JobTransMethod.getIsKeySpan(e.getIsKey())) .isKey(JobTransMethod.getIsKeySpan(e.getIsKey()))
.showOrder(e.getShowOrder()) .showOrder(e.getShowOrder())
.forbiddenTag(e.getForbiddenTag()) //.forbiddenTag(e.getForbiddenTag())
.isUsed(0)
.build()).collect(Collectors.toList()); .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(); 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 -> { return dtoList.stream().peek(e -> {
List<JobListDTO> childList = collects.get(e.getId()); List<JobListDTO> childList = collects.get(e.getId());
if (CollectionUtils.isNotEmpty(childList)) { if (CollectionUtils.isNotEmpty(childList)) {
@ -151,19 +149,30 @@ public class JobBO {
return builderJobs.stream().map(item -> { return builderJobs.stream().map(item -> {
SearchTree tree = new SearchTree(); SearchTree tree = new SearchTree();
tree.setCanClick(true); tree.setCanClick(true);
tree.setCanceled(false); tree.setCanceled(item.getForbiddenTag() != 0);
tree.setIcon("icon-coms-content-o"); tree.setIcon("icon-coms-content-o");
tree.setId(item.getId().toString()); tree.setId(item.getId().toString());
tree.setIsParent(false); tree.setIsParent(false);
tree.setIsVirtual("0"); tree.setIsVirtual("0");
tree.setName(item.getJobName()); tree.setName(item.getJobTitleName());
tree.setPid(null == item.getParentJob() ? "0" : item.getParentJob().toString()); tree.setPid(null == item.getParentJob() ? "0" : item.getParentJob().toString());
tree.setSelected(false); tree.setSelected(false);
tree.setType("3"); 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()); tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
return tree; return tree;
}).collect(Collectors.toList()); }).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") @TableTitle(title = "名称", dataIndex = "jobTitleName", key = "jobTitleName", width = "150")
private String jobName; private String jobTitleName;
/** /**
* *
*/ */
@ -44,23 +44,23 @@ public class JobListDTO {
/** /**
* *
*/ */
@TableTitle(title = "所属分部", dataIndex = "compName", key = "compName") @TableTitle(title = "所属分部", dataIndex = "subCompanyName", key = "subCompanyName")
private String compName; private String subCompanyName;
/** /**
* *
*/ */
@TableTitle(title = "所属部门", dataIndex = "deptName", key = "deptName") @TableTitle(title = "所属部门", dataIndex = "departmentName", key = "departmentName")
private String deptName; private String departmentName;
/** /**
* *
*/ */
@TableTitle(title = "岗位序列", dataIndex = "sequenceName", key = "sequenceName") //@TableTitle(title = "岗位序列", dataIndex = "sequenceName", key = "sequenceName")
private String sequenceName; //private String sequenceName;
/** /**
* *
*/ */
@TableTitle(title = "等级方案", dataIndex = "schemeName", key = "schemeName") //@TableTitle(title = "等级方案", dataIndex = "schemeName", key = "schemeName")
private String schemeName; //private String schemeName;
/** /**
* *
*/ */
@ -68,7 +68,7 @@ public class JobListDTO {
//@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName") //@TableTitle(title = "上级岗位", dataIndex = "parentJobName", key = "parentJobName")
private String parentJobName; private String parentJobName;
private Long parentJob; private Long parentJob;
private Long parentComp; private Integer ecCompany;
/** /**
* *
*/ */
@ -84,8 +84,8 @@ public class JobListDTO {
/** /**
* *
*/ */
@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag") //@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
private Integer forbiddenTag; //private Integer forbiddenTag;
/** /**
* *

@ -1,10 +1,7 @@
package com.engine.organization.entity.job.param; package com.engine.organization.entity.job.param;
import com.engine.organization.common.BaseQueryParam; import com.engine.organization.common.BaseQueryParam;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* @description: * @description:
@ -16,6 +13,7 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class JobSearchParam extends BaseQueryParam { public class JobSearchParam extends BaseQueryParam {
/** /**
* *
@ -28,15 +26,15 @@ public class JobSearchParam extends BaseQueryParam {
/** /**
* *
*/ */
private String jobName; private String jobTitleName;
/** /**
* ec * ec
*/ */
private Long ecCompany; private Integer ecCompany;
/** /**
* ec * ec
*/ */
private Long ecDepartment; private Integer ecDepartment;
/** /**
* *
*/ */
@ -79,7 +77,9 @@ public class JobSearchParam extends BaseQueryParam {
*/ */
private Integer showOrder; 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 String jobTitleName;
/** ///**
* // * 所属分部
*/ // */
private Long parentComp; //private Integer parentComp;
/** /**
* ec * ec
*/ */
private Long ecCompany; private Integer ecCompany;
/** ///**
* // * 所属部门
*/ // */
private Long parentDept; //private Integer parentDept;
/** /**
* ec * ec
*/ */
private Long ecDepartment; private Integer ecDepartment;
/** /**
* *
@ -93,6 +93,8 @@ public class JobPO {
private String levelId; private String levelId;
private Integer ecJobTitle;
private Long creator; private Long creator;
private int deleteType; private int deleteType;

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

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

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

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

@ -27,10 +27,14 @@ public class UserCard {
private String email; private String email;
private String phone; private String phone;
private String belongTo; private String belongTo;
private String accountType;
private String status; private String status;
public String getBelongTo() { public String getAccountType() {
return StringUtils.isBlank(belongTo) ? "主账号" : "次账号"; if ("1".equals(accountType)) {
return "次账号";
}
return "主账号";
} }
public String getStatus() { public String getStatus() {

@ -29,6 +29,10 @@ public class CardButtonPO {
private String sysDefault; private String sysDefault;
private Integer showOrder;
private Integer openType;
private Long creator; private Long creator;
private int deleteType; 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", orderby = "id",
sortway = "asc", sortway = "asc",
primarykey = "id", primarykey = "id",
tableType = WeaTableType.CHECKBOX tableType = WeaTableType.NONE
) )
public class CardAccessVO { public class CardAccessVO {
@ -55,7 +55,7 @@ public class CardAccessVO {
@OrganizationTableColumn(text = "所有上级可见", width = "15%", column = "all_superior") @OrganizationTableColumn(text = "所有上级可见", width = "15%", column = "all_superior")
private Integer allSuperior; 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; 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; package com.engine.organization.entity.searchtree;
import com.api.hrm.bean.TreeNode; import com.api.hrm.bean.TreeNode;
import lombok.Data;
import java.util.Objects; import java.util.Objects;
@ -11,7 +10,6 @@ import java.util.Objects;
* @createTime: 2022/05/26 * @createTime: 2022/05/26
* @version: 1.0 * @version: 1.0
*/ */
@Data
public class SearchTree extends TreeNode { public class SearchTree extends TreeNode {
private String companyid; private String companyid;
private String isVirtual; private String isVirtual;
@ -22,10 +20,78 @@ public class SearchTree extends TreeNode {
private String parentComp; private String parentComp;
private Integer orderNum; 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 @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) {
if (o == null || getClass() != o.getClass()) return false; return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SearchTree that = (SearchTree) o; 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); 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; package com.engine.organization.entity.searchtree;
import lombok.Data; 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: * @description:
@ -26,5 +32,38 @@ public class SearchTreeParams {
private String virtualCompanyid; private String virtualCompanyid;
private String isLoadSubDepartment; 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 Integer compId;
private Long ecCompany; private Integer ecCompany;
/** /**
* *
*/ */
private Long deptId; private Integer deptId;
private Long ecDepartment; private Integer ecDepartment;
/** /**
* *
*/ */

@ -29,13 +29,13 @@ public class StaffPO {
/** /**
* *
*/ */
private Long compId; private Integer compId;
private Long ecCompany; private Integer ecCompany;
/** /**
* *
*/ */
private Long deptId; private Integer deptId;
private Long ecDepartment; 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.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @description: * @description:
@ -19,7 +18,9 @@ public interface CompMapper {
* *
* @return * @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 * ID
@ -30,48 +31,13 @@ public interface CompMapper {
List<String> listUsedIds(); 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 * @param ids
* @return * @return
*/ */
List<CompPO> listChild(@Param("ids") Collection ids); List<CompPO> listChild(@Param("ids") Collection<Integer> ids);
/**
* ID
*
* @param pid
* @return
*/
List<CompPO> listChildByPID(@Param("pid") String pid);
/**
* ID
*
* @param pid
* @return
*/
int countChildByPID(@Param("pid") long pid);
/** /**
* ID * ID
@ -79,33 +45,7 @@ public interface CompMapper {
* @param id * @param id
* @return * @return
*/ */
CompPO listById(@Param("id") Long id); CompPO listById(@Param("id") Integer 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);
/** /**
* ID * ID
@ -115,38 +55,25 @@ public interface CompMapper {
*/ */
List<CompPO> getCompsByIds(@Param("ids") Collection<Long> ids); List<CompPO> getCompsByIds(@Param("ids") Collection<Long> ids);
/** /**
* / *
* *
* @param compPO
* @return * @return
*/ */
int insertIgnoreNull(CompPO compPO); List<CompPO> listParent();
List<String> hasSubs();
/** List<String> hasDetachSubs(@Param("companyIds") Collection<Long> companyIds);
*
*
* @param compPO
* @return
*/
int updateBaseComp(CompPO compPO);
/** /**
* * ID
* *
* @param compPO * @param subCompanyName
* @param supSubComId
* @return * @return
*/ */
int updateForbiddenTagById(CompPO compPO); Integer getIdByNameAndPid(@Param("subCompanyName") String subCompanyName, @Param("supSubComId") Integer supSubComId);
/**
*
*
* @param ids
*/
int deleteByIds(@Param("ids") Collection<Long> ids);
/** /**
* *
@ -155,27 +82,5 @@ public interface CompMapper {
*/ */
Integer getMaxShowOrder(); Integer getMaxShowOrder();
/** Integer getIdBySubCompanyCode(@Param("subCompanyCode") String subCompanyCode);
* 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);
} }

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

@ -14,28 +14,22 @@ import java.util.Map;
* @Version V1.0 * @Version V1.0
**/ **/
public interface DepartmentMapper { public interface DepartmentMapper {
List<DepartmentPO> getDeptListByPId(@Param("PId") Integer PId);
List<DepartmentPO> getDeptListByCompId(@Param("parentComp") Integer parentComp);
List<DepartmentPO> getDeptListByPId(@Param("PId") Long PId);
int countChildByPID(@Param("pid") Long pid);
/** /**
* *
* *
* @return * @return
*/ */
List<DepartmentPO> list(@Param("orderSql") String orderSql); List<DepartmentPO> listAll(@Param("orderSql") String orderSql);
/** /**
* No * No
* *
* @param deptNo * @param departmentCode
* @return * @return
*/ */
List<DepartmentPO> listByNo(@Param("deptNo") String deptNo); List<DepartmentPO> listByNo(@Param("departmentCode") String departmentCode);
/** /**
* *
@ -60,15 +54,7 @@ public interface DepartmentMapper {
* @param id * @param id
* @return * @return
*/ */
DepartmentPO getDeptById(@Param("id") Long id); DepartmentPO getDeptById(@Param("id") Integer id);
/**
* UUID
*
* @param uuid
* @return
*/
DepartmentPO getDepartmentByUUID(@Param("uuid") String uuid);
/** /**
* ID * ID
@ -76,38 +62,7 @@ public interface DepartmentMapper {
* @param id * @param id
* @return * @return
*/ */
String getDeptNameById(@Param("id") Long id); String getDeptNameById(@Param("id") Integer 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);
/** /**
* ID * ID
@ -121,21 +76,26 @@ public interface DepartmentMapper {
* *
* @return * @return
*/ */
Integer getMaxShowOrder(); Double getMaxShowOrder();
/** /**
* *
* *
* @param departmentName * @param departmentName
* @param parentCompany * @param subCompanyId1
* @param parentDepartment * @param supDepId
* @return * @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(); 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"> <mapper namespace="com.engine.organization.mapper.department.DepartmentMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.department.po.DepartmentPO"> <resultMap id="BaseResultMap" type="com.engine.organization.entity.department.po.DepartmentPO">
<result column="id" property="id"/> <result column="id" property="id"/>
<result column="dept_no" property="deptNo"/> <result column="departmentMark" property="departmentMark"/>
<result column="dept_name" property="deptName"/> <result column="departmentName" property="departmentName"/>
<result column="dept_name_short" property="deptNameShort"/> <result column="subCompanyId1" property="subCompanyId1"/>
<result column="parent_comp" property="parentComp"/> <result column="supDepId" property="supDepId"/>
<result column="ec_company" property="ecCompany"/> <result column="allSupDepId" property="allSupDepId"/>
<result column="parent_dept" property="parentDept"/> <result column="canceled" property="canceled"/>
<result column="ec_department" property="ecDepartment"/> <result column="departmentCode" property="departmentCode"/>
<result column="dept_principal" property="deptPrincipal"/> <result column="coadjutant" property="coadjutant"/>
<result column="show_order" property="showOrder"/> <result column="showOrder" 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="uuid" property="uuid"/> <result column="uuid" property="uuid"/>
</resultMap> </resultMap>
@ -28,39 +21,28 @@
. .
id id
, ,
t.dept_no, t.departmentMark,
t.dept_name, t.departmentName,
t.dept_name_short, t.subCompanyId1,
t.parent_comp, t.supDepId,
t.ec_company, t.allSupDepId,
t.parent_dept, t.canceled,
t.ec_department, t.departmentCode,
t.dept_principal, t.coadjutant,
t.show_order, t.showOrder,
t.description,
t.forbidden_tag,
t.uuid t.uuid
</sql> </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 id="getDeptListByPId" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select select
<include refid="baseColumns"/> <include refid="baseColumns"/>
from jcl_org_dept t from hrmdepartment t
where delete_type = 0 where supDepId = #{PId}
and parent_dept = #{PId}
</select> </select>
<select id="getDeptNameById" resultType="string"> <select id="getDeptNameById" resultType="string">
select t.dept_name select t.departmentName
from jcl_org_dept t from hrmdepartment t
where id = #{id} where id = #{id}
</select> </select>
@ -68,437 +50,168 @@
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
<include refid="baseColumns"/> <include refid="baseColumns"/>
from jcl_org_dept t from hrmdepartment t
where delete_type = 0 where 1=1
<include refid="likeSQL"/> <include refid="likeSQL"/>
<if test=" departmentPO.ecCompany != null "> <if test=" departmentPO.subCompanyId1 != null ">
and t.ec_company = #{departmentPO.ecCompany} and t.subCompanyId1 = #{departmentPO.subCompanyId1}
</if> </if>
<if test=" departmentPO.ecDepartment != null "> <if test=" departmentPO.supDepId != null ">
and t.ec_department = #{departmentPO.ecDepartment} and t.supDepId = #{departmentPO.supDepId}
</if> </if>
<if test=" departmentPO.parentComp != null "> <if test=" departmentPO.departmentId != null ">
and t.parent_comp = #{departmentPO.parentComp} and t.id = #{departmentPO.departmentId}
</if>
<if test=" departmentPO.parentDept != null ">
and t.parent_dept = #{departmentPO.parentDept}
</if>
<if test=" departmentPO.deptPrincipal != null ">
and t.dept_principal = #{departmentPO.deptPrincipal}
</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> </if>
<include refid="isCanceled"/>
order by ${orderSql} order by ${orderSql}
</select> </select>
<select id="getDeptById" resultType="com.engine.organization.entity.department.po.DepartmentPO"> <select id="getDeptById" resultMap="BaseResultMap">
select select
<include refid="baseColumns"/> <include refid="baseColumns"/>
from jcl_org_dept t from hrmdepartment t
where delete_type = 0 where id = #{id}
and id = #{id}
</select> </select>
<select id="listDeptsByIds" resultType="java.util.Map"> <select id="listDeptsByIds" resultType="java.util.Map">
select select
id as "id", id as "id",
dept_name as "name" departmentName as "name"
from jcl_org_dept t from hrmdepartment t
WHERE delete_type = 0 WHERE id IN
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")"> <foreach collection="ids" open="(" item="id" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="list" resultType="com.engine.organization.entity.department.po.DepartmentPO"> <select id="listAll" resultType="com.engine.organization.entity.department.po.DepartmentPO">
SELECT SELECT
<include refid="baseColumns"/> <include refid="baseColumns"/>
FROM jcl_org_dept t FROM hrmdepartment t order by ${orderSql}
WHERE t.delete_type = 0 order by ${orderSql}
</select> </select>
<select id="listByNo" resultType="com.engine.organization.entity.department.po.DepartmentPO"> <select id="listByNo" resultType="com.engine.organization.entity.department.po.DepartmentPO">
select select
<include refid="baseColumns"/> <include refid="baseColumns"/>
from jcl_org_dept t where dept_no = #{deptNo} AND delete_type = 0 from hrmdepartment t where departmentCode = #{departmentCode}
</select>
<select id="countChildByPID" resultType="java.lang.Integer">
select count(1)
from jcl_org_dept t
where delete_type = 0
and parent_dept = #{pid}
</select> </select>
<select id="listUsedId" resultType="java.lang.String"> <select id="listUsedId" resultType="java.lang.String">
select parent_dept select ec_department
from JCL_ORG_JOB from JCL_ORG_JOB
where delete_type = 0 where delete_type = 0
union union
select dept_id select dept_id
from JCL_ORG_STAFF from JCL_ORG_STAFF
where delete_type = 0 where delete_type = 0
union
select departmentid
from hrmresource
</select> </select>
<select id="getDeptsByIds" resultMap="BaseResultMap"> <select id="getDeptsByIds" resultMap="BaseResultMap">
select select
<include refid="baseColumns"/> <include refid="baseColumns"/>
from jcl_org_dept t from hrmdepartment t
where delete_type = 0 where id IN
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")"> <foreach collection="ids" open="(" item="id" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="getMaxShowOrder" resultType="java.lang.Integer"> <select id="getMaxShowOrder" resultType="java.lang.Double">
select max(show_order) select max(showOrder)
from jcl_org_dept from hrmdepartment
</select> </select>
<select id="getIdByNameAndPid" resultType="java.lang.Long"> <select id="getIdByNameAndPid" resultType="java.lang.Integer">
select id select id
from jcl_org_dept from hrmdepartment
where delete_type = 0 and dept_name = #{departmentName} where departmentName = #{departmentName}
and parent_comp = #{parentCompany} and subCompanyId1 = #{subCompanyId1}
<include refid="nullParentDepartment"/> and supDepId = #{supDepId}
</select>
<select id="getDepartmentByUUID" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_dept t
where delete_type = 0
and uuid = #{uuid}
</select> </select>
<select id="checkRepeatNo" resultType="java.lang.Integer"> <select id="checkRepeatNo" resultType="java.lang.Integer">
select count(1) select count(1)
from jcl_org_dept t from hrmdepartment t
where t.delete_type = 0 where departmentCode = #{departmentCode}
AND dept_no = #{departmentNo}
<if test=" id != null "> <if test=" id != null ">
and t.id != #{id} and t.id != #{id}
</if> </if>
</select> </select>
<select id="hasSubs" resultType="java.lang.String"> <select id="hasSubs" resultType="java.lang.String">
select distinct parent_dept select distinct supDepId
from jcl_org_dept from hrmdepartment
where forbidden_tag = 0 where 1=1
and delete_type = 0 <include refid="com.engine.organization.mapper.comp.CompMapper.subsWhere"/>
</select> </select>
<select id="countUsedInJob" resultType="java.lang.Integer"> <select id="countUsedInJob" resultType="java.lang.Integer">
select count(1) select count(1)
from jcl_org_job from jcl_org_job
where forbidden_tag = 0 where forbidden_tag = 0
and delete_type = 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> </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"> <sql id="likeSQL">
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' "> <if test=" departmentPO.departmentCode != null and departmentPO.departmentCode != '' ">
and t.dept_no like CONCAT('%',#{departmentPO.deptNo},'%') 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>
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' "> <if test=" departmentPO.departmentName != null and departmentPO.departmentName != '' ">
and t.dept_name_short like CONCAT('%',#{departmentPO.deptNameShort},'%') and t.departmentName like CONCAT('%',#{departmentPO.departmentName},'%')
</if> </if>
</sql> </sql>
<sql id="likeSQL" databaseId="oracle"> <sql id="likeSQL" databaseId="oracle">
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' "> <if test=" departmentPO.departmentCode != null and departmentPO.departmentCode != '' ">
and t.dept_no like '%'||#{departmentPO.deptNo}||'%' and t.departmentCode like '%'||#{departmentPO.departmentCode}||'%'
</if> </if>
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' "> <if test=" departmentPO.departmentName != null and departmentPO.departmentName != '' ">
and t.dept_name like '%'||#{departmentPO.deptName}||'%' and t.departmentName like '%'||#{departmentPO.departmentName}||'%'
</if> </if>
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' "> </sql>
and t.dept_name_short like '%'||#{departmentPO.deptNameShort}||'%' <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> </if>
</sql> </sql>
<sql id="likeSQL" databaseId="sqlserver"> <sql id="likeSQL" databaseId="sqlserver">
<if test=" departmentPO.deptNo != null and departmentPO.deptNo != '' "> <if test=" departmentPO.departmentCode != null and departmentPO.departmentCode != '' ">
and t.dept_no like '%'+#{departmentPO.deptNo}+'%' and t.departmentCode like '%'+#{departmentPO.departmentCode}+'%'
</if>
<if test=" departmentPO.deptName != null and departmentPO.deptName != '' ">
and t.dept_name like '%'+#{departmentPO.deptName}+'%'
</if> </if>
<if test=" departmentPO.deptNameShort != null and departmentPO.deptNameShort != '' "> <if test=" departmentPO.departmentName != null and departmentPO.departmentName != '' ">
and t.dept_name_short like '%'+#{departmentPO.deptNameShort}+'%' and t.departmentName like '%'+#{departmentPO.departmentName}+'%'
</if> </if>
</sql> </sql>
<sql id="nullSql"> <sql id="isCanceled">
and ifnull(parent_dept,'0')='0' <if test=" departmentPO.canceled != null ">
and ifnull(canceled,0)= #{departmentPO.canceled}
</if>
</sql> </sql>
<sql id="isCanceled" databaseId="oracle">
<sql id="nullSql" databaseId="sqlserver"> <if test=" departmentPO.canceled != null">
and isnull(parent_dept,'0')='0' and nvl(canceled,0)= #{departmentPO.canceled}
</if>
</sql> </sql>
<sql id="isCanceled" databaseId="sqlserver">
<sql id="nullSql" databaseId="oracle"> <if test=" departmentPO.canceled != null">
and NVL(parent_dept,'0')='0' 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> </sql>
</mapper> </mapper>

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

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

@ -37,5 +37,5 @@ public interface ExtDTMapper {
* @param mainId * @param mainId
* @return * @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 delete
from ${tableName} from ${tableName}
where mainid = #{mainId} where mainid = #{mainId}
<if test=" null!=groupId ">
and group_id = #{groupId}
</if>
</delete> </delete>
<select id="listCompExtDT" resultType="map"> <select id="listCompExtDT" resultType="map">

@ -37,7 +37,7 @@ public interface ExtendInfoMapper {
int updateExtendGroupId(@Param("groupId") Long groupId, @Param("ids") Collection<Long> ids); 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>

@ -31,7 +31,7 @@ public interface SystemDataMapper {
RecordInfo getHrmJobTitleByName(@Param("name") String name); 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); List<Long> getHrmResourceIdsByDept(@Param("departmentId") String departmentId);
@ -61,4 +61,7 @@ public interface SystemDataMapper {
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="dmlurl" property="dmlUrl"/>
<result column="scopeid" property="scopeId"/> <result column="scopeid" property="scopeId"/>
<result column="tablename" property="tableName"/> <result column="tablename" property="tableName"/>
<!-- <result column="fielddbtype" property="fielddbtype"/>-->
<!-- <result column="fieldorder" property="fieldorder"/>-->
</resultMap> </resultMap>
<resultMap id="SelectItemMap" type="com.engine.organization.entity.jclimport.po.JclSelectItem"> <resultMap id="SelectItemMap" type="com.engine.organization.entity.jclimport.po.JclSelectItem">
@ -165,6 +167,57 @@
#{ecId} #{ecId}
</foreach> </foreach>
</select> </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> </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 org.apache.ibatis.annotations.Param;
import java.sql.Date; import java.sql.Date;
import java.util.List;
/** /**
* @author:dxfeng * @author:dxfeng
@ -26,4 +27,25 @@ public interface JclOrgMapper {
JclOrgMap getSumPlanAndJobByFParentId(@Param("currentDate") Date currentDate, @Param("fparentid") String fparentid); 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); 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 id="updateMapById">
update jcl_org_map update jcl_org_map
<set> <set>
<if test="fplan != null">
fplan=#{fplan}, fplan=#{fplan},
</if>
<if test="fonjob != null">
fonjob=#{fonjob}, fonjob=#{fonjob},
</if>
</set> </set>
where id=#{id} where id=#{id}
AND FDATEBEGIN &lt;= #{currentDate} AND FDATEBEGIN &lt;= #{currentDate}
AND FDATEEND &gt;= #{currentDate} AND FDATEEND &gt;= #{currentDate}
</update> </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> </mapper>

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

@ -12,8 +12,6 @@
<result column="custom" property="custom"/> <result column="custom" property="custom"/>
<result column="creator" property="creator"/> <result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/> <result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap> </resultMap>
@ -29,8 +27,6 @@
, t.custom , t.custom
, t.creator , t.creator
, t.delete_type , t.delete_type
, t.create_time
, t.update_time
</sql> </sql>
@ -110,7 +106,8 @@
</trim> </trim>
</insert> </insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" databaseId="oracle"> <insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO"
databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER"> <selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_CARDACCESS_ID.currval from dual select JCL_ORG_CARDACCESS_ID.currval from dual
</selectKey> </selectKey>
@ -239,6 +236,50 @@
</foreach> </foreach>
</update> </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 id="deleteByIds">
UPDATE jcl_org_cardaccess UPDATE jcl_org_cardaccess
SET delete_type = 1 SET delete_type = 1

@ -1,7 +1,9 @@
package com.engine.organization.mapper.personnelcard; package com.engine.organization.mapper.personnelcard;
import com.engine.organization.entity.personnelcard.po.CardButtonPO; import com.engine.organization.entity.personnelcard.po.CardButtonPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List; import java.util.List;
/** /**
@ -16,4 +18,10 @@ public interface CardButtonMapper {
List<CardButtonPO> listEnableButton(); 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="url" property="url"/>
<result column="roles" property="roles"/> <result column="roles" property="roles"/>
<result column="sys_default" property="sysDefault"/> <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="creator" property="creator"/>
<result column="delete_type" property="deleteType"/> <result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap> </resultMap>
@ -25,21 +25,40 @@
, t.url , t.url
, t.roles , t.roles
, t.sys_default , t.sys_default
, t.show_order
, t.open_type
, t.creator , t.creator
, t.delete_type , t.delete_type
, t.create_time
, t.update_time
</sql> </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 id="listAll" resultType="com.engine.organization.entity.personnelcard.po.CardButtonPO">
select select
<include refid="baseColumns"/> <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>
<select id="listEnableButton" resultType="com.engine.organization.entity.personnelcard.po.CardButtonPO"> <select id="listEnableButton" resultType="com.engine.organization.entity.personnelcard.po.CardButtonPO">
select select
<include refid="baseColumns"/> <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> </select>
</mapper> </mapper>

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

@ -3,12 +3,12 @@
<mapper namespace="com.engine.organization.mapper.personnelcard.PersonnelCardMapper"> <mapper namespace="com.engine.organization.mapper.personnelcard.PersonnelCardMapper">
<resultMap id="UserMap" type="com.engine.organization.entity.personnelcard.UserCard"> <resultMap id="UserMap" type="com.engine.organization.entity.personnelcard.UserCard">
<result column="id" property="id"/> <result column="id" property="id"/>
<result column="resource_image_id" property="image"/> <result column="resourceimageid" property="image"/>
<result column="last_name" property="name"/> <result column="lastname" property="name"/>
<result column="sex" property="sex"/> <result column="sex" property="sex"/>
<result column="email" property="email"/> <result column="email" property="email"/>
<result column="mobile" property="phone"/> <result column="mobile" property="phone"/>
<result column="belong_to" property="belongTo"/> <result column="accounttype" property="accountType"/>
<result column="status" property="status"/> <result column="status" property="status"/>
</resultMap> </resultMap>
@ -25,17 +25,26 @@
<result column="tabnum" property="tabNum"/> <result column="tabnum" property="tabNum"/>
</resultMap> </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="getUserById" resultMap="UserMap">
select id, select id,
resource_image_id, resourceimageid,
last_name, lastname,
sex, sex,
email, email,
mobile, mobile,
belong_to, accounttype,
status status
from jcl_org_hrmresource from hrmresource
where id = #{id} where id = #{id}
</select> </select>
@ -45,4 +54,12 @@
where isopen = 1 where isopen = 1
order by dsporder order by dsporder
</select> </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> </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>

@ -21,9 +21,22 @@ public interface ResourceMapper {
List<HrmResourcePO> getResourceListByJobId(@Param("jobId") Long jobId); 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); HrmResourcePO getResourceById(@Param("id") String id);
List<HrmResourcePO> listByNo(@Param("workCode") String workCode); 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