diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/DataCollectionDictInfoClient.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/DataCollectionDictInfoClient.java new file mode 100644 index 0000000..ae75f3f --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/DataCollectionDictInfoClient.java @@ -0,0 +1,69 @@ +package cn.axzo.orgmanax.infra.client.datacollection; + +import cn.axzo.orgmanax.infra.client.datacollection.dto.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.validation.Valid; +import java.util.List; +import java.util.Set; + +public interface DataCollectionDictInfoClient { + + /** + * + * @param searchKey + * @param includeDetail + * @param ids + * @return + */ + List batchProfession(String searchKey, boolean includeDetail, Set ids); + + /** + * 根据id获取工种信息 + */ + DataCollectionProfessionResp getProfessionInfo(Long id); + + /** + * 根据公司类型获取岗位标签列表 + * @param searchKey + * @param companyType + * @return + */ + List listJobByType(String searchKey, Integer companyType); + + /** + * 获取全量班组类别列表 + */ + List listTeamCategory(); + + /** + * 根据班组类别编码批量获取班组类别列表 + */ + List listTeamCategoryByCodes(DataCollectionListTeamCategoryByCodesReq req); + + /** + * 通过末级的班组类别code获取班组类别树、工种 + * @param req + * @return + */ + List listTeamCategoryTreeByCodes(DataCollectionListTeamCategoryTreeByCodesReq req); + + /** + * 根据工种id批量获取工种信息及工种归属的班组类别 + * @param professionIds + * @return + */ + List listProfessionCategories(List professionIds); + + /** + * 根据编码批量获取技能标签列表 + * + * @param codes 技能标签编码 + */ + List listSkillLabelByCodes(List codes); + + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListJobByTypeResp.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListJobByTypeResp.java new file mode 100644 index 0000000..dc69d24 --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListJobByTypeResp.java @@ -0,0 +1,32 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +@Data +public class DataCollectionListJobByTypeResp { + + /** + * id + */ + private Long id; + /** + * 名称 + */ + private String name; + /** + * 别名 + */ + private String alias; + /** + * 编码 + */ + private String code; + /** + * 公司类型:1施工单位 2建设单位 3监理单位 4劳务分包 5专业分包 6OMS通用 7企业端通用 + */ + private Integer companyType; + + private String createName; + private String updateName; + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListProfessionCategoriesResp.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListProfessionCategoriesResp.java new file mode 100644 index 0000000..fca5822 --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListProfessionCategoriesResp.java @@ -0,0 +1,39 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class DataCollectionListProfessionCategoriesResp { + + /** + * 工种id + */ + private Long id; + + /** + * 名称 + */ + private String name; + + /** + * 1=普工 2=技术工 + */ + private DataCollectionSkillTypeEnum skillType; + + + /** + * 班组类别 + */ + private List teamCategories; + /** + * 班组类别 + */ + @Data + public static class TeamCategory { + private String categoryCode; + private String categoryName; + } + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListSkillLabelByCodesResp.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListSkillLabelByCodesResp.java new file mode 100644 index 0000000..014a144 --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListSkillLabelByCodesResp.java @@ -0,0 +1,86 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DataCollectionListSkillLabelByCodesResp { + + /** + * 工种id + */ + private Long professionId; + + /** + * 编码 + */ + private String code; + + /** + * 父编码 + */ + private String parentCode; + + /** + * 编码路径 + */ + private String codePath; + + /** + * 名称 + */ + private String name; + + /** + * 别名 + */ + private String alias; + + /** + * 技术类型:1普通,2技工 + */ + private DataCollectionSkillTypeEnum skillType; + + /** + * 规格型号 + */ + private String specificationModel; + /** + * 规格型号 + */ + private List specificationModels; + /** + * 工效 + */ + private List workEfficiencies; + /** + * 含量比 + */ + private List contentRatios; + /** + * 报价单位 + */ + private List priceUnits; + + @Data + public static class DictBaseInfoResp implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 名称 + */ + private String name; + + /** + * 编码 + */ + private String code; + + /** + * 父级编码 + */ + private String parentCode; + } +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryByCodesReq.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryByCodesReq.java new file mode 100644 index 0000000..bb56cb3 --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryByCodesReq.java @@ -0,0 +1,27 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +@Data +public class DataCollectionListTeamCategoryByCodesReq { + + /** + * 班组类别编号 + */ + @NotEmpty(message = "班组类别编号不能为空") + private List codes; + + /** + * 是否返回所关联工种列表,默认false + */ + private Boolean includeProfession; + + /** + * 是否返回所关联工种的详情信息,如技能标签,默认false + */ + private Boolean includeProfessionDetail; + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryByCodesResp.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryByCodesResp.java new file mode 100644 index 0000000..b3e100b --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryByCodesResp.java @@ -0,0 +1,82 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class DataCollectionListTeamCategoryByCodesResp { + + /** + * 编码 + */ + private String categoryCode; + + /** + * 父编码 + */ + private String parentCode; + + /** + * 名称 + */ + private String categoryName; + + /** + * 别名 + */ + private String alias; + /** + * 父级班组类别 + */ + private TeamCategoryResp parentCategory; + + /** + * 工种列表 + */ + private List professionList; + + /** + * 父名称 + */ + private String parentName; + + + @Data + public static class TeamCategoryResp { + /** + * 编码 + */ + private String categoryCode; + + /** + * 父编码 + */ + private String parentCode; + + /** + * 名称 + */ + private String categoryName; + + /** + * 别名 + */ + private String alias; + /** + * 父级班组类别 + */ + private TeamCategoryResp parentCategory; + + /** + * 工种列表 + */ + private List professionList; + + /** + * 父名称 + */ + private String parentName; + } + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryResp.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryResp.java new file mode 100644 index 0000000..7a1b43a --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryResp.java @@ -0,0 +1,28 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +@Data +public class DataCollectionListTeamCategoryResp { + + /** + * 编码 + */ + private String categoryCode; + + /** + * 父编码 + */ + private String parentCode; + + /** + * 名称 + */ + private String categoryName; + + /** + * 别名 + */ + private String alias; + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryTreeByCodesReq.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryTreeByCodesReq.java new file mode 100644 index 0000000..22c41b7 --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionListTeamCategoryTreeByCodesReq.java @@ -0,0 +1,27 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +@Data +public class DataCollectionListTeamCategoryTreeByCodesReq { + + /** + * 班组类别编号 + */ + @NotEmpty(message = "班组类别编号不能为空") + private List codes; + + /** + * 是否返回所关联工种列表,默认false + */ + private Boolean includeProfession; + + /** + * 是否返回所关联工种的详情信息,如技能标签,默认false + */ + private Boolean includeProfessionDetail; + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionProfessionResp.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionProfessionResp.java new file mode 100644 index 0000000..8774c27 --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionProfessionResp.java @@ -0,0 +1,159 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import java.util.Set; + +@Data +public class DataCollectionProfessionResp { + + /** + * 名称 + */ + private String name; + /** + * 别名 + */ + private String alias; + + /** + * 工种id + */ + private Long id; + + /** + * 1=普工 2=技术工 + */ + private Integer skillType = 0; + /** + * 是否持证:0否,1是 + */ + private Integer holdCertificate; + /** + * 技能证书 + */ + private String technicalCertificate; + /** + * 产能 + */ + @Deprecated + private Set workEfficiencys; + + /** + * 含量比 + */ + @Deprecated + private Set contentRatios; + + /** + * 规格型号 + */ + @Deprecated + private Set specificationModels; + + /** + * 限价信息 + */ + private List priceLimit; + + /** + * 技能标签 + */ + private List skillLabel; + /** + * 工种分类编码列表 + */ + private List typeCodeList; + /** + * 班组类别-工种 工种类型 + * 1 主要工种 + * 2 配套工种 + * null 历史数据未设置工种类型 + */ + private Integer relationType; + /** + * 班组类别-工种 权重 + */ + private Integer relationWeight; + + + @Data + public static class DictBaseInfoResp implements Serializable { + + /** + * 名称 + */ + private String name; + + /** + * 编码 + */ + private String code; + + /** + * 父级编码 + */ + private String parentCode; + } + + @Data + public static class PriceLimitResp { + + /** + * 计价类型:1计件,2计时 + */ + private Integer unitPriceType; + /** + * 计价单位 + */ + private String quantityUnit; + /** + * 最低日单价 + */ + private BigDecimal dailyMinUnitPrice; + /** + * 最高日单价 + */ + private BigDecimal dailyMaxUnitPrice; + + /** + * 工种id + */ + private Long professionId; + } + + @Data + public static class SkillLabelResp { + + @JsonIgnore + private Long professionId; + /** + * 编码 + */ + private String code; + /** + * 名称 + */ + private String name; + + private String parentCode; + + private List specificationModels; + + private List contentRatios; + + private List workEfficiencies; + + private List priceUnits; + /** + * 子集列表 + */ + private List children; + + } + +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionSkillTypeEnum.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionSkillTypeEnum.java new file mode 100644 index 0000000..ee2fdba --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionSkillTypeEnum.java @@ -0,0 +1,4 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +public enum DataCollectionSkillTypeEnum { +} diff --git a/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionTeamCategoryResp.java b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionTeamCategoryResp.java new file mode 100644 index 0000000..6aa5d49 --- /dev/null +++ b/orgmanax-infra/src/main/java/cn/axzo/orgmanax/infra/client/datacollection/dto/DataCollectionTeamCategoryResp.java @@ -0,0 +1,44 @@ +package cn.axzo.orgmanax.infra.client.datacollection.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class DataCollectionTeamCategoryResp { + + /** + * 编码 + */ + private String categoryCode; + + /** + * 父编码 + */ + private String parentCode; + + /** + * 名称 + */ + private String categoryName; + + /** + * 别名 + */ + private String alias; + /** + * 父级班组类别 + */ + private DataCollectionListTeamCategoryByCodesResp.TeamCategoryResp parentCategory; + + /** + * 工种列表 + */ + private List professionList; + + /** + * 父名称 + */ + private String parentName; + +} diff --git a/orgmanax-integration/pom.xml b/orgmanax-integration/pom.xml index 2cab36e..5886622 100644 --- a/orgmanax-integration/pom.xml +++ b/orgmanax-integration/pom.xml @@ -51,6 +51,16 @@ gaia-client ${project.version} + + cn.axzo.industry + data-collection-api + + + org.springframework.boot + spring-boot-starter-amqp + + + \ No newline at end of file diff --git a/orgmanax-integration/src/main/java/cn/axzo/orgmanax/integration/sdk/datacollection/DataCollectionDictInfoClientImpl.java b/orgmanax-integration/src/main/java/cn/axzo/orgmanax/integration/sdk/datacollection/DataCollectionDictInfoClientImpl.java new file mode 100644 index 0000000..3a26e4f --- /dev/null +++ b/orgmanax-integration/src/main/java/cn/axzo/orgmanax/integration/sdk/datacollection/DataCollectionDictInfoClientImpl.java @@ -0,0 +1,72 @@ +package cn.axzo.orgmanax.integration.sdk.datacollection; + +import cn.axzo.data.collection.api.DictInfoApi; +import cn.axzo.data.collection.dto.request.JobResp; +import cn.axzo.data.collection.dto.request.TeamCategoryListReq; +import cn.axzo.data.collection.dto.response.*; +import cn.axzo.orgmanax.infra.client.datacollection.DataCollectionDictInfoClient; +import cn.axzo.orgmanax.infra.client.datacollection.dto.*; +import cn.axzo.orgmanax.integration.core.RpcWrapper; +import cn.hutool.core.bean.BeanUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +@RequiredArgsConstructor +@Component +public class DataCollectionDictInfoClientImpl implements DataCollectionDictInfoClient { + + private final DictInfoApi dictInfoApi; + + @Override + public List batchProfession(String searchKey, boolean includeDetail, Set ids) { + List professionResps = RpcWrapper.commonRes(() -> dictInfoApi.batchProfession(searchKey, includeDetail, ids)); + return BeanUtil.copyToList(professionResps, DataCollectionProfessionResp.class); + } + + @Override + public DataCollectionProfessionResp getProfessionInfo(Long id) { + ProfessionResp professionResps = RpcWrapper.commonRes(() -> dictInfoApi.getProfessionInfo(id)); + return BeanUtil.copyProperties(professionResps, DataCollectionProfessionResp.class); + } + + @Override + public List listJobByType(String searchKey, Integer companyType) { + List list = RpcWrapper.commonRes(() -> dictInfoApi.listJobByType(searchKey, companyType)); + return BeanUtil.copyToList(list, DataCollectionListJobByTypeResp.class); + } + + @Override + public List listTeamCategory() { + List list = RpcWrapper.commonRes(dictInfoApi::listTeamCategory); + return BeanUtil.copyToList(list, DataCollectionListTeamCategoryResp.class); + } + + @Override + public List listTeamCategoryByCodes(DataCollectionListTeamCategoryByCodesReq req) { + TeamCategoryListReq rpcReq = BeanUtil.copyProperties(req, TeamCategoryListReq.class); + List teamCategoryResps = RpcWrapper.commonRes(() -> dictInfoApi.listTeamCategoryByCodes(rpcReq)); + return BeanUtil.copyToList(teamCategoryResps, DataCollectionListTeamCategoryByCodesResp.class); + } + + @Override + public List listTeamCategoryTreeByCodes(DataCollectionListTeamCategoryTreeByCodesReq req) { + TeamCategoryListReq rpcReq = BeanUtil.copyProperties(req, TeamCategoryListReq.class); + List teamCategoryResps = RpcWrapper.commonRes(() -> dictInfoApi.listTeamCategoryByCodes(rpcReq)); + return BeanUtil.copyToList(teamCategoryResps, DataCollectionTeamCategoryResp.class); + } + + @Override + public List listProfessionCategories(List professionIds) { + List list = RpcWrapper.commonRes(() -> dictInfoApi.listProfessionCategories(professionIds)); + return BeanUtil.copyToList(list, DataCollectionListProfessionCategoriesResp.class); + } + + @Override + public List listSkillLabelByCodes(List codes) { + List list = RpcWrapper.commonRes(() -> dictInfoApi.listSkillLabelByCodes(codes)); + return BeanUtil.copyToList(list, DataCollectionListSkillLabelByCodesResp.class); + } +}