岗位查询 薪资字符串修改

This commit is contained in:
guixinman
2025-08-25 10:14:30 +08:00
parent 0ddb3b4529
commit 9e3237f94e

View File

@@ -215,14 +215,14 @@ public class PositionDTO extends BaseDTO {
public String getSalaryStr() { public String getSalaryStr() {
String salary = ""; String salary = "";
if (Objects.nonNull(this.getSalaryUp()) && Objects.nonNull(this.getSalaryLow())) { 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()))); 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) { if (this.getSalaryLow().compareTo(this.getSalaryUp()) == 0) {
salary = String.format("%s元/%s", this.getSalaryUp(), DictUtils.getCodeNameMap("salary_type").get(String.valueOf(this.getSalaryType()))); 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())) { } 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()))); 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())) { } 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()))); 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())) { } else if (Objects.isNull(this.getSalaryLow()) && Objects.isNull(this.getSalaryUp())) {
salary = "薪资面议"; salary = "薪资面议";
} }