feat:[REQ-3282] 完善datacollection二方sdk的基础方法
This commit is contained in:
parent
15ddb4b2ea
commit
3f72843c79
@ -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<DataCollectionProfessionResp> batchProfession(String searchKey, boolean includeDetail, Set<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据id获取工种信息
|
||||
*/
|
||||
DataCollectionProfessionResp getProfessionInfo(Long id);
|
||||
|
||||
/**
|
||||
* 根据公司类型获取岗位标签列表
|
||||
* @param searchKey
|
||||
* @param companyType
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionListJobByTypeResp> listJobByType(String searchKey, Integer companyType);
|
||||
|
||||
/**
|
||||
* 获取全量班组类别列表
|
||||
*/
|
||||
List<DataCollectionListTeamCategoryResp> listTeamCategory();
|
||||
|
||||
/**
|
||||
* 根据班组类别编码批量获取班组类别列表
|
||||
*/
|
||||
List<DataCollectionListTeamCategoryByCodesResp> listTeamCategoryByCodes(DataCollectionListTeamCategoryByCodesReq req);
|
||||
|
||||
/**
|
||||
* 通过末级的班组类别code获取班组类别树、工种
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionTeamCategoryResp> listTeamCategoryTreeByCodes(DataCollectionListTeamCategoryTreeByCodesReq req);
|
||||
|
||||
/**
|
||||
* 根据工种id批量获取工种信息及工种归属的班组类别
|
||||
* @param professionIds
|
||||
* @return
|
||||
*/
|
||||
List<DataCollectionListProfessionCategoriesResp> listProfessionCategories(List<Long> professionIds);
|
||||
|
||||
/**
|
||||
* 根据编码批量获取技能标签列表
|
||||
*
|
||||
* @param codes 技能标签编码
|
||||
*/
|
||||
List<DataCollectionListSkillLabelByCodesResp> listSkillLabelByCodes(List<String> codes);
|
||||
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -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<TeamCategory> teamCategories;
|
||||
/**
|
||||
* 班组类别
|
||||
*/
|
||||
@Data
|
||||
public static class TeamCategory {
|
||||
private String categoryCode;
|
||||
private String categoryName;
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<DictBaseInfoResp> specificationModels;
|
||||
/**
|
||||
* 工效
|
||||
*/
|
||||
private List<DictBaseInfoResp> workEfficiencies;
|
||||
/**
|
||||
* 含量比
|
||||
*/
|
||||
private List<DictBaseInfoResp> contentRatios;
|
||||
/**
|
||||
* 报价单位
|
||||
*/
|
||||
private List<DictBaseInfoResp> priceUnits;
|
||||
|
||||
@Data
|
||||
public static class DictBaseInfoResp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 父级编码
|
||||
*/
|
||||
private String parentCode;
|
||||
}
|
||||
}
|
||||
@ -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<String> codes;
|
||||
|
||||
/**
|
||||
* 是否返回所关联工种列表,默认false
|
||||
*/
|
||||
private Boolean includeProfession;
|
||||
|
||||
/**
|
||||
* 是否返回所关联工种的详情信息,如技能标签,默认false
|
||||
*/
|
||||
private Boolean includeProfessionDetail;
|
||||
|
||||
}
|
||||
@ -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<DataCollectionProfessionResp> 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<DataCollectionProfessionResp> professionList;
|
||||
|
||||
/**
|
||||
* 父名称
|
||||
*/
|
||||
private String parentName;
|
||||
}
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -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<String> codes;
|
||||
|
||||
/**
|
||||
* 是否返回所关联工种列表,默认false
|
||||
*/
|
||||
private Boolean includeProfession;
|
||||
|
||||
/**
|
||||
* 是否返回所关联工种的详情信息,如技能标签,默认false
|
||||
*/
|
||||
private Boolean includeProfessionDetail;
|
||||
|
||||
}
|
||||
@ -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<DictBaseInfoResp> workEfficiencys;
|
||||
|
||||
/**
|
||||
* 含量比
|
||||
*/
|
||||
@Deprecated
|
||||
private Set<DictBaseInfoResp> contentRatios;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@Deprecated
|
||||
private Set<DictBaseInfoResp> specificationModels;
|
||||
|
||||
/**
|
||||
* 限价信息
|
||||
*/
|
||||
private List<PriceLimitResp> priceLimit;
|
||||
|
||||
/**
|
||||
* 技能标签
|
||||
*/
|
||||
private List<SkillLabelResp> skillLabel;
|
||||
/**
|
||||
* 工种分类编码列表
|
||||
*/
|
||||
private List<String> 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<DictBaseInfoResp> specificationModels;
|
||||
|
||||
private List<DictBaseInfoResp> contentRatios;
|
||||
|
||||
private List<DictBaseInfoResp> workEfficiencies;
|
||||
|
||||
private List<DictBaseInfoResp> priceUnits;
|
||||
/**
|
||||
* 子集列表
|
||||
*/
|
||||
private List<SkillLabelResp> children;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.axzo.orgmanax.infra.client.datacollection.dto;
|
||||
|
||||
public enum DataCollectionSkillTypeEnum {
|
||||
}
|
||||
@ -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<DataCollectionProfessionResp> professionList;
|
||||
|
||||
/**
|
||||
* 父名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
}
|
||||
@ -51,6 +51,16 @@
|
||||
<artifactId>gaia-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.industry</groupId>
|
||||
<artifactId>data-collection-api</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -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<DataCollectionProfessionResp> batchProfession(String searchKey, boolean includeDetail, Set<Long> ids) {
|
||||
List<ProfessionResp> 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<DataCollectionListJobByTypeResp> listJobByType(String searchKey, Integer companyType) {
|
||||
List<JobResp> list = RpcWrapper.commonRes(() -> dictInfoApi.listJobByType(searchKey, companyType));
|
||||
return BeanUtil.copyToList(list, DataCollectionListJobByTypeResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionListTeamCategoryResp> listTeamCategory() {
|
||||
List<SimpleTeamCategoryResp> list = RpcWrapper.commonRes(dictInfoApi::listTeamCategory);
|
||||
return BeanUtil.copyToList(list, DataCollectionListTeamCategoryResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionListTeamCategoryByCodesResp> listTeamCategoryByCodes(DataCollectionListTeamCategoryByCodesReq req) {
|
||||
TeamCategoryListReq rpcReq = BeanUtil.copyProperties(req, TeamCategoryListReq.class);
|
||||
List<TeamCategoryResp> teamCategoryResps = RpcWrapper.commonRes(() -> dictInfoApi.listTeamCategoryByCodes(rpcReq));
|
||||
return BeanUtil.copyToList(teamCategoryResps, DataCollectionListTeamCategoryByCodesResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionTeamCategoryResp> listTeamCategoryTreeByCodes(DataCollectionListTeamCategoryTreeByCodesReq req) {
|
||||
TeamCategoryListReq rpcReq = BeanUtil.copyProperties(req, TeamCategoryListReq.class);
|
||||
List<TeamCategoryResp> teamCategoryResps = RpcWrapper.commonRes(() -> dictInfoApi.listTeamCategoryByCodes(rpcReq));
|
||||
return BeanUtil.copyToList(teamCategoryResps, DataCollectionTeamCategoryResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionListProfessionCategoriesResp> listProfessionCategories(List<Long> professionIds) {
|
||||
List<ProfessionCategoryResp> list = RpcWrapper.commonRes(() -> dictInfoApi.listProfessionCategories(professionIds));
|
||||
return BeanUtil.copyToList(list, DataCollectionListProfessionCategoriesResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataCollectionListSkillLabelByCodesResp> listSkillLabelByCodes(List<String> codes) {
|
||||
List<SkillLabelInfoResp> list = RpcWrapper.commonRes(() -> dictInfoApi.listSkillLabelByCodes(codes));
|
||||
return BeanUtil.copyToList(list, DataCollectionListSkillLabelByCodesResp.class);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user