diff --git a/docs/表结构SQL/MySQL.sql b/docs/表结构SQL/MySQL.sql index 67473587..3f4162b0 100644 --- a/docs/表结构SQL/MySQL.sql +++ b/docs/表结构SQL/MySQL.sql @@ -127,14 +127,14 @@ CREATE TABLE JCL_FIELD_EXTENDINFO ( field_name_desc varchar(100) NULL, field_type varchar(1000) NULL, control_type int null, - extend_group int null, + extend_group_id int null, isenable int null, isrequired int null, list_show int null, search_show int null, edit_show int null, add_show int null, - button_show int null, + browser_show int null, show_order int null, creator int null, delete_type int null, @@ -339,12 +339,12 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 ( -- JCL_ORG_STAFFPLAN CREATE TABLE JCL_ORG_STAFFPLAN ( id int auto_increment NOT NULL, - staffplan_no varchar(100) NULL, - staffplan_name varchar(100) NULL, - staffplan_year varchar(100) NULL, + plan_no varchar(100) NULL, + plan_name varchar(100) NULL, + plan_year varchar(100) NULL, time_start date NULL, time_end date NULL, - apply_company int NULL, + company_id varchar(100) NULL, description text NULL, status int NULL, creator int null, @@ -357,17 +357,17 @@ CREATE TABLE JCL_ORG_STAFFPLAN ( -- JCL_ORG_STAFF CREATE TABLE JCL_ORG_STAFF ( id int auto_increment NOT NULL, - scheme_id int null, - comp int null, - dept int null, - job int null, + plan_id int null, + comp_id int null, + dept_id int null, + job_id int null, staff_num int null, control_policy int null, staff_permanent_num int null, freeze_num int null, lack_status int null, staff_description varchar(100) NULL, - instruction text null, + description text null, creator int null, delete_type int null, create_time date null, diff --git a/docs/表结构SQL/Oracle.sql b/docs/表结构SQL/Oracle.sql index 4f6f4b75..e8718031 100644 --- a/docs/表结构SQL/Oracle.sql +++ b/docs/表结构SQL/Oracle.sql @@ -129,14 +129,14 @@ CREATE TABLE JCL_FIELD_EXTENDINFO ( FIELD_NAME_DESC NVARCHAR2(100) NULL, FIELD_TYPE NVARCHAR2(1000) NULL, CONTROL_TYPE NUMBER NULL, - EXTEND_GROUP NUMBER NULL, + EXTEND_GROUP_ID NUMBER NULL, ISENABLE NUMBER NULL, ISREQUIRED NUMBER NULL, LIST_SHOW NUMBER NULL, SEARCH_SHOW NUMBER NULL, EDIT_SHOW NUMBER NULL, ADD_SHOW NUMBER NULL, - BUTTON_SHOW NUMBER NULL, + BROWSER_SHOW NUMBER NULL, SHOW_ORDER NUMBER NULL, CREATOR NUMBER NULL, DELETE_TYPE NUMBER NULL, @@ -340,12 +340,12 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 ( -- JCL_ORG_STAFFPLAN CREATE TABLE JCL_ORG_STAFFPLAN ( ID NUMBER NOT NULL, - STAFFPLAN_NO NVARCHAR2(100) NULL, - STAFFPLAN_NAME NVARCHAR2(100) NULL, - STAFFPLAN_YEAR NVARCHAR2(100) NULL, + PLAN_NO NVARCHAR2(100) NULL, + PLAN_NAME NVARCHAR2(100) NULL, + PLAN_YEAR NVARCHAR2(100) NULL, TIME_START DATE NULL, TIME_END DATE NULL, - APPLY_COMPANY NUMBER NULL, + COMPANY_ID NVARCHAR2(100) NULL, DESCRIPTION NVARCHAR2(1000) NULL, STATUS NUMBER NULL, CREATOR NUMBER NULL, @@ -358,17 +358,17 @@ CREATE TABLE JCL_ORG_STAFFPLAN ( -- JCL_ORG_STAFF CREATE TABLE JCL_ORG_STAFF ( ID NUMBER NOT NULL, - SCHEME_ID NUMBER NULL, - COMP NUMBER NULL, - DEPT NUMBER NULL, - JOB NUMBER NULL, + PLAN_ID NUMBER NULL, + COMP_ID NUMBER NULL, + DEPT_ID NUMBER NULL, + JOB_ID NUMBER NULL, STAFF_NUM NUMBER NULL, CONTROL_POLICY NUMBER NULL, STAFF_PERMANENT_NUM NUMBER NULL, FREEZE_NUM NUMBER NULL, LACK_STATUS NUMBER NULL, STAFF_DESCRIPTION NVARCHAR2(100) NULL, - INSTRUCTION NVARCHAR2(1000) NULL, + DESCRIPTION NVARCHAR2(1000) NULL, CREATOR NUMBER NULL, DELETE_TYPE NUMBER NULL, CREATE_TIME DATE NULL, diff --git a/docs/表结构SQL/SqlServer.sql b/docs/表结构SQL/SqlServer.sql index a07f5514..6b740ca7 100644 --- a/docs/表结构SQL/SqlServer.sql +++ b/docs/表结构SQL/SqlServer.sql @@ -127,14 +127,14 @@ CREATE TABLE JCL_FIELD_EXTENDINFO ( field_name_desc varchar(100) COLLATE Chinese_PRC_CI_AS NULL, field_type varchar(1000) COLLATE Chinese_PRC_CI_AS NULL, control_type int null, - extend_group int null, + extend_group_id int null, isenable int null, isrequired int null, list_show int null, search_show int null, edit_show int null, add_show int null, - button_show int null, + browser_show int null, show_order int null, creator int null, delete_type int null, @@ -339,12 +339,12 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 ( -- JCL_ORG_STAFFPLAN CREATE TABLE JCL_ORG_STAFFPLAN ( id int IDENTITY(1,1) NOT NULL, - staffplan_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL, - staffplan_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, - staffplan_year varchar(100) COLLATE Chinese_PRC_CI_AS NULL, + plan_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL, + plan_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, + plan_year varchar(100) COLLATE Chinese_PRC_CI_AS NULL, time_start date NULL, time_end date NULL, - apply_company int NULL, + company_id varchar(100) COLLATE Chinese_PRC_CI_AS NULL, description text NULL, status int NULL, creator int null, @@ -357,17 +357,17 @@ CREATE TABLE JCL_ORG_STAFFPLAN ( -- JCL_ORG_STAFF CREATE TABLE JCL_ORG_STAFF ( id int IDENTITY(1,1) NOT NULL, - scheme_id int null, - comp int null, - dept int null, - job int null, + plan_id int null, + comp_id int null, + dept_id int null, + job_id int null, staff_num int null, control_policy int null, staff_permanent_num int null, freeze_num int null, lack_status int null, staff_description varchar(100) COLLATE Chinese_PRC_CI_AS NULL, - instruction text null, + description text null, creator int null, delete_type int null, create_time date null, diff --git a/src/com/api/organization/web/DepartmentController.java b/src/com/api/organization/web/DepartmentController.java new file mode 100644 index 00000000..b79f621a --- /dev/null +++ b/src/com/api/organization/web/DepartmentController.java @@ -0,0 +1,13 @@ +package com.api.organization.web; + +import javax.ws.rs.Path; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/20 + * @Version V1.0 + **/ +@Path("/bs/hrmorganization/dept") +public class DepartmentController extends com.engine.organization.web.DepartmentController { +} diff --git a/src/com/engine/organization/entity/comp/bo/CompBO.java b/src/com/engine/organization/entity/comp/bo/CompBO.java index 02c59c37..4b70dbf7 100644 --- a/src/com/engine/organization/entity/comp/bo/CompBO.java +++ b/src/com/engine/organization/entity/comp/bo/CompBO.java @@ -1,13 +1,14 @@ package com.engine.organization.entity.comp.bo; import com.engine.organization.entity.comp.dto.CompListDTO; +import com.engine.organization.entity.comp.param.CompSearchParam; import com.engine.organization.entity.comp.po.CompPO; import org.apache.commons.collections.CollectionUtils; +import weaver.crm.Maint.SectorInfoComInfo; +import weaver.general.StringUtil; +import weaver.hrm.resource.ResourceComInfo; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -17,28 +18,113 @@ import java.util.stream.Collectors; * @version: 1.0 */ public class CompBO { + public static List buildCompDTOList(Collection list) { - if (CollectionUtils.isEmpty(list)) { + + // 递归添加父级数据 + Map poMaps = list.stream().collect(Collectors.toMap(item -> item.getId(), item -> item)); + + + List dtoList = list.stream().map(e -> CompListDTO.builder() + .id(e.getId()) + .compNo(e.getCompNo()) + .compName(e.getCompName()) + .compNameShort(e.getCompNameShort()) + .parentCompany(e.getParentCompany()) + .parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName()) + .orgCode(e.getOrgCode()) + .industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + "")) + .compPrincipal(getUserNameById(e.getCompPrincipal() + "")) + .forbiddenTag(e.getForbiddenTag()) + .build() + ).collect(Collectors.toList()); + Map> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany)); + return dtoList.stream().map(e -> { + e.setChildren(collects.get(e.getId())); + return e; + }).filter(item -> null == item.getParentCompany() || 0 == item.getParentCompany()).collect(Collectors.toList()); + } + + public static List buildCompDTOList(Collection list, List filterList) { + // 搜索结果为空,直接返回空 + if (CollectionUtils.isEmpty(filterList)) { return Collections.emptyList(); } - List dtoList = list.stream().map(e -> CompListDTO.builder() + // 递归添加父级数据 + Map poMaps = list.stream().collect(Collectors.toMap(item -> item.getId(), item -> item)); + List addedList = new ArrayList<>(); + for (CompPO po : filterList) { + dealParentData(addedList, po, poMaps); + } + + List dtoList = addedList.stream().map(e -> CompListDTO.builder() .id(e.getId()) .compNo(e.getCompNo()) .compName(e.getCompName()) .compNameShort(e.getCompNameShort()) .parentCompany(e.getParentCompany()) + .parentCompName(null == poMaps.get(e.getParentCompany()) ? "" : poMaps.get(e.getParentCompany()).getCompName()) .orgCode(e.getOrgCode()) - .industry(e.getIndustry()) - .compPrincipal(e.getCompPrincipal()) - .description(e.getDescription()) + .industry(new SectorInfoComInfo().getSectorInfoname(e.getIndustry() + "")) + .compPrincipal(getUserNameById(e.getCompPrincipal() + "")) .forbiddenTag(e.getForbiddenTag()) .build() ).collect(Collectors.toList()); Map> collects = dtoList.stream().filter(item -> null != item.getParentCompany() && 0 != item.getParentCompany()).collect(Collectors.groupingBy(CompListDTO::getParentCompany)); - return dtoList.stream().filter(item -> null == item.getParentCompany() || 0 == item.getParentCompany()).map(e -> { + return dtoList.stream().map(e -> { e.setChildren(collects.get(e.getId())); return e; - }).collect(Collectors.toList()); + }).filter(item -> null == item.getParentCompany() || 0 == item.getParentCompany()).collect(Collectors.toList()); + } + + 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()) + .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(); + + } + + /** + * 递归获取查询后数据的父级数据 + * + * @param addedList + * @param po + * @param poMaps + */ + private static void dealParentData(List addedList, CompPO po, Map poMaps) { + if (!addedList.contains(po)) { + addedList.add(po); + } + CompPO parentCompPO = poMaps.get(po.getParentCompany()); + if (null != parentCompPO) { + dealParentData(addedList, parentCompPO, poMaps); + } } + private static String getUserNameById(String userId) { + try { + if (StringUtil.isEmpty(userId)) { + return ""; + } + return new ResourceComInfo().getLastname(userId); + } catch (Exception e) { + throw new RuntimeException(e); + } + } } diff --git a/src/com/engine/organization/entity/comp/dto/CompListDTO.java b/src/com/engine/organization/entity/comp/dto/CompListDTO.java index b7f8b2ee..1c1892b0 100644 --- a/src/com/engine/organization/entity/comp/dto/CompListDTO.java +++ b/src/com/engine/organization/entity/comp/dto/CompListDTO.java @@ -33,21 +33,20 @@ public class CompListDTO { /** * 主键id */ - @TableTitle(title = "id", dataIndex = "id", key = "id") private Long id; - /** - * 编号 - */ - @TableTitle(title = "编号", dataIndex = "compNo", key = "compNo") - private String compNo; - /** * 名称 */ @TableTitle(title = "名称", dataIndex = "compName", key = "compName") private String compName; + /** + * 编号 + */ + @TableTitle(title = "编号", dataIndex = "compNo", key = "compNo") + private String compNo; + /** * 简称 */ @@ -57,7 +56,9 @@ public class CompListDTO { /** * 上级公司 */ - @TableTitle(title = "上级公司", dataIndex = "parentCompany", key = "parentCompany") + @TableTitle(title = "上级公司", dataIndex = "parentCompName", key = "parentCompName") + private String parentCompName; + private Long parentCompany; /** @@ -70,25 +71,25 @@ public class CompListDTO { * 行业 */ @TableTitle(title = "行业", dataIndex = "industry", key = "industry") - private Integer industry; + private String industry; /** * 负责人 */ @TableTitle(title = "负责人", dataIndex = "compPrincipal", key = "compPrincipal") - private Integer compPrincipal; + private String compPrincipal; /** - * 说明 + * 禁用标记 */ - @TableTitle(title = "说明", dataIndex = "description", key = "description") - private String description; + @TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag") + private int forbiddenTag; /** - * 禁用标记 + * 操作列 */ - @TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag") - private String forbiddenTag; + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; /** * 子节点 diff --git a/src/com/engine/organization/entity/comp/param/CompSearchParam.java b/src/com/engine/organization/entity/comp/param/CompSearchParam.java new file mode 100644 index 00000000..0010a515 --- /dev/null +++ b/src/com/engine/organization/entity/comp/param/CompSearchParam.java @@ -0,0 +1,70 @@ +package com.engine.organization.entity.comp.param; + +import com.engine.organization.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @description: TODO + * @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 String orgCode; + + /** + * 行业 + */ + private Integer industry; + + /** + * 负责人 + */ + private Integer compPrincipal; + + /** + * 说明 + */ + private String description; + + /** + * 禁用标记 + */ + private Boolean forbiddenTag; +} diff --git a/src/com/engine/organization/entity/comp/po/CompPO.java b/src/com/engine/organization/entity/comp/po/CompPO.java index c76234fa..671b17fe 100644 --- a/src/com/engine/organization/entity/comp/po/CompPO.java +++ b/src/com/engine/organization/entity/comp/po/CompPO.java @@ -18,16 +18,57 @@ import java.util.Date; @AllArgsConstructor @NoArgsConstructor public class CompPO { + + /** + * 主键 + */ private Long id; + + /** + * 编号 + */ private String compNo; + + /** + * 名称 + */ private String compName; + + /** + * 简称 + */ private String compNameShort; + + /** + * 上级公司 + */ private Long parentCompany; + + /** + * 组织机构代码 + */ private String orgCode; + + /** + * 行业 + */ private Integer industry; + + /** + * 负责人 + */ private Integer compPrincipal; + + /** + * 说明 + */ private String description; - private String forbiddenTag; + + /** + * 禁用标记 + */ + private Integer forbiddenTag; + private Long creator; private int deleteType; private Date createTime; diff --git a/src/com/engine/organization/entity/department/bo/DepartmentBO.java b/src/com/engine/organization/entity/department/bo/DepartmentBO.java new file mode 100644 index 00000000..18fced97 --- /dev/null +++ b/src/com/engine/organization/entity/department/bo/DepartmentBO.java @@ -0,0 +1,130 @@ +package com.engine.organization.entity.department.bo; + +import com.engine.organization.entity.department.dto.DepartmentListDTO; +import com.engine.organization.entity.department.param.DeptSearchParam; +import com.engine.organization.entity.department.po.DepartmentPO; +import com.engine.organization.entity.department.vo.SingleDeptTreeVO; +import com.engine.organization.mapper.department.DepartmentMapper; +import com.engine.organization.mapper.employee.EmployeeMapper; +import com.engine.organization.util.db.MapperProxyFactory; +import org.apache.commons.collections.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/20 + * @Version V1.0 + **/ +public class DepartmentBO { + + public static List buildDeptDTOList(Collection list, List filterList) { + // 搜索结果为空,直接返回空 + if (CollectionUtils.isEmpty(filterList)) { + return Collections.emptyList(); + } + // 递归添加父级数据 + Map poMaps = list.stream().collect(Collectors.toMap(item -> item.getId(), item -> item)); + List addedList = new ArrayList<>(); + for (DepartmentPO po : filterList) { + dealParentData(addedList, po, poMaps); + } + + List dtoList = addedList.stream().map(e -> DepartmentListDTO.builder() + .id(e.getId()) + .deptNo(e.getDeptNo()) + .deptName(e.getDeptName()) + .deptNameShort(e.getDeptNameShort()) + .parentComp(e.getParentComp() + "")// 命名 + .parentDept(e.getParentDept()) + .parentDeptName(null == poMaps.get(e.getParentDept()) ? "" : poMaps.get(e.getParentDept()).getDeptName()) + .deptPrincipal(getEmployeeNameById((long) e.getDeptPrincipal())) + .showOrder(e.getShowOrder()) + .forbiddenTag(e.getForbiddenTag()) + .build() + ).collect(Collectors.toList()); + Map> collects = dtoList.stream().filter(item -> null != item.getParentDept() && 0 != item.getParentDept()).collect(Collectors.groupingBy(DepartmentListDTO::getParentDept)); + return dtoList.stream().map(e -> { + e.setChildren(collects.get(e.getId())); + return e; + }).filter(item -> null == item.getParentDept() || 0 == item.getParentDept()).collect(Collectors.toList()); + } + + public static DepartmentPO convertParamsToPO(DeptSearchParam param, Long employeeId) { + if (null == param) { + return null; + } + return DepartmentPO.builder() + .id(param.getId() == null ? 0 : param.getId()) + .deptNo(param.getDeptNo()) + .deptName(param.getDeptName()) + .deptNameShort(param.getDeptNameShort()) + .parentComp(param.getParentComp()) + .parentDept(param.getParentDept()) + .deptPrincipal(param.getDeptPrincipal()) + .showOrder(param.getShowOrder()) + .forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1) + .deleteType(0) + .createTime(new Date()) + .updateTime(new Date()) + .creator(employeeId).build(); + } + + public static List buildSingleDeptTreeVOS(List departmentPOs,Long parentComp) { + + if (CollectionUtils.isEmpty(departmentPOs)) { + return Collections.emptyList(); + } + + List singleDeptTreeVOS = departmentPOs.stream().map(e -> SingleDeptTreeVO.builder() + .id(e.getId()) + .deptName(e.getDeptName()) + .parentComp(e.getParentComp()) + .parentDept(e.getParentDept()) + .parentDeptName(e.getParentDept() == null ? "" : getDeptNameById(e.getParentDept().intValue())) + .deptPrincipalName(getEmployeeNameById((long) e.getDeptPrincipal())) + .build() + ).collect(Collectors.toList()); + //获取非一级部门 + Map> collects = singleDeptTreeVOS.stream().filter(item -> !parentComp.equals(item.getParentComp()) && null != item.getParentDept()).collect(Collectors.groupingBy(SingleDeptTreeVO :: getParentDept)); + + return singleDeptTreeVOS.stream().map(e -> { + e.setChildren(collects.get(e.getId())); + return e; + }).filter(item -> parentComp.equals(item.getParentComp())).collect(Collectors.toList()); + + } + + + public static String getDeptNameById(Integer id) { + return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(id); + } + + public static String getEmployeeNameById(Long id) { + return MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(id); + } + + + /** + * 递归获取查询后数据的父级数据 + * + * @param addedList + * @param po + * @param poMaps + */ + private static void dealParentData(List addedList, DepartmentPO po, Map poMaps) { + if (!addedList.contains(po)) { + addedList.add(po); + } + DepartmentPO parentPO = poMaps.get(po.getParentDept()); + if (null != parentPO) { + dealParentData(addedList, parentPO, poMaps); + } + } + + + + +} diff --git a/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java new file mode 100644 index 00000000..1731a5da --- /dev/null +++ b/src/com/engine/organization/entity/department/dto/DepartmentListDTO.java @@ -0,0 +1,98 @@ +package com.engine.organization.entity.department.dto; + +import com.cloudstore.eccom.pc.table.WeaTableType; +import com.engine.organization.annotation.OrganizationTable; +import com.engine.organization.annotation.OrganizationTableOperate; +import com.engine.organization.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/19 + * @Version V1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@OrganizationTable(pageId = "96f2bb0d-da73-11ec-a0da-00ffcbed7508", + tableType = WeaTableType.NONE, + operates = { + @OrganizationTableOperate(index = "0", text = "编辑"), + @OrganizationTableOperate(index = "1", text = "删除"), + @OrganizationTableOperate(index = "2", text = "合并"), + @OrganizationTableOperate(index = "3", text = "转移"), + @OrganizationTableOperate(index = "4", text = "联查岗位"), + @OrganizationTableOperate(index = "4", text = "联查人员") + }) +public class DepartmentListDTO { + + private Long id; + + /** + * 编号 + */ + @TableTitle(title = "编号", dataIndex = "deptNo", key = "deptNo") + private String deptNo; + + /** + * 名称 + */ + @TableTitle(title = "名称", dataIndex = "deptName", key = "deptName") + private String deptName; + + /** + * 简称 + */ + @TableTitle(title = "简称", dataIndex = "deptNameShort", key = "deptNameShort") + private String deptNameShort; + + /** + * 所属分部 + */ + @TableTitle(title = "所属分部", dataIndex = "parentComp", key = "parentComp") + private String parentComp; + + /** + * 上级部门 + */ + @TableTitle(title = "上级部门", dataIndex = "parentDeptName", key = "parentDeptName") + private String parentDeptName; + + private Long parentDept; + + /** + * 部门负责人 + */ + @TableTitle(title = "部门负责人", dataIndex = "deptPrincipal", key = "deptPrincipal") + private String deptPrincipal; + + /** + * 显示顺序 + */ + @TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder") + private int showOrder; + + /** + * 说明 + */ + @TableTitle(title = "说明", dataIndex = "description", key = "description") + private String description; + + /** + * 禁用标记 + */ + @TableTitle(title = "禁用标记", dataIndex = "forbiddenTag", key = "forbiddenTag") + private int forbiddenTag; + + /** + * 子节点 + */ + private List children; +} diff --git a/src/com/engine/organization/entity/department/param/DeptSearchParam.java b/src/com/engine/organization/entity/department/param/DeptSearchParam.java new file mode 100644 index 00000000..75004134 --- /dev/null +++ b/src/com/engine/organization/entity/department/param/DeptSearchParam.java @@ -0,0 +1,37 @@ +package com.engine.organization.entity.department.param; + +import com.engine.organization.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/23 + * @version: 1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DeptSearchParam extends BaseQueryParam { + private Long id; + + private String deptNo; + + private String deptName; + + private String deptNameShort; + + private Long parentComp; + + private Long parentDept; + + private Integer deptPrincipal; + + private Integer showOrder; + + private Boolean forbiddenTag; +} diff --git a/src/com/engine/organization/entity/department/param/QuerySingleDeptListParam.java b/src/com/engine/organization/entity/department/param/QuerySingleDeptListParam.java new file mode 100644 index 00000000..aee890e3 --- /dev/null +++ b/src/com/engine/organization/entity/department/param/QuerySingleDeptListParam.java @@ -0,0 +1,23 @@ +package com.engine.organization.entity.department.param; + +import com.engine.organization.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/20 + * @Version V1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class QuerySingleDeptListParam extends BaseQueryParam { + + private Long parentComp; + +} diff --git a/src/com/engine/organization/entity/department/po/DepartmentPO.java b/src/com/engine/organization/entity/department/po/DepartmentPO.java new file mode 100644 index 00000000..512b0367 --- /dev/null +++ b/src/com/engine/organization/entity/department/po/DepartmentPO.java @@ -0,0 +1,49 @@ +package com.engine.organization.entity.department.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/19 + * @Version V1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class DepartmentPO { + + private Long id; + + private String deptNo; + + private String deptName; + + private String deptNameShort; + + private Long parentComp; + + private Long parentDept; + + private Integer deptPrincipal; //部门负责人 + + private Integer showOrder; + + private String description; + + private Integer forbiddenTag; + + private Long creator; + + private int deleteType; + + private Date createTime; + + private Date updateTime; +} diff --git a/src/com/engine/organization/entity/department/vo/SingleDeptTreeVO.java b/src/com/engine/organization/entity/department/vo/SingleDeptTreeVO.java new file mode 100644 index 00000000..c1536203 --- /dev/null +++ b/src/com/engine/organization/entity/department/vo/SingleDeptTreeVO.java @@ -0,0 +1,47 @@ +package com.engine.organization.entity.department.vo; + +import com.cloudstore.eccom.pc.table.WeaTableType; +import com.engine.organization.annotation.OrganizationTable; +import com.engine.organization.annotation.TableTitle; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/20 + * @Version V1.0 + **/ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@OrganizationTable(pageId = "01b397a9-638b-4d58-89c7-4a1d17f98656", + tableType = WeaTableType.NONE) +public class SingleDeptTreeVO { + + private Long id; + + @TableTitle(title = "部门名称", dataIndex = "deptName", key = "deptName") + private String deptName; + + private Long parentComp; //上级分部 + + private Long parentDept; //上级部门id + + @TableTitle(title = "上级部门", dataIndex = "parentDeptName", key = "parentDeptName") + private String parentDeptName; //上级部门 + + @TableTitle(title = "部门负责人", dataIndex = "deptPrincipalName", key = "deptPrincipalName") + private String deptPrincipalName; //部门负责人 + + //子节点 + private List children; + + + +} diff --git a/src/com/engine/organization/entity/employee/Employee.java b/src/com/engine/organization/entity/employee/Employee.java new file mode 100644 index 00000000..d64979c6 --- /dev/null +++ b/src/com/engine/organization/entity/employee/Employee.java @@ -0,0 +1,28 @@ +package com.engine.organization.entity.employee; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/20 + * @Version V1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class Employee { + + private Long employeeId; + + private String username; + + private Long departmentId; + + //.... + +} diff --git a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java new file mode 100644 index 00000000..479fcc67 --- /dev/null +++ b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java @@ -0,0 +1,418 @@ +package com.engine.organization.entity.extend.bo; + +import com.api.browser.bean.BrowserBean; +import com.api.browser.bean.BrowserValueInfo; +import com.api.browser.bean.SearchConditionItem; +import com.api.browser.service.BrowserValueInfoService; +import com.api.browser.util.BrowserInitUtil; +import com.api.browser.util.ConditionFactory; +import com.api.browser.util.ConditionType; +import com.api.hrm.bean.FieldItem; +import com.api.hrm.util.FieldType; +import com.api.hrm.util.ServiceUtil; +import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit; +import com.engine.organization.entity.extend.po.ExtendInfoPO; +import com.engine.organization.util.OrganizationFormItemUtil; +import com.engine.sensitive.biz.SensitiveWordTypeComInfo; +import weaver.file.ImageFileManager; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.definedfield.HrmFieldManager; +import weaver.systeminfo.SystemEnv; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/19 + * @version: 1.0 + */ +public class ExtendInfoBO { + + public static String DATE_SELECT = "select"; + public static String DATE_FROM = "from"; + public static String DATE_TO = "to"; + public static String DATE_Time_FROM = "_start"; + public static String DATE_Time_TO = "_end"; + + // 封装对象为table组件 + public static List> convertInfoListToTable(User user, List infoPOList, int viewAttr, boolean showLabel) { + List> lsCol = new ArrayList>(); + Map col = null; + + int width = 100 / infoPOList.size(); + for (int i = 0; infoPOList != null && i < infoPOList.size(); i++) { + ExtendInfoPO extendInfoPO = infoPOList.get(i); + String tmpkey = extendInfoPO.getFieldName(); + col = new HashMap(); + col.put("title", extendInfoPO.getFieldNameDesc()); + + col.put("key", tmpkey); + col.put("dataIndex", tmpkey); + col.put("com", getFieldDetialInfo(user, extendInfoPO, viewAttr, showLabel, width)); + + col.put("width", width + "%"); + + lsCol.add(col); + } + return lsCol; + + } + + + /** + * 明细表字段 + * + * @param user + * @param extendInfoPO + * @param viewAttr + * @return + */ + private static List getFieldDetialInfo(User user, ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) { + List ls = new ArrayList(); + FieldItem fieldItem = createField(user, extendInfoPO, viewAttr, showLabel, width); + ls.add(fieldItem); + return ls; + } + + /** + * 创建列表字段信息 + * + * @param user + * @param extendInfoPO + * @param viewAttr + * @param showLabel + * @param width + * @return + */ + private static FieldItem createField(User user, ExtendInfoPO extendInfoPO, int viewAttr, boolean showLabel, int width) { + FieldItem fieldItem = new FieldItem(); + if (showLabel) { + fieldItem.setLabel(extendInfoPO.getFieldNameDesc()); + } else { + fieldItem.setLabel(""); + } + + fieldItem.setType(getFieldhtmltype(extendInfoPO.getControlType() + "")); + fieldItem.setKey(extendInfoPO.getFieldName()); + // 查看操作 全部设置为只读 + if (1 == viewAttr) { + fieldItem.setViewAttr(viewAttr); + } else { + // 必填 + if (1 == extendInfoPO.getIsrequired()) { + fieldItem.setViewAttr(3); + fieldItem.setRules("required|string"); + } else { + fieldItem.setViewAttr(2); + } + } + + // 浏览按钮特殊处理 + if (FieldType.BROWSER.equals(fieldItem.getType())) { + BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), "").getBrowserConditionParam(); + fieldItem.setBrowserConditionParam(browserConditionParam); + } + + fieldItem.setWidth(width + "%"); + return fieldItem; + } + + /** + * 获取对应的控件类型 + * + * @param fieldhtmltype + * @return + */ + private static FieldType getFieldhtmltype(String fieldhtmltype) { + FieldType fieldtype = null; + if (fieldhtmltype.equals("1")) { + fieldtype = FieldType.INPUT; + } else if (fieldhtmltype.equals("2")) { + fieldtype = FieldType.TEXTAREA; + } else if (fieldhtmltype.equals("3")) { + fieldtype = FieldType.BROWSER; + } else if (fieldhtmltype.equals("4")) { + fieldtype = FieldType.CHECKBOX; + } else if (fieldhtmltype.equals("5")) { + fieldtype = FieldType.SELECT; + } else if (fieldhtmltype.equals("6")) { + fieldtype = FieldType.FILEUPLOAD; + } else if (fieldhtmltype.equals("7")) { + fieldtype = FieldType.TEXT; + } + return fieldtype; + } + + + public static SearchConditionItem getSearchConditionItem(User user, int viewAttr, ExtendInfoPO extendInfoPO, Object fieldvalue) { + SearchConditionItem searchConditionItem = null; + try { + if (user == null) { + user = new User(); + user.setLanguage(7); + } + ConditionFactory conditionFactory = new ConditionFactory(user); + HrmFieldManager hrmFieldManager = new HrmFieldManager(); + String fieldid = Util.null2String(extendInfoPO.getId());//字段id + String fieldname = Util.null2String(extendInfoPO.getFieldName());//字段名 + String fieldlabel = Util.null2String(extendInfoPO.getFieldNameDesc());//字段显示名 + String fieldhtmltype = Util.null2String(extendInfoPO.getControlType());//字段类型 + String detailtype = Util.null2String(extendInfoPO.getBrowserType());//字段二级类型(浏览框--单人力) + String dmlurl = Util.null2String(""); + boolean isQuickSearch = true; + boolean isScope = false; + + if (fieldhtmltype.equals("1")) {//单行文本框 + if (isScope) {//范围 + if (Util.null2String(fieldvalue).length() == 0) { + fieldvalue = new HashMap(); + } + searchConditionItem = conditionFactory.createCondition(ConditionType.SCOPE, fieldlabel, new String[]{fieldname, fieldname + "to"}); + } else if (detailtype.equals("2")) {//数字 + searchConditionItem = conditionFactory.createCondition(ConditionType.INPUTNUMBER, fieldlabel, fieldname, isQuickSearch); + } else { + searchConditionItem = conditionFactory.createCondition(ConditionType.INPUT, fieldlabel, fieldname, isQuickSearch); + } + } else if (fieldhtmltype.equals("2")) {//多行文本框 + searchConditionItem = conditionFactory.createCondition(ConditionType.TEXTAREA, fieldlabel, fieldname); + } else if (fieldhtmltype.equals("3")) {//浏览按钮 + if (detailtype.equals("2")) { + if (!extendInfoPO.getTableName().toLowerCase().contains("_dt")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.DATEPICKER, fieldlabel, fieldname); + } else { + searchConditionItem = conditionFactory.createCondition(ConditionType.DATE, fieldlabel, fieldname, detailtype); + searchConditionItem.setDomkey(new String[]{fieldname + DATE_SELECT, fieldname + DATE_FROM, fieldname + DATE_TO}); + searchConditionItem.setOptions(ServiceUtil.getDateSelectFromTo(user.getLanguage())); + } + } else if (detailtype.equals("19")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.TIMEPICKER, fieldlabel, fieldname, detailtype); + } else if (detailtype.equals("402")) { // 年 + searchConditionItem = conditionFactory.createCondition(ConditionType.DATEPICKER, fieldlabel, fieldname, detailtype); + searchConditionItem.setFormat("yyyy"); + searchConditionItem.setMode("year"); + searchConditionItem.setPlaceholder(SystemEnv.getHtmlLabelNames("526306", user.getLanguage())); + searchConditionItem.setShowTime(false); + } else if (detailtype.equals("403")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.DATEPICKER, fieldlabel, fieldname, detailtype); + searchConditionItem.setFormat("yyyy-MM"); + searchConditionItem.setMode("month"); + searchConditionItem.setPlaceholder(SystemEnv.getHtmlLabelNames("126137", user.getLanguage())); + searchConditionItem.setShowTime(false); + } else if (detailtype.equals("RANGEPICKER")) {//日期区间 + String[] domkey = new String[]{DATE_FROM + fieldname, DATE_TO + fieldname}; + searchConditionItem = conditionFactory.createCondition(ConditionType.RANGEPICKER, fieldlabel, domkey); + searchConditionItem.setValue(fieldvalue); + } else if (detailtype.equals("TIMERANGEPICKER")) {//时间区间 + String[] domkey = new String[]{fieldname + DATE_Time_FROM, fieldname + DATE_Time_TO}; + searchConditionItem = conditionFactory.createCondition(ConditionType.TIMERANGEPICKER, fieldlabel, domkey); + searchConditionItem.setValue(fieldvalue); + } else { + //if (detailtype.equals("161") || detailtype.equals("162") || detailtype.equals("256") || detailtype.equals("257")) { + // BrowserBean browserbean = new BrowserBean(detailtype + ""); + // BrowserInitUtil browserInitUtil = new BrowserInitUtil(); + // String fielddbtype = dmlurl; + // if (!dmlurl.startsWith("browser.")) { + // fielddbtype = "browser." + dmlurl; + // } + // if (detailtype.equals("161") || detailtype.equals("162")) { + // browserInitUtil.initCustomizeBrow(browserbean, fielddbtype, Util.getIntValue(detailtype), user.getUID()); + // } else { + // browserbean.getDataParams().put("cube_treeid", dmlurl); + // browserbean.getDataParams().put("currenttime", System.currentTimeMillis()); + // browserInitUtil.initBrowser(browserbean, user.getLanguage()); + // } + // searchConditionItem = new SearchConditionItem(ConditionType.BROWSER, SystemEnv.getHtmlLabelNames(fieldlabel, user.getLanguage()), new String[]{fieldname}, browserbean); + //} else { + searchConditionItem = conditionFactory.createCondition(ConditionType.BROWSER, fieldlabel, fieldname, detailtype); + //} + // searchConditionItem.getBrowserConditionParam().setHideVirtualOrg(hrmFieldBean.getHideVirtualOrg()); + List> replaceDatas = new ArrayList>(); + String tmpFieldValue = Util.null2String(fieldvalue); + if (detailtype.equals("mkqshift")) { + ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit(); + String[] fieldvalues = Util.splitString(tmpFieldValue, ","); + for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { + String fieldshowname = Util.null2String(shiftManagementToolKit.getShiftOnOffWorkSections(fieldvalues[i], user.getLanguage())); + if (fieldshowname.length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", fieldvalues[i]); + replaceData.put("name", fieldshowname); + replaceDatas.add(replaceData); + } + } else if (detailtype.equals("sensitivewordstype")) { + SensitiveWordTypeComInfo sensitiveWordTypeComInfo = new SensitiveWordTypeComInfo(); + String[] fieldvalues = Util.splitString(tmpFieldValue, ","); + for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { + String fieldshowname = Util.null2String(sensitiveWordTypeComInfo.getName(fieldvalues[i])); + if (fieldshowname.length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", fieldvalues[i]); + replaceData.put("name", fieldshowname); + replaceDatas.add(replaceData); + } + } else if (detailtype.equals("doccategory")) { + List fieldvalues = new BrowserValueInfoService().getBrowserValueInfo(detailtype, Util.null2String(fieldvalue)); + for (int i = 0; fieldvalues != null && i < fieldvalues.size(); i++) { + BrowserValueInfo valueInfo = fieldvalues.get(i); + String fieldshowname = valueInfo.getName(); + if (fieldshowname.length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", valueInfo.getId()); + replaceData.put("name", fieldshowname); + replaceDatas.add(replaceData); + } + } else { + if (tmpFieldValue.length() > 0) { + String fieldshowname = hrmFieldManager.getFieldvalue(user, dmlurl, Util.getIntValue(fieldid), Util.getIntValue(fieldhtmltype), Util.getIntValue(detailtype), tmpFieldValue, 0); + String[] fieldvalues = Util.splitString(tmpFieldValue, ","); + String[] fieldshownames = Util.splitString(fieldshowname, ","); + if (detailtype.equals("257")) { + if (fieldshowname.endsWith(" ")) { + fieldshowname = fieldshowname.substring(0, fieldshowname.length() - 5); + } + fieldshownames = Util.splitString(fieldshowname, " "); + } + for (int i = 0; fieldvalues != null && i < fieldvalues.length; i++) { + if (fieldvalues.length != fieldshownames.length) { + break; + } + if (Util.null2String(fieldshownames[i]).length() == 0) continue; + Map replaceData = new HashMap(); + replaceData.put("id", fieldvalues[i]); + replaceData.put("name", fieldshownames[i]); + replaceDatas.add(replaceData); + } + } + } + fieldvalue = replaceDatas; + } + } else if (fieldhtmltype.equals("4")) {//Check框 + searchConditionItem = conditionFactory.createCondition(ConditionType.CHECKBOX, fieldlabel, fieldname); + if (detailtype.equals("2")) { + searchConditionItem.setConditionType(ConditionType.SWITCH); + } + + } else if (fieldhtmltype.equals("5")) { //选择框 + // List statusOptions = hrmFieldBean.getSelectOption(); + // if (statusOptions == null) statusOptions = new ArrayList(); + // try { + // if (fieldid.length() > 0) { + // rs = new RecordSet(); + // char flag = Util.getSeparator(); + // if (hrmFieldBean.getIsFormField()) { + // if (Util.null2String(hrmFieldBean.getIssystem()).equals("1")) { + // rs.executeProc("hrm_selectitembyid_new", "" + fieldid + flag + 1); + // } else { + // rs.executeProc("cus_selectitembyid_new", "" + fieldid + flag + 1); + // } + // } else { + // if (fieldname.startsWith("column_")) { + // rs.executeProc("cus_selectitembyid_new", "" + fieldid + flag + 1); + // } else { + // rs.executeProc("hrm_searchselectitembyid", fieldid); + // } + // } + // while (rs.next()) { + // String tmpselectvalue = Util.null2String(rs.getString("selectvalue")); + // String tmpselectname = Util.toScreen(rs.getString("selectname"), user.getLanguage()); + // if (Util.null2String(rs.getString("cancel")).equals("1")) continue; + // boolean isDefault = Util.null2String(rs.getString("isdefault")).equals("y"); + // if (!isDefault) { + // isDefault = Util.null2String(rs.getString("hrm_isdefault")).equals("1"); + // } + // SearchConditionOption searchConditionOption = new SearchConditionOption(tmpselectvalue, tmpselectname, isDefault); + // if (!statusOptions.contains(searchConditionOption)) { + // statusOptions.add(searchConditionOption); + // } + // } + // } + // } catch (Exception e) { + // writeLog(e); + // } + // searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname, statusOptions); + // if (detailtype.equals("") || detailtype.equals("0")) { + // detailtype = "1"; + // } + // searchConditionItem.setKey(Util.null2String(fieldvalue)); + // searchConditionItem.setValue(fieldvalue); + // searchConditionItem.setDetailtype(Util.getIntValue(detailtype, 3)); + } else if (fieldhtmltype.equals("6")) {//附件 + if (fieldname.equals("resourceimageid")) { + searchConditionItem = conditionFactory.createCondition(ConditionType.RESOURCEIMG, fieldlabel, fieldname, isQuickSearch); + } else { + searchConditionItem = conditionFactory.createCondition(ConditionType.UPLOAD, fieldlabel, fieldname, isQuickSearch); + searchConditionItem.setUploadUrl("/api/doc/upload/uploadFile"); + searchConditionItem.setCategory("category"); + searchConditionItem.setMaxFilesNumber(10); + searchConditionItem.setMultiSelection(true); + Map otherParamsMap = new HashMap<>(); + otherParamsMap.put("showClearAll", false); + otherParamsMap.put("showOrder", true); + searchConditionItem.setOtherParams(otherParamsMap); + if (Util.null2String(fieldvalue).length() > 0) { + List datas = new ArrayList(); + Map data = null; + String[] tmpIds = Util.splitString(Util.null2String(fieldvalue), ","); + for (int i = 0; i < tmpIds.length; i++) { + String fileid = tmpIds[i]; + ImageFileManager manager = new ImageFileManager(); + manager.getImageFileInfoById(Util.getIntValue(fileid)); + String filename = manager.getImageFileName(); + String extname = filename.contains(".") ? filename.substring(filename.lastIndexOf(".") + 1) : ""; + data = new HashMap(); + data.put("acclink", "/weaver/weaver.file.FileDownload?fileid=" + fileid); + data.put("fileExtendName", extname); + data.put("fileid", fileid); + //if (Util.null2String(this.isMobile).equals("1")) { + // data.put("filelink", "/spa/document/static4mobile/index.html#/attach/" + fileid); + //} else { + data.put("filelink", "/spa/document/index2file.jsp?imagefileId=" + fileid + "#/main/document/fileView"); + //} + data.put("filename", filename); + data.put("filesize", manager.getImgsize()); + data.put("imgSrc", ""); + data.put("isImg", ""); + data.put("loadlink", "/weaver/weaver.file.FileDownload?fileid=" + fileid + "&download=1"); + data.put("showDelete", "true"); + data.put("showLoad", "true"); + datas.add(data); + } + searchConditionItem.setDatas(datas); + } + } + } else if (fieldhtmltype.equals("7")) {//颜色选择 + searchConditionItem = conditionFactory.createCondition(ConditionType.COLORPICKER, fieldlabel, fieldname, true); + searchConditionItem.setValue(fieldvalue); + } else if (fieldhtmltype.equals("8")) {//DESCRIPTION + searchConditionItem = conditionFactory.createCondition(ConditionType.DESCRIPTION, fieldlabel, fieldname); + searchConditionItem.setValue(fieldvalue); + } + if (searchConditionItem != null) { + BrowserInitUtil.setConditionItemDefaultValue(searchConditionItem, fieldvalue, 2); + searchConditionItem.setLabelcol(6); + searchConditionItem.setFieldcol(12); + searchConditionItem.setViewAttr(viewAttr); + if (searchConditionItem.getBrowserConditionParam() != null) { + searchConditionItem.getBrowserConditionParam().setViewAttr(viewAttr); + } + if (searchConditionItem.getConditionType().equals(ConditionType.DATE)) { + searchConditionItem.setFieldcol(18); + } + + if (Util.null2String(extendInfoPO.getFieldNameDesc()).length() > 0) { + searchConditionItem.setLabel(extendInfoPO.getFieldNameDesc()); + } + + } + } catch (Exception e) { + throw new RuntimeException(e); + } + + return searchConditionItem; + } +} diff --git a/src/com/engine/organization/entity/extend/po/ExtendGroupPO.java b/src/com/engine/organization/entity/extend/po/ExtendGroupPO.java new file mode 100644 index 00000000..5c840aa2 --- /dev/null +++ b/src/com/engine/organization/entity/extend/po/ExtendGroupPO.java @@ -0,0 +1,41 @@ +package com.engine.organization.entity.extend.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/18 + * @version: 1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ExtendGroupPO { + /** + * 主键 + */ + private Long id; + + /** + * 类型 + */ + private Integer extendType; + + /** + * 分组名称 + */ + private String groupName; + + private Long creator; + private int deleteType; + private Date createTime; + private Date updateTime; + +} diff --git a/src/com/engine/organization/entity/extend/po/ExtendInfoPO.java b/src/com/engine/organization/entity/extend/po/ExtendInfoPO.java new file mode 100644 index 00000000..aba76bc9 --- /dev/null +++ b/src/com/engine/organization/entity/extend/po/ExtendInfoPO.java @@ -0,0 +1,111 @@ +package com.engine.organization.entity.extend.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/19 + * @version: 1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ExtendInfoPO { + /** + * 主键 + */ + private Long id; + + /** + * 类型 + */ + private Integer extendType; + + /** + * 表名 + */ + private String tableName; + + /** + * 字段名 + */ + private String fieldName; + + /** + * 字段中文名 + */ + private String fieldNameDesc; + + /** + * 类型 + */ + private String fieldType; + + /** + * 控件类型 + */ + private Integer controlType; + + + /** + * 浏览按钮类型 + */ + private String browserType; + + /** + * 分组主键 + */ + private Long extendGroupId; + + /** + * 是否启用 + */ + private Integer isenable; + + /** + * 是否必填 + */ + private Integer isrequired; + + /** + * 列表显示 + */ + private Integer listShow; + + /** + * 查询卡片显示 + */ + private Integer searchShow; + + /** + * 修改显示 + */ + private Integer editShow; + + /** + * 增加显示 + */ + private Integer addShow; + + /** + * 浏览按钮显示 + */ + private Integer browserShow; + + /** + * 显示顺序 + */ + private Integer showOrder; + + private Long creator; + private int deleteType; + private Date createTime; + private Date updateTime; +} diff --git a/src/com/engine/organization/entity/staff/po/StaffPlanPO.java b/src/com/engine/organization/entity/staff/po/StaffPlanPO.java new file mode 100644 index 00000000..a396cf57 --- /dev/null +++ b/src/com/engine/organization/entity/staff/po/StaffPlanPO.java @@ -0,0 +1,62 @@ +package com.engine.organization.entity.staff.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/24 + * @version: 1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class StaffPlanPO { + /** + * 主键 + */ + private Long id; + /** + * 编号 + */ + private String planNo; + /** + * 名称 + */ + private String planName; + /** + * 年度 + */ + private Integer planYear; + /** + * 时间开始 + */ + private Date time_start; + /** + * 时间结束 + */ + private Date time_end; + /** + * 适用公司 + */ + private String companyId; + /** + * 说明 + */ + private String description; + /** + * 状态 + */ + private Integer forbiddenTag; + + private Long creator; + private int deleteType; + private Date createTime; + private Date updateTime; +} diff --git a/src/com/engine/organization/mapper/comp/CompMapper.java b/src/com/engine/organization/mapper/comp/CompMapper.java index e5f2df15..addd2c09 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.java +++ b/src/com/engine/organization/mapper/comp/CompMapper.java @@ -1,9 +1,9 @@ package com.engine.organization.mapper.comp; -import com.engine.organization.common.BaseQueryParam; import com.engine.organization.entity.comp.po.CompPO; import org.apache.ibatis.annotations.Param; +import java.util.Collection; import java.util.List; /** @@ -15,8 +15,80 @@ import java.util.List; public interface CompMapper { /** * 列表查询 - * @param queryParam + * * @return */ - List list(@Param("param") BaseQueryParam queryParam); + List list(); + + /** + * 根据搜索条件查询数据 + * + * @return + */ + List listByFilter(CompPO compPO); + + /** + * 获取顶级数据 + * + * @return + */ + List listParent(); + + /** + * 获取子层级数据 + * + * @param ids + * @return + */ + List listChild(@Param("ids") Collection ids); + + /** + * 根据ID查询数据 + * + * @param id + * @return + */ + CompPO listById(@Param("id") long id); + + + /** + * 根据No查询数据 + * + * @param compNo + * @return + */ + List listByNo(@Param("compNo") String compNo); + + + /** + * 保存公司/分部基础信息 + * + * @param compPO + * @return + */ + int insertIgnoreNull(CompPO compPO); + + + /** + * 更新主表内容 + * + * @param compPO + * @return + */ + int updateBaseComp(CompPO compPO); + + /** + * 更新禁用标记 + * + * @param compPO + * @return + */ + int updateForbiddenTagById(CompPO compPO); + + /** + * 批量删除职务信息方案 + * + * @param ids + */ + int deleteByIds(@Param("ids") Collection ids); } diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index 44086a0f..38296611 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -38,6 +38,101 @@ , t.update_time + + and ifnull(parent_company,'0')='0' + + + + and isnull(parent_company,'0')='0' + + + + and NVL(parent_company,'0')='0' + + + + INSERT INTO jcl_org_comp + + + creator, + + + delete_type, + + + create_time, + + + update_time, + + + comp_no, + + + comp_name, + + + comp_name_short, + + + parent_company, + + + org_code, + + + industry, + + + comp_principal, + + + description, + + forbidden_tag, + + + + #{creator}, + + + #{deleteType}, + + + #{createTime}, + + + #{updateTime}, + + + #{compNo}, + + + #{compName}, + + + #{compNameShort}, + + + #{parentCompany}, + + + #{orgCode}, + + + #{industry}, + + + #{compPrincipal}, + + + #{description}, + + 0, + + + + + + + + + + + + + + update jcl_org_comp + + forbidden_tag=#{forbiddenTag}, + + WHERE id = #{id} AND delete_type = 0 + + + + UPDATE jcl_org_comp + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + update jcl_org_comp + + creator=#{creator}, + update_time=#{updateTime}, + comp_name=#{compName}, + comp_name_short=#{compNameShort}, + parent_company=#{parentCompany}, + org_code=#{orgCode}, + industry=#{industry}, + comp_principal=#{compPrincipal}, + description=#{description}, + + WHERE id = #{id} AND delete_type = 0 + + + + + and t.comp_no like CONCAT('%',#{compNo},'%') + + + and t.comp_name like CONCAT('%',#{compName},'%') + + + and t.comp_name_short like CONCAT('%',#{compNameShort},'%') + + + and t.org_code like CONCAT('%',#{orgCode},'%') + + + + + + and t.comp_no like '%'||#{compNo}||'%' + + + and t.comp_name like '%'||#{compName}||'%' + + + and t.comp_name_short like '%'||#{compNameShort}||'%' + + + and t.org_code like '%'||#{orgCode}||'%' + + + + + + and t.comp_no like '%'+#{compNo}+'%' + + + and t.comp_name like '%'+#{compName}+'%' + + + and t.comp_name_short like '%'+#{compNameShort}+'%' + + + and t.org_code like '%'+#{orgCode}+'%' + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.java b/src/com/engine/organization/mapper/department/DepartmentMapper.java new file mode 100644 index 00000000..f4eb2d5f --- /dev/null +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.java @@ -0,0 +1,41 @@ +package com.engine.organization.mapper.department; + +import com.engine.organization.entity.department.po.DepartmentPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/20 + * @Version V1.0 + **/ +public interface DepartmentMapper { + + List getDeptListByCompId(); + + List getDeptListByPId(@Param("PId") Long PId); + + List getDeptList(DepartmentPO departmentPO); + + /** + * 获取顶级数据 + * + * @return + */ + List listParent(); + + /** + * 获取子层级数据 + * + * @param ids + * @return + */ + List listChild(@Param("ids") Collection ids); + + DepartmentPO getDeptById(@Param("id") int id); + + String getDeptNameById(@Param("id") int id); +} diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml new file mode 100644 index 00000000..11061587 --- /dev/null +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and t.dept_no like CONCAT('%',#{deptNo},'%') + + + and t.dept_name like CONCAT('%',#{deptName},'%') + + + and t.dept_name_short like CONCAT('%',#{deptNameShort},'%') + + + + + + and t.dept_no like '%'||#{deptNo}||'%' + + + and t.dept_name like '%'||#{deptName}||'%' + + + and t.dept_name_short like '%'||#{deptNameShort}||'%' + + + + + + and t.dept_no like '%'+#{deptNo}+'%' + + + and t.dept_name like '%'+#{deptName}+'%' + + + and t.dept_name_short like '%'+#{deptNameShort}+'%' + + + + + and ifnull(parent_dept,'0')='0' + + + + and isnull(parent_dept,'0')='0' + + + + and NVL(parent_dept,'0')='0' + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/employee/EmployeeMapper.java b/src/com/engine/organization/mapper/employee/EmployeeMapper.java new file mode 100644 index 00000000..d6533bc5 --- /dev/null +++ b/src/com/engine/organization/mapper/employee/EmployeeMapper.java @@ -0,0 +1,17 @@ +package com.engine.organization.mapper.employee; + +import com.engine.organization.entity.department.po.DepartmentPO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/5/20 + * @Version V1.0 + **/ +public interface EmployeeMapper { + + String getEmployeeNameById(@Param("employeeId") Long id); +} diff --git a/src/com/engine/organization/mapper/employee/EmployeeMapper.xml b/src/com/engine/organization/mapper/employee/EmployeeMapper.xml new file mode 100644 index 00000000..e00791d6 --- /dev/null +++ b/src/com/engine/organization/mapper/employee/EmployeeMapper.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/extend/ExtDTMapper.java b/src/com/engine/organization/mapper/extend/ExtDTMapper.java new file mode 100644 index 00000000..baf68619 --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtDTMapper.java @@ -0,0 +1,41 @@ +package com.engine.organization.mapper.extend; + +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/20 + * @version: 1.0 + */ +public interface ExtDTMapper { + + /** + * 根据主表id,查询拓展表数据 + * + * @param tableName + * @param id + * @return + */ + List> listCompExtDT(@Param("tableName") String tableName, @Param("id") long id, @Param("fields") String fields); + + /** + * 插入主表明细表 + * + * @param map + * @return + */ + int insertCompExtDT(@Param("tableName") String tableName, @Param("map") Map map); + + /** + * 根据mainId删除指定明细表数据 + * + * @param tableName + * @param mainId + * @return + */ + int deleteByMainID(@Param("tableName") String tableName, @Param("mainId") long mainId); +} diff --git a/src/com/engine/organization/mapper/extend/ExtDTMapper.xml b/src/com/engine/organization/mapper/extend/ExtDTMapper.xml new file mode 100644 index 00000000..d9ef99a7 --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtDTMapper.xml @@ -0,0 +1,31 @@ + + + + + + + insert into ${tableName} ( + + ${key} + + ) + values ( + + #{value} + + ) + + + delete + from ${tableName} + where mainid = #{mainId} + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/extend/ExtMapper.java b/src/com/engine/organization/mapper/extend/ExtMapper.java new file mode 100644 index 00000000..da7b11d5 --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtMapper.java @@ -0,0 +1,48 @@ +package com.engine.organization.mapper.extend; + +import org.apache.ibatis.annotations.Param; + +import java.util.Map; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/20 + * @version: 1.0 + */ +public interface ExtMapper { + + /** + * 根据主表id,查询主表拓展表数据 + * + * @param tableName + * @param id + * @return + */ + Map listCompExt(@Param("tableName") String tableName, @Param("fields") String fields, @Param("id") long id); + + /** + * 判断当前数据是否存在 + * + * @param tableName + * @param id + * @return + */ + int countCompExtById(@Param("tableName") String tableName, @Param("id") long id); + + /** + * 插入主表拓展表 + * + * @param map + * @return + */ + int insertCompExt(@Param("tableName") String tableName, @Param("map") Map map); + + /** + * 更新主表拓展表 + * + * @param map + * @return + */ + int updateCompExt(@Param("tableName") String tableName, @Param("id") long id, @Param("map") Map map); +} diff --git a/src/com/engine/organization/mapper/extend/ExtMapper.xml b/src/com/engine/organization/mapper/extend/ExtMapper.xml new file mode 100644 index 00000000..40b9672f --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtMapper.xml @@ -0,0 +1,40 @@ + + + + + + + insert into ${tableName} ( + + ${key} + + ) + values ( + + #{value} + + ) + + + + update ${tableName} set + + ${key} = #{value} + + where id = #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/extend/ExtendGroupMapper.java b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.java new file mode 100644 index 00000000..05a32cfc --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.java @@ -0,0 +1,30 @@ +package com.engine.organization.mapper.extend; + +import com.engine.organization.entity.extend.po.ExtendGroupPO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/18 + * @version: 1.0 + */ +public interface ExtendGroupMapper { + /** + * 列表查询 + * + * @param groupType + * @return + */ + List listByType(@Param("groupType") String groupType); + + /** + * 根据ID查询分组名称 + * + * @param id + * @return + */ + String getGroupNameById(@Param("id") String id); +} diff --git a/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml new file mode 100644 index 00000000..ba748796 --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + t + . + id + , t.extend_type + , t.group_name + , t.creator + , t.delete_type + , t.create_time + , t.update_time + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.java b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.java new file mode 100644 index 00000000..287411ce --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.java @@ -0,0 +1,24 @@ +package com.engine.organization.mapper.extend; + +import com.engine.organization.entity.extend.po.ExtendInfoPO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @description: TODO + * @author:dxfeng + * @createTime: 2022/05/19 + * @version: 1.0 + */ +public interface ExtendInfoMapper { + /** + * 列表查询 + * + * @param extendType + * @param extendGroupId + * @param tableName + * @return + */ + List listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName); +} diff --git a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml new file mode 100644 index 00000000..5d9855cc --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.extend_type + , t.table_name + , t.field_name + , t.field_name_desc + , t.field_type + , t.control_type + , t.browser_type + , t.extend_group_id + , t.isenable + , t.isrequired + , t.list_show + , t.search_show + , t.edit_show + , t.add_show + , t.browser_show + , t.show_order + , t.creator + , t.delete_type + , t.create_time + , t.update_time + + + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/mapper/post/PostInfoMapper.xml b/src/com/engine/organization/mapper/post/PostInfoMapper.xml index 9d4a6011..be162ff4 100644 --- a/src/com/engine/organization/mapper/post/PostInfoMapper.xml +++ b/src/com/engine/organization/mapper/post/PostInfoMapper.xml @@ -154,7 +154,7 @@ - + update jcl_org_post_info forbidden_tag=#{forbiddenTag}, diff --git a/src/com/engine/organization/mapper/scheme/LevelMapper.xml b/src/com/engine/organization/mapper/scheme/LevelMapper.xml index c34dfe85..2f597ead 100644 --- a/src/com/engine/organization/mapper/scheme/LevelMapper.xml +++ b/src/com/engine/organization/mapper/scheme/LevelMapper.xml @@ -42,7 +42,7 @@ from jcl_org_level t where level_no = #{levelNo} AND delete_type = 0