|
@@ -51,12 +51,12 @@ public class ApiDataOrgUtil {
|
|
|
|
|
|
orgApiDataConfigDTOS.forEach(configDTO -> {
|
|
|
String key = configDTO.getKey();
|
|
|
- Function<T, Object> getDataFunction = configDTO.getGetDataFunction();
|
|
|
+ Function<T, Object> getDataFunction = configDTO.getDataFunction();
|
|
|
Object apply;
|
|
|
if (getDataFunction == null) {
|
|
|
apply = configDTO.getRealValue();
|
|
|
} else {
|
|
|
- apply = configDTO.getGetDataFunction().apply(infos);
|
|
|
+ apply = configDTO.getDataFunction().apply(infos);
|
|
|
}
|
|
|
apiData.put(key, ObjConver(apply, configDTO));
|
|
|
});
|
|
@@ -97,6 +97,49 @@ public class ApiDataOrgUtil {
|
|
|
return renturnObj;
|
|
|
}
|
|
|
|
|
|
+ public static <T> OrgApiDataConfigDTO setOrdinaryDatePattern(String key, Function<T, Object> getDataFunction) {
|
|
|
+ OrgApiDataConfigDTO excelFieldDescDTO = new OrgApiDataConfigDTO();
|
|
|
+ excelFieldDescDTO.setKey(key);
|
|
|
+ excelFieldDescDTO.setDataFunction(getDataFunction);
|
|
|
+ return excelFieldDescDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static <T> OrgApiDataConfigDTO setDatePattern(String key, Function<T, Object> getDataFunction, String datePattern) {
|
|
|
+ OrgApiDataConfigDTO excelFieldDescDTO = new OrgApiDataConfigDTO();
|
|
|
+ excelFieldDescDTO.setKey(key);
|
|
|
+ excelFieldDescDTO.setDataFunction(getDataFunction);
|
|
|
+ excelFieldDescDTO.setDatePattern(datePattern);
|
|
|
+ if (StringUtils.isNotBlank(datePattern)) {
|
|
|
+ excelFieldDescDTO.setDateFlag(true);
|
|
|
+ }
|
|
|
+ return excelFieldDescDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static <T> OrgApiDataConfigDTO setFileInfo(String key,
|
|
|
+ Function<T, Object> getDataFunction,
|
|
|
+ boolean fileFlag) {
|
|
|
+ OrgApiDataConfigDTO excelFieldDescDTO = new OrgApiDataConfigDTO();
|
|
|
+ excelFieldDescDTO.setKey(key);
|
|
|
+ excelFieldDescDTO.setDataFunction(getDataFunction);
|
|
|
+ excelFieldDescDTO.setFileFlag(fileFlag);
|
|
|
+ return excelFieldDescDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static <T> OrgApiDataConfigDTO setRealValue(String key,
|
|
|
+ Object realValue,
|
|
|
+ String datePattern,
|
|
|
+ boolean fileFlag) {
|
|
|
+ OrgApiDataConfigDTO excelFieldDescDTO = new OrgApiDataConfigDTO();
|
|
|
+ excelFieldDescDTO.setKey(key);
|
|
|
+ excelFieldDescDTO.setRealValue(realValue);
|
|
|
+ excelFieldDescDTO.setDatePattern(datePattern);
|
|
|
+ if (StringUtils.isNotBlank(datePattern)) {
|
|
|
+ excelFieldDescDTO.setDateFlag(true);
|
|
|
+ }
|
|
|
+ excelFieldDescDTO.setFileFlag(fileFlag);
|
|
|
+ return excelFieldDescDTO;
|
|
|
+ }
|
|
|
+
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
|
attendanceAssessmentSdk = autoAttendanceAssessmentSdk;
|