|
@@ -32,6 +32,7 @@ import com.goafanti.common.enums.DeleteStatus;
|
|
|
import com.goafanti.common.enums.DemandAuditStatus;
|
|
import com.goafanti.common.enums.DemandAuditStatus;
|
|
|
import com.goafanti.common.enums.DemandDataCategory;
|
|
import com.goafanti.common.enums.DemandDataCategory;
|
|
|
import com.goafanti.common.enums.DemandFields;
|
|
import com.goafanti.common.enums.DemandFields;
|
|
|
|
|
+import com.goafanti.common.enums.DemandImportFields;
|
|
|
import com.goafanti.common.model.AftFile;
|
|
import com.goafanti.common.model.AftFile;
|
|
|
import com.goafanti.common.model.Demand;
|
|
import com.goafanti.common.model.Demand;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
@@ -496,22 +497,26 @@ public class AdminDemandApiController extends CertifyApiController {
|
|
|
Field[] field = DemandImportBo.class.getDeclaredFields();
|
|
Field[] field = DemandImportBo.class.getDeclaredFields();
|
|
|
for (DemandImportBo bo : data) {
|
|
for (DemandImportBo bo : data) {
|
|
|
for (Field f : field) {
|
|
for (Field f : field) {
|
|
|
- f.setAccessible(true);
|
|
|
|
|
try {
|
|
try {
|
|
|
- if (!f.getName().equals("keywords") && (f.get(bo) == null || "".equals(f.get(bo)))) {
|
|
|
|
|
|
|
+ Object fo = f.get(bo);
|
|
|
|
|
+ f.setAccessible(true);
|
|
|
|
|
+ String fn = f.getName();
|
|
|
|
|
+ if (!fn.equals("keywords") && (fo == null || "".equals(fo))) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "",
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "",
|
|
|
- AchievementImportFields.getFieldDesc(f.getName())));
|
|
|
|
|
|
|
+ DemandImportFields.getFieldDesc(fn)));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
} catch (IllegalArgumentException | IllegalAccessException e) {
|
|
} catch (IllegalArgumentException | IllegalAccessException e) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
String[] keywords = bo.getKeyword().trim().split(",|,");
|
|
String[] keywords = bo.getKeyword().trim().split(",|,");
|
|
|
if (null == keywords || keywords.length < 1) {
|
|
if (null == keywords || keywords.length < 1) {
|
|
|
res.getError()
|
|
res.getError()
|
|
|
.add(buildError(ErrorConstants.PARAM_ERROR, "", AchievementImportFields.KEYWORD.getDesc()));
|
|
.add(buildError(ErrorConstants.PARAM_ERROR, "", AchievementImportFields.KEYWORD.getDesc()));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
|
for (String s : keywords) {
|
|
for (String s : keywords) {
|
|
|
if (!StringUtils.isBlank(s)) {
|
|
if (!StringUtils.isBlank(s)) {
|