package com.newyetai.recruit.position.dto; import com.fasterxml.jackson.annotation.JsonFormat; import com.newyetai.common.dto.BaseDTO; import com.newyetai.component.dict.util.DictUtils; import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Objects; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.*; import lombok.experimental.SuperBuilder; /** * 岗位信息表;岗位信息表 * * @author guixinman * @since 1.0.0 2024-04-11 */ @ApiModel("岗位信息表;岗位信息表") @Data @SuperBuilder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class PositionDTO extends BaseDTO { private static final long serialVersionUID = 1L; @ApiModelProperty("机构ID") private Long orgId; @ApiModelProperty("公司ID ;hr_company") private Long companyId; private String companyName; @ApiModelProperty("岗位状态:1:开启 2:关闭") private String status; @ApiModelProperty("岗位名称") private String positionName; @ApiModelProperty("招聘标题") private String recruitTitle; @ApiModelProperty("岗位类型") private String positionType; private String positionTypeName; @ApiModelProperty("岗位标签") private String positionTag; @ApiModelProperty("工作性质;工作性质 1:短工 2:全职") private String jobCategory; @ApiModelProperty("岗位招聘人数") private Integer positionNumber; @ApiModelProperty("工作地址") private String positionAddress; @ApiModelProperty("招聘专员") private Long recruitUserId; @ApiModelProperty("发薪日") private String payDate; @ApiModelProperty("性别要求") private String sexRequire; @ApiModelProperty("学历要求") private String educationRequire; @ApiModelProperty("经验要求") private String experienceRequire; @ApiModelProperty("证件要求") private String certificatesRequire; @ApiModelProperty("其他要求") private String otherRequire; @ApiModelProperty("工作内容") private String jobContent; private String companyLogo; @ApiModelProperty("招聘负责人名称") private String recruitUserRealName; private String recruitUserAvatar; private String recruitUserPhone; private String positionFileCode; private String companyRegisterAddress; private List positionFileDTOS; @ApiModelProperty("状态:1已报名、2待面试、3面试不通过、4待入职、5已入职、 6已离职、 7结束招聘") private String positionRegistrationStatus; /** * 是否收藏 */ private Boolean isCollection; @ApiModelProperty("工作地址id") private Long addressId; /** * 区域编码(31) */ private String districtCode; /** * 区域名称 (上海市) */ private String districtName; /** * 详细地址 (浦东新区黄金大厦B座) */ private String detailAddress; /** * 经度 */ private BigDecimal longitude; /** * 纬度 */ private BigDecimal latitude; /** * 招聘岗位类型 */ private String recruitPositionType; private String recruitPositionTypeName; /** * 年龄上限 */ private Integer ageUp; /** * 年龄下限 */ private Integer ageLow; /** * 薪资上限 */ private BigDecimal salaryUp; /** * 薪资下限 */ private BigDecimal salaryLow; /** * 薪资类型 */ private String salaryType; private String salaryStr; private String ageStr; private Boolean canShow; @ApiModelProperty("报名时间") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date positionRegistrationCreateTime; @ApiModelProperty("面试时间") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date interviewTime; @ApiModelProperty("面试地点") private String interviewLocation; @ApiModelProperty("备注") private String remark; @ApiModelProperty("入职时间") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date inductionTime; @ApiModelProperty("入职薪资") private BigDecimal positionRegistrationSalary; /** * 结束日期 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date endTime; /** * 米 */ private Long distance; public String getSalaryStr() { String salary = ""; if (Objects.nonNull(this.getSalaryUp()) && Objects.nonNull(this.getSalaryLow())) { salary = String.format("%s~%s元/%s", this.getSalaryLow().stripTrailingZeros().toPlainString(), this.getSalaryUp().stripTrailingZeros().toPlainString(), DictUtils.getCodeNameMap("salary_type").get(String.valueOf(this.getSalaryType()))); if (this.getSalaryLow().compareTo(this.getSalaryUp()) == 0) { salary = String.format("%s元/%s", this.getSalaryUp().stripTrailingZeros().toPlainString(), DictUtils.getCodeNameMap("salary_type").get(String.valueOf(this.getSalaryType()))); } } else if (Objects.nonNull(this.getSalaryLow()) && Objects.isNull(this.getSalaryUp())) { salary = String.format("%s元/%s", this.getSalaryLow().stripTrailingZeros().toPlainString(), DictUtils.getCodeNameMap("salary_type").get(String.valueOf(this.getSalaryType()))); } else if (Objects.isNull(this.getSalaryLow()) && Objects.nonNull(this.getSalaryUp())) { salary = String.format("%s元/%s", this.getSalaryUp().stripTrailingZeros().toPlainString(), DictUtils.getCodeNameMap("salary_type").get(String.valueOf(this.getSalaryType()))); } else if (Objects.isNull(this.getSalaryLow()) && Objects.isNull(this.getSalaryUp())) { salary = "薪资面议"; } return salary; } public String getAgeStr() { String age = ""; if (Objects.nonNull(this.getAgeLow()) && Objects.nonNull(this.getAgeUp())) { age = String.format("%s至%s岁", this.getAgeLow(), this.getAgeUp()); if (this.getAgeLow().intValue() == this.getAgeUp().intValue()) { age = String.format("%s岁", this.getAgeUp()); } } else if (Objects.nonNull(this.getAgeLow()) && Objects.isNull(this.getAgeUp())) { age = String.format("%s岁以上", this.getAgeLow()); } else if (Objects.isNull(this.getAgeLow()) && Objects.nonNull(this.getAgeUp())) { age = String.format("18至%s岁", this.getAgeUp()); } else if (Objects.isNull(this.getAgeLow()) && Objects.isNull(this.getAgeUp())) { age = "18岁以上"; } return age; } }