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 io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.*; import lombok.experimental.SuperBuilder; import java.math.BigDecimal; import java.util.Date; import java.util.Objects; /** * 岗位审核表 * * @author guixinman * @since 1.0.0 2024-07-05 */ @ApiModel("岗位审核表") @Data @SuperBuilder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class PositionAuditDTO extends BaseDTO { private static final long serialVersionUID = 1L; private Long positionId; private Long orgId; private String orgName; @ApiModelProperty("hr_company主键") private Long companyId; private String companyName; @ApiModelProperty("岗位名称") private String positionName; @ApiModelProperty("招聘标题") private String recruitTitle; @ApiModelProperty("岗位类型") private String positionType; private String positionTypeName; @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; @ApiModelProperty("岗位标签") private String positionTag; private Long addressId; @ApiModelProperty("招聘岗位类型数据字典") private String recruitPositionType; @ApiModelProperty("审核状态 1:待审核 2.审核成功 3.审核失败") private String auditStatus; @ApiModelProperty("审核失败原因") private String auditFailMsg; @ApiModelProperty("版本号") private Integer version; @ApiModelProperty("工作地址") private String detailAddress; private String fileJson; /** * 年龄上限 */ private Integer ageUp; /** * 年龄下限 */ private Integer ageLow; /** * 薪资上限 */ private BigDecimal salaryUp; /** * 薪资下限 */ private BigDecimal salaryLow; /** * 薪资类型 */ private String salaryType; private String salaryStr; private String ageStr; /** * 结束日期 */ @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; public String getSalaryStr() { String salary = ""; if (Objects.nonNull(this.getSalaryUp()) && Objects.nonNull(this.getSalaryLow())) { salary = String.format("%s~%s元/%s", this.getSalaryLow(), this.getSalaryUp(), DictUtils.getCodeNameMap("salary_type").get(String.valueOf(this.getSalaryType()))); if (this.getSalaryLow().compareTo(this.getSalaryUp()) == 0) { salary = String.format("%s元/%s", this.getSalaryUp(), 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(), 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(), 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; } }