From 2ed79cc994ee9e8155cbf699271ce5c9ceeb895a Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 14 Jun 2022 13:58:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=88=86?= =?UTF-8?q?=E7=BB=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/表结构SQL/MySQL.sql | 14 +++++ docs/表结构SQL/Oracle.sql | 14 +++++ docs/表结构SQL/SqlServer.sql | 14 +++++ .../entity/extend/po/ExtendTitlePO.java | 49 ++++++++++++++++ .../mapper/extend/ExtendTitleMapper.java | 24 ++++++++ .../mapper/extend/ExtendTitleMapper.xml | 57 +++++++++++++++++++ .../service/impl/CompServiceImpl.java | 26 ++++----- .../service/impl/ExtServiceImpl.java | 16 +++--- 8 files changed, 194 insertions(+), 20 deletions(-) create mode 100644 src/com/engine/organization/entity/extend/po/ExtendTitlePO.java create mode 100644 src/com/engine/organization/mapper/extend/ExtendTitleMapper.java create mode 100644 src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml diff --git a/docs/表结构SQL/MySQL.sql b/docs/表结构SQL/MySQL.sql index 3dc7dd8d..fe065481 100644 --- a/docs/表结构SQL/MySQL.sql +++ b/docs/表结构SQL/MySQL.sql @@ -126,6 +126,20 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP ( 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 CREATE TABLE JCL_FIELD_EXTENDINFO ( id int auto_increment NOT NULL, diff --git a/docs/表结构SQL/Oracle.sql b/docs/表结构SQL/Oracle.sql index ac642a30..cc122eac 100644 --- a/docs/表结构SQL/Oracle.sql +++ b/docs/表结构SQL/Oracle.sql @@ -128,6 +128,20 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP ( 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 CREATE TABLE JCL_FIELD_EXTENDINFO ( ID NUMBER NOT NULL, diff --git a/docs/表结构SQL/SqlServer.sql b/docs/表结构SQL/SqlServer.sql index 909b3fa3..f164c0cd 100644 --- a/docs/表结构SQL/SqlServer.sql +++ b/docs/表结构SQL/SqlServer.sql @@ -126,6 +126,20 @@ CREATE TABLE JCL_FIELD_EXTENDGROUP ( 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 CREATE TABLE JCL_FIELD_EXTENDINFO ( id int IDENTITY(1,1) NOT NULL, diff --git a/src/com/engine/organization/entity/extend/po/ExtendTitlePO.java b/src/com/engine/organization/entity/extend/po/ExtendTitlePO.java new file mode 100644 index 00000000..7d7b5406 --- /dev/null +++ b/src/com/engine/organization/entity/extend/po/ExtendTitlePO.java @@ -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; +} diff --git a/src/com/engine/organization/mapper/extend/ExtendTitleMapper.java b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.java new file mode 100644 index 00000000..a6e0c700 --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.java @@ -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 getTitlesByGroupID(@Param("groupId") String groupId); + + List getTitlesByIds(@Param("ids") Collection ids); +} diff --git a/src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml new file mode 100644 index 00000000..f5ccee0d --- /dev/null +++ b/src/com/engine/organization/mapper/extend/ExtendTitleMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + t + . + id + , t.group_id + , t.title + , show_order + , is_show + , t.creator + , t.delete_type + , t.create_time + , t.update_time + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index 409637ed..4c2235a3 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -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.param.CompSearchParam; 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.extend.ExtendGroupMapper; +import com.engine.organization.mapper.extend.ExtendTitleMapper; import com.engine.organization.service.CompService; import com.engine.organization.service.ExtService; import com.engine.organization.util.HasRightUtil; @@ -75,8 +75,8 @@ public class CompServiceImpl extends Service implements CompService { return MapperProxyFactory.getProxy(CompMapper.class); } - private ExtendGroupMapper getExtendGroupMapper() { - return MapperProxyFactory.getProxy(ExtendGroupMapper.class); + private ExtendTitleMapper getExtendTitleMapper() { + return MapperProxyFactory.getProxy(ExtendTitleMapper.class); } 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 compNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "compNameShort"); - // TODO // 上级公司 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)) { groupId = GROUP_ID.toString(); } - List extendGroupPOS = getExtendGroupMapper().listGroupByPid(Long.parseLong(groupId)); - if (CollectionUtils.isNotEmpty(extendGroupPOS)) { - for (ExtendGroupPO extendGroupPO : extendGroupPOS) { - 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"))); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(groupId); + + if (CollectionUtils.isNotEmpty(extendTitles)) { + 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); Map apiDatas = new HashMap<>(); List addGroups = new ArrayList<>(); - List extendGroupPOS = getExtendGroupMapper().listGroupByPid(GROUP_ID); - if (CollectionUtils.isNotEmpty(extendGroupPOS)) { - for (ExtendGroupPO extendGroupPO : extendGroupPOS) { - 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()))); + List extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID + ""); + if (CollectionUtils.isNotEmpty(extendTitles)) { + for (ExtendTitlePO extendTitle : extendTitles) { + 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); diff --git a/src/com/engine/organization/service/impl/ExtServiceImpl.java b/src/com/engine/organization/service/impl/ExtServiceImpl.java index 24c42183..4f2ea7c1 100644 --- a/src/com/engine/organization/service/impl/ExtServiceImpl.java +++ b/src/com/engine/organization/service/impl/ExtServiceImpl.java @@ -6,13 +6,10 @@ import com.engine.organization.entity.TopTab; import com.engine.organization.entity.codesetting.po.CodeRulePO; import com.engine.organization.entity.extend.ExtendInfoOperateType; 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.ExtendTitlePO; import com.engine.organization.mapper.codesetting.CodeRuleMapper; -import com.engine.organization.mapper.extend.ExtDTMapper; -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.mapper.extend.*; import com.engine.organization.service.ExtService; import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.db.MapperProxyFactory; @@ -49,6 +46,10 @@ public class ExtServiceImpl extends Service implements ExtService { return MapperProxyFactory.getProxy(ExtendGroupMapper.class); } + private ExtendTitleMapper getExtendTitleMapper() { + return MapperProxyFactory.getProxy(ExtendTitleMapper.class); + } + private ExtDTMapper getExtDTMapper() { return MapperProxyFactory.getProxy(ExtDTMapper.class); } @@ -158,8 +159,9 @@ public class ExtServiceImpl extends Service implements ExtService { List infoPOList1 = getExtendInfoMapper().listFields(extendType, "", tableName.toLowerCase().replace("ext", ""), ExtendInfoOperateType.EDIT.getValue()); infoPOList.addAll(infoPOList1); List ids = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList()); - List extendGroupPOS = getExtendGroupMapper().listGroupByIds(ids); - Set extendGroups = extendGroupPOS.stream().map(ExtendGroupPO::getPid).collect(Collectors.toSet()); + List extendTitles = getExtendTitleMapper().getTitlesByIds(ids); + Set extendGroups = extendTitles.stream().map(ExtendTitlePO::getGroupid).collect(Collectors.toSet()); + // 拓展信息 if (CollectionUtils.isNotEmpty(extendGroups)) { for (Long groupId : extendGroups) {