feat: add ParameterUtils class
This commit is contained in:
parent
1776c8ee61
commit
f3231395d1
@ -0,0 +1,35 @@
|
||||
package com.xdap.self_development.utils;
|
||||
|
||||
import com.xdap.self_development.domain.pojo.ParameterPojo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ParameterUtils {
|
||||
|
||||
private static final String DEPT_ZHONGQING = "中轻动力平台部";
|
||||
private static final String DEPT_ZHONGZHONG = "中重动力平台部";
|
||||
private static final String DEPT_MERGED = "中轻动力平台部或中重动力平台部";
|
||||
|
||||
private ParameterUtils() {
|
||||
throw new AssertionError("禁止实例化工具类 ParameterUtils");
|
||||
}
|
||||
|
||||
public static void normalizeDepartment(ParameterPojo parameter) {
|
||||
if (parameter == null) {
|
||||
return;
|
||||
}
|
||||
String dept = parameter.getDepartment();
|
||||
if (DEPT_ZHONGQING.equals(dept) || DEPT_ZHONGZHONG.equals(dept)) {
|
||||
parameter.setDepartment(DEPT_MERGED);
|
||||
}
|
||||
}
|
||||
|
||||
public static void normalizeDepartment(List<ParameterPojo> parameters) {
|
||||
if (parameters == null || parameters.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (ParameterPojo parameter : parameters) {
|
||||
normalizeDepartment(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user