!77 添加字段分组表

Merge pull request !77 from dxfeng/feature/dxf
pull/78/MERGE
dxfeng 3 years ago committed by Gitee
commit e9947aeb46
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -116,6 +116,7 @@ CREATE TABLE JCL_ORG_COMP (
-- JCL_FIELD_EXTENDGROUP -- JCL_FIELD_EXTENDGROUP
CREATE TABLE JCL_FIELD_EXTENDGROUP ( CREATE TABLE JCL_FIELD_EXTENDGROUP (
id int auto_increment NOT NULL, id int auto_increment NOT NULL,
pid int null,
extend_type int null, extend_type int null,
group_name varchar(100) NULL, group_name varchar(100) NULL,
creator int null, creator int null,
@ -125,6 +126,20 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
CONSTRAINT JCL_FIELD_EXTENDGROUP_PK PRIMARY KEY (id) CONSTRAINT JCL_FIELD_EXTENDGROUP_PK PRIMARY KEY (id)
); );
-- JCL_FIELD_EXTENDTITLE
create table JCL_FIELD_EXTENDTITLE (
id int auto_increment not null,
group_id int null,
title varchar(100) null,
show_order int null,
is_show int null,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
constraint JCL_FIELD_EXTENDTITLE_PK primary key (id)
);
-- JCL_FIELD_EXTENDINFO -- JCL_FIELD_EXTENDINFO
CREATE TABLE JCL_FIELD_EXTENDINFO ( CREATE TABLE JCL_FIELD_EXTENDINFO (
id int auto_increment NOT NULL, id int auto_increment NOT NULL,
@ -135,6 +150,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
field_type varchar(1000) NULL, field_type varchar(1000) NULL,
control_type int null, control_type int null,
browser_type varchar(100) NULL, browser_type varchar(100) NULL,
custom_value text null,
extend_group_id int null, extend_group_id int null,
isenable int null, isenable int null,
isrequired int null, isrequired int null,
@ -243,8 +259,8 @@ CREATE TABLE JCL_ORG_JOBDT (
mainid int NULL, mainid int NULL,
level_id varchar(100) NULL, level_id varchar(100) NULL,
grade_id varchar(100) NULL, grade_id varchar(100) NULL,
level_id_span varchar(100) NULL, level_id_span varchar(1000) NULL,
grade_id_span varchar(100) NULL, grade_id_span varchar(1000) NULL,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time date null, create_time date null,

@ -118,7 +118,8 @@ CREATE TABLE JCL_ORG_COMP (
-- JCL_FIELD_EXTENDGROUP -- JCL_FIELD_EXTENDGROUP
CREATE TABLE JCL_FIELD_EXTENDGROUP ( CREATE TABLE JCL_FIELD_EXTENDGROUP (
ID NUMBER NOT NULL, ID NUMBER NOT NULL,
EXTEND_TYPE NUMBER NULL, PID NUMBER NULL,
EXTEND_TYPE NUMBER NULL,
GROUP_NAME NVARCHAR2(100) NULL, GROUP_NAME NVARCHAR2(100) NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
@ -127,6 +128,20 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
CONSTRAINT JCL_FIELD_EXTENDGROUP_PK PRIMARY KEY (ID) CONSTRAINT JCL_FIELD_EXTENDGROUP_PK PRIMARY KEY (ID)
); );
-- JCL_FIELD_EXTENDTITLE
CREATE TABLE JCL_FIELD_EXTENDTITLE (
ID NUMBER NOT NULL,
GROUP_ID NUMBER NULL,
TITLE VARCHAR(100) NULL,
SHOW_ORDER NUMBER NULL,
IS_SHOW NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL,
CONSTRAINT JCL_FIELD_EXTENDTITLE_PK PRIMARY KEY (ID)
);
-- JCL_FIELD_EXTENDINFO -- JCL_FIELD_EXTENDINFO
CREATE TABLE JCL_FIELD_EXTENDINFO ( CREATE TABLE JCL_FIELD_EXTENDINFO (
ID NUMBER NOT NULL, ID NUMBER NOT NULL,
@ -136,6 +151,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
FIELD_NAME_DESC NVARCHAR2(100) NULL, FIELD_NAME_DESC NVARCHAR2(100) NULL,
FIELD_TYPE NVARCHAR2(1000) NULL, FIELD_TYPE NVARCHAR2(1000) NULL,
CONTROL_TYPE NUMBER NULL, CONTROL_TYPE NUMBER NULL,
CUSTOM_VALUE NVARCHAR2(1000) NULL,
BROWSER_TYPE NVARCHAR2(100) NULL, BROWSER_TYPE NVARCHAR2(100) NULL,
EXTEND_GROUP_ID NUMBER NULL, EXTEND_GROUP_ID NUMBER NULL,
ISENABLE NUMBER NULL, ISENABLE NUMBER NULL,
@ -245,8 +261,8 @@ CREATE TABLE JCL_ORG_JOBDT (
MAINID NUMBER NULL, MAINID NUMBER NULL,
LEVEL_ID NVARCHAR2(100) NULL, LEVEL_ID NVARCHAR2(100) NULL,
GRADE_ID NVARCHAR2(100) NULL, GRADE_ID NVARCHAR2(100) NULL,
LEVEL_ID_SPAN NVARCHAR2(100) NULL, LEVEL_ID_SPAN NVARCHAR2(1000) NULL,
GRADE_ID_SPAN NVARCHAR2(100) NULL, GRADE_ID_SPAN NVARCHAR2(1000) NULL,
CREATOR NUMBER NULL, CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL, DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL, CREATE_TIME DATE NULL,

@ -116,6 +116,7 @@ CREATE TABLE JCL_ORG_COMP (
-- JCL_FIELD_EXTENDGROUP -- JCL_FIELD_EXTENDGROUP
CREATE TABLE JCL_FIELD_EXTENDGROUP ( CREATE TABLE JCL_FIELD_EXTENDGROUP (
id int IDENTITY(1,1) NOT NULL, id int IDENTITY(1,1) NOT NULL,
pid int null,
extend_type int null, extend_type int null,
group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
creator int null, creator int null,
@ -125,6 +126,20 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP (
CONSTRAINT JCL_FIELD_EXTENDGROUP_PK PRIMARY KEY (id) CONSTRAINT JCL_FIELD_EXTENDGROUP_PK PRIMARY KEY (id)
); );
-- JCL_FIELD_EXTENDTITLE
create table JCL_FIELD_EXTENDTITLE (
id int IDENTITY(1,1) NOT NULL,
group_id int null,
title varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
show_order int null,
is_show int null,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
CONSTRAINT JCL_FIELD_EXTENDTITLE_PK PRIMARY KEY (id)
);
-- JCL_FIELD_EXTENDINFO -- JCL_FIELD_EXTENDINFO
CREATE TABLE JCL_FIELD_EXTENDINFO ( CREATE TABLE JCL_FIELD_EXTENDINFO (
id int IDENTITY(1,1) NOT NULL, id int IDENTITY(1,1) NOT NULL,
@ -134,6 +149,7 @@ CREATE TABLE JCL_FIELD_EXTENDINFO (
field_name_desc varchar(100) COLLATE Chinese_PRC_CI_AS NULL, field_name_desc varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
field_type varchar(1000) COLLATE Chinese_PRC_CI_AS NULL, field_type varchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
control_type int null, control_type int null,
custom_value text null,
browser_type varchar(100) COLLATE Chinese_PRC_CI_AS NULL, browser_type varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
extend_group_id int null, extend_group_id int null,
isenable int null, isenable int null,
@ -243,8 +259,8 @@ CREATE TABLE JCL_ORG_JOBDT (
mainid int NULL, mainid int NULL,
level_id varchar(100) NULL, level_id varchar(100) NULL,
grade_id varchar(100) NULL, grade_id varchar(100) NULL,
level_id_span varchar(100) NULL, level_id_span varchar(1000) NULL,
grade_id_span varchar(100) NULL, grade_id_span varchar(1000) NULL,
creator int null, creator int null,
delete_type int null, delete_type int null,
create_time datetime null, create_time datetime null,

@ -1,16 +1,13 @@
package com.engine.organization.entity; package com.engine.organization.entity;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.api.browser.bean.SearchConditionOption; import com.api.browser.bean.SearchConditionOption;
import org.apache.commons.lang.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* @description:
* @author:dxfeng * @author:dxfeng
* @createTime: 2022/06/13 * @createTime: 2022/06/13
* @version: 1.0 * @version: 1.0
@ -20,16 +17,21 @@ public class SelectOptionParam {
/** /**
* Json * Json
* *
* @param datas * @param customValue
* @return * @return
*/ */
public static List<SearchConditionOption> convertJsonToListOption(String datas) { public static List<SearchConditionOption> convertJsonToListOption(String customValue) {
List<SearchConditionOption> selectOptions = new ArrayList<>(); List<SearchConditionOption> selectOptions = new ArrayList<>();
if (StringUtils.isNotBlank(datas)) { JSONArray objects = JSONObject.parseArray(customValue);
JSONArray objectArray = JSON.parseArray(datas); if (objects.size() < 3) {
int size = objectArray.size(); return selectOptions;
}
JSONObject o = (JSONObject) objects.get(2);
JSONArray datas = o.getJSONArray("datas");
if (!datas.isEmpty()) {
int size = datas.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
JSONObject jsonObject = (JSONObject) objectArray.get(i); JSONObject jsonObject = (JSONObject) datas.get(i);
SearchConditionOption option = new SearchConditionOption(jsonObject.getString("key"), jsonObject.getString("option")); SearchConditionOption option = new SearchConditionOption(jsonObject.getString("key"), jsonObject.getString("option"));
selectOptions.add(option); selectOptions.add(option);
} }

@ -0,0 +1,49 @@
package com.engine.organization.entity.extend.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author:dxfeng
* @createTime: 2022/06/14
* @version: 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ExtendTitlePO {
/**
*
*/
private Long id;
/**
*
*/
private Long groupid;
/**
*
*/
private String title;
/**
*
*/
private Integer showOrder;
/**
*
*/
private Integer isShow;
private Integer creator;
private Integer deleteType;
private Date createTime;
private Date updateTime;
}

@ -0,0 +1,24 @@
package com.engine.organization.mapper.extend;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2022/06/14
* @version: 1.0
*/
public interface ExtendTitleMapper {
/**
*
*
* @param groupId
* @return
*/
List<ExtendTitlePO> getTitlesByGroupID(@Param("groupId") Long groupId);
List<ExtendTitlePO> getTitlesByIds(@Param("ids") Collection<Long> ids);
}

@ -0,0 +1,57 @@
<?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.extend.ExtendTitleMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.extend.po.ExtendTitlePO">
<result column="id" property="id"/>
<result column="group_id" property="groupid"/>
<result column="title" property="title"/>
<result column="show_order" property="showOrder"/>
<result column="is_show" property="isShow"/>
<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.group_id
, t.title
, show_order
, is_show
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<select id="getTitlesByGroupID" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_field_extendtitle t
WHERE t.delete_type = 0
<if test=" groupId != null ">
and group_id = #{groupId}
</if>
order by show_order
</select>
<select id="getTitlesByIds" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM
jcl_field_extendtitle t
WHERE t.delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
order by show_order
</select>
</mapper>

@ -15,9 +15,9 @@ import com.engine.organization.entity.company.bo.CompBO;
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.CompSearchParam;
import com.engine.organization.entity.company.po.CompPO; import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.extend.po.ExtendGroupPO; import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.extend.ExtendGroupMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.service.CompService; import com.engine.organization.service.CompService;
import com.engine.organization.service.ExtService; import com.engine.organization.service.ExtService;
import com.engine.organization.util.HasRightUtil; import com.engine.organization.util.HasRightUtil;
@ -75,8 +75,8 @@ public class CompServiceImpl extends Service implements CompService {
return MapperProxyFactory.getProxy(CompMapper.class); return MapperProxyFactory.getProxy(CompMapper.class);
} }
private ExtendGroupMapper getExtendGroupMapper() { private ExtendTitleMapper getExtendTitleMapper() {
return MapperProxyFactory.getProxy(ExtendGroupMapper.class); return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
} }
private ExtService getExtService(User user) { private ExtService getExtService(User user) {
@ -187,7 +187,6 @@ public class CompServiceImpl extends Service implements CompService {
SearchConditionItem compNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "compName"); SearchConditionItem compNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "compName");
// 简称 // 简称
SearchConditionItem compNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "compNameShort"); SearchConditionItem compNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "compNameShort");
// TODO
// 上级公司 // 上级公司
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "161", "parentCompany", "compBrowser"); SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "161", "parentCompany", "compBrowser");
// 组织机构代码 // 组织机构代码
@ -240,10 +239,11 @@ public class CompServiceImpl extends Service implements CompService {
if ("0".equals(groupId)) { if ("0".equals(groupId)) {
groupId = GROUP_ID.toString(); groupId = GROUP_ID.toString();
} }
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId)); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
if (CollectionUtils.isNotEmpty(extendGroupPOS)) {
for (ExtendGroupPO extendGroupPO : extendGroupPOS) { if (CollectionUtils.isNotEmpty(extendTitles)) {
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_COMPEXT : JCL_ORG_COMP, viewAttr, id, extendGroupPO.getId().toString(), "comp_no"))); for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_COMPEXT : JCL_ORG_COMP, viewAttr, id, extendTitle.getId() + "", "comp_no")));
} }
} }
@ -268,10 +268,10 @@ public class CompServiceImpl extends Service implements CompService {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
Map<String, Object> apiDatas = new HashMap<>(); Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>(); List<SearchConditionGroup> addGroups = new ArrayList<>();
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (CollectionUtils.isNotEmpty(extendGroupPOS)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendGroupPO extendGroupPO : extendGroupPOS) { for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendGroupPO.getId().toString(), "comp_no", RuleCodeType.SUBCOMPANY.getValue()))); addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_COMP, 2, extendTitle.getId() + "", "comp_no", RuleCodeType.SUBCOMPANY.getValue())));
} }
} }
apiDatas.put("condition", addGroups); apiDatas.put("condition", addGroups);

@ -17,7 +17,7 @@ import com.engine.organization.entity.department.dto.DepartmentListDTO;
import com.engine.organization.entity.department.param.*; import com.engine.organization.entity.department.param.*;
import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.department.vo.SingleDeptTreeVO; import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
import com.engine.organization.entity.extend.po.ExtendGroupPO; import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.entity.job.bo.JobBO; import com.engine.organization.entity.job.bo.JobBO;
import com.engine.organization.entity.job.po.JobPO; import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.entity.job.vo.SingleJobTreeVO; import com.engine.organization.entity.job.vo.SingleJobTreeVO;
@ -25,7 +25,7 @@ import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendGroupMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.service.DepartmentService; import com.engine.organization.service.DepartmentService;
import com.engine.organization.service.ExtService; import com.engine.organization.service.ExtService;
@ -91,8 +91,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
return MapperProxyFactory.getProxy(CompMapper.class); return MapperProxyFactory.getProxy(CompMapper.class);
} }
private ExtendGroupMapper getExtendGroupMapper() { private ExtendTitleMapper getExtendTitleMapper() {
return MapperProxyFactory.getProxy(ExtendGroupMapper.class); return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
} }
private ExtService getExtService(User user) { private ExtService getExtService(User user) {
@ -293,10 +293,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
if ("0".equals(groupId)) { if ("0".equals(groupId)) {
groupId = GROUP_ID.toString(); groupId = GROUP_ID.toString();
} }
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId)); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendGroupPO extendGroupPO : extendGroupPOS) { for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_DEPTEXT : JCL_ORG_DEPT, viewAttr, id, extendGroupPO.getId().toString(), "dept_no"))); addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_DEPTEXT : JCL_ORG_DEPT, viewAttr, id, extendTitle.getId().toString(), "dept_no")));
} }
} }
@ -320,10 +320,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
Map<String, Object> apiDatas = new HashMap<>(); Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>(); List<SearchConditionGroup> addGroups = new ArrayList<>();
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) {
for (ExtendGroupPO extendGroupPO : extendGroupPOS) { if (CollectionUtils.isNotEmpty(extendTitles)) {
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendGroupPO.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue()))); for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_DEPT, 2, extendTitle.getId().toString(), "dept_no", RuleCodeType.DEPARTMENT.getValue())));
} }
} }
apiDatas.put("condition", addGroups); apiDatas.put("condition", addGroups);

@ -6,13 +6,10 @@ import com.engine.organization.entity.TopTab;
import com.engine.organization.entity.codesetting.po.CodeRulePO; import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.extend.ExtendInfoOperateType; import com.engine.organization.entity.extend.ExtendInfoOperateType;
import com.engine.organization.entity.extend.bo.ExtendInfoBO; import com.engine.organization.entity.extend.bo.ExtendInfoBO;
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.entity.extend.po.ExtendTitlePO;
import com.engine.organization.mapper.codesetting.CodeRuleMapper; import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.extend.ExtDTMapper; import com.engine.organization.mapper.extend.*;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.extend.ExtendGroupMapper;
import com.engine.organization.mapper.extend.ExtendInfoMapper;
import com.engine.organization.service.ExtService; import com.engine.organization.service.ExtService;
import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
@ -49,6 +46,10 @@ public class ExtServiceImpl extends Service implements ExtService {
return MapperProxyFactory.getProxy(ExtendGroupMapper.class); return MapperProxyFactory.getProxy(ExtendGroupMapper.class);
} }
private ExtendTitleMapper getExtendTitleMapper() {
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
}
private ExtDTMapper getExtDTMapper() { private ExtDTMapper getExtDTMapper() {
return MapperProxyFactory.getProxy(ExtDTMapper.class); return MapperProxyFactory.getProxy(ExtDTMapper.class);
} }
@ -158,8 +159,9 @@ public class ExtServiceImpl extends Service implements ExtService {
List<ExtendInfoPO> infoPOList1 = getExtendInfoMapper().listFields(extendType, "", tableName.toLowerCase().replace("ext", ""), ExtendInfoOperateType.EDIT.getValue()); List<ExtendInfoPO> infoPOList1 = getExtendInfoMapper().listFields(extendType, "", tableName.toLowerCase().replace("ext", ""), ExtendInfoOperateType.EDIT.getValue());
infoPOList.addAll(infoPOList1); infoPOList.addAll(infoPOList1);
List<Long> ids = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList()); List<Long> ids = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList());
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByIds(ids); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByIds(ids);
Set<Long> extendGroups = extendGroupPOS.stream().map(ExtendGroupPO::getPid).collect(Collectors.toSet()); Set<Long> extendGroups = extendTitles.stream().map(ExtendTitlePO::getGroupid).collect(Collectors.toSet());
// 拓展信息 // 拓展信息
if (CollectionUtils.isNotEmpty(extendGroups)) { if (CollectionUtils.isNotEmpty(extendGroups)) {
for (Long groupId : extendGroups) { for (Long groupId : extendGroups) {

@ -17,8 +17,8 @@ import com.engine.organization.entity.department.bo.DepartmentBO;
import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.employee.vo.EmployeeTableVO; import com.engine.organization.entity.employee.vo.EmployeeTableVO;
import com.engine.organization.entity.extend.bo.ExtendInfoBO; import com.engine.organization.entity.extend.bo.ExtendInfoBO;
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.entity.extend.po.ExtendTitlePO;
import com.engine.organization.entity.job.bo.JobBO; import com.engine.organization.entity.job.bo.JobBO;
import com.engine.organization.entity.job.dto.JobListDTO; import com.engine.organization.entity.job.dto.JobListDTO;
import com.engine.organization.entity.job.param.JobSearchParam; import com.engine.organization.entity.job.param.JobSearchParam;
@ -29,13 +29,11 @@ import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams; import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtendGroupMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.job.JobDTMapper; import com.engine.organization.mapper.job.JobDTMapper;
import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.mapper.scheme.GradeMapper; import com.engine.organization.mapper.scheme.GradeMapper;
import com.engine.organization.mapper.scheme.LevelMapper; import com.engine.organization.mapper.scheme.LevelMapper;
import com.engine.organization.mapper.scheme.SchemeMapper;
import com.engine.organization.mapper.sequence.SequenceMapper;
import com.engine.organization.service.ExtService; import com.engine.organization.service.ExtService;
import com.engine.organization.service.JobService; import com.engine.organization.service.JobService;
import com.engine.organization.util.HasRightUtil; import com.engine.organization.util.HasRightUtil;
@ -117,16 +115,8 @@ public class JobServiceImpl extends Service implements JobService {
return MapperProxyFactory.getProxy(DepartmentMapper.class); return MapperProxyFactory.getProxy(DepartmentMapper.class);
} }
private SequenceMapper getSequenceMapper() { private ExtendTitleMapper getExtendTitleMapper() {
return MapperProxyFactory.getProxy(SequenceMapper.class); return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
}
private SchemeMapper getSchemeMapper() {
return MapperProxyFactory.getProxy(SchemeMapper.class);
}
private ExtendGroupMapper getExtendGroupMapper() {
return MapperProxyFactory.getProxy(ExtendGroupMapper.class);
} }
private ExtService getExtService(User user) { private ExtService getExtService(User user) {
@ -261,10 +251,10 @@ public class JobServiceImpl extends Service implements JobService {
HasRightUtil.hasRight(user, RIGHT_NAME, false); HasRightUtil.hasRight(user, RIGHT_NAME, false);
Map<String, Object> apiDatas = new HashMap<>(); Map<String, Object> apiDatas = new HashMap<>();
List<SearchConditionGroup> addGroups = new ArrayList<>(); List<SearchConditionGroup> addGroups = new ArrayList<>();
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendGroupPO extendGroupPO : extendGroupPOS) { for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendGroupPO.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue()))); addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_JOB, 2, extendTitle.getId().toString(), "job_no", RuleCodeType.JOBTITLES.getValue())));
} }
} }
apiDatas.put("condition", addGroups); apiDatas.put("condition", addGroups);
@ -288,10 +278,10 @@ public class JobServiceImpl extends Service implements JobService {
if ("0".equals(groupId)) { if ("0".equals(groupId)) {
groupId = GROUP_ID.toString(); groupId = GROUP_ID.toString();
} }
List<ExtendGroupPO> extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId)); List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(extendGroupPOS)) { if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendGroupPO extendGroupPO : extendGroupPOS) { for (ExtendTitlePO extendTitle : extendTitles) {
addGroups.add(new SearchConditionGroup(extendGroupPO.getGroupName(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_JOBEXT : JCL_ORG_JOB, viewAttr, id, extendGroupPO.getId().toString(), "job_no"))); addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, getExtService(user).getExtForm(user, EXTEND_TYPE + "", Integer.parseInt(groupId) >= 0 ? JCL_ORG_JOBEXT : JCL_ORG_JOB, viewAttr, id, extendTitle.getId().toString(), "job_no")));
} }
} }
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();

Loading…
Cancel
Save