|
@@ -6,6 +6,7 @@ import java.util.List;
|
|
|
import org.fouram.core.base.service.BaseService;
|
|
|
import org.fouram.core.base.service.RequestService;
|
|
|
import org.fouram.core.util.JsonNodeUtil;
|
|
|
+import org.fouram.core.util.Tools;
|
|
|
import org.fouram.entity.SapCertificates;
|
|
|
import org.fouram.entity.SapCourses;
|
|
|
import org.fouram.entity.SapEducation;
|
|
@@ -406,7 +407,7 @@ public class SapReportService extends BaseService {
|
|
|
|
|
|
// 学历教育 Background_Education
|
|
|
public void saveSapEducation(HttpHeaders headers, List<SapUser> sapUsers) throws Exception {
|
|
|
- String url = "https://api15.sapsf.cn/odata/v2/Background_Education?$filter=userId in %s&$format=json&$expand=degreeNav,custom1Nav";
|
|
|
+ String url = "https://api15.sapsf.cn/odata/v2/Background_Education?$filter=userId in %s&$format=json";
|
|
|
url = String.format(url, getUserIds(sapUsers));
|
|
|
JsonNode node = requestService.getForObject(url, headers);
|
|
|
if (node != null) {
|
|
@@ -418,11 +419,10 @@ public class SapReportService extends BaseService {
|
|
|
String endDate = JsonNodeUtil.getValue(userNode, "endDate");// 结束日期
|
|
|
String school = JsonNodeUtil.getValue(userNode, "school");// 院校
|
|
|
String major = JsonNodeUtil.getValue(userNode, "major");// 专业
|
|
|
- String degreeCode = JsonNodeUtil.getValue(userNode, "degreeNav", "externalCode");// 学历
|
|
|
- String qualificationCode = JsonNodeUtil.getValue(userNode, "custom1Nav", "externalCode");// 学位
|
|
|
+ String degree = getLabelValue(JsonNodeUtil.getValue(userNode, "degree"));// 学历
|
|
|
+ String qualification = getLabelValue(JsonNodeUtil.getValue(userNode, "custom1"));// 学位
|
|
|
SapEducation entity = SapEducation.builder().userId(userId).startDate(startDate).endDate(endDate)
|
|
|
- .school(school).major(major).degreeCode(degreeCode).qualificationCode(qualificationCode)
|
|
|
- .build();
|
|
|
+ .school(school).major(major).degree(degree).qualification(qualification).build();
|
|
|
save("SapReportMapper.saveSapEducation", entity);
|
|
|
}
|
|
|
}
|
|
@@ -499,4 +499,14 @@ public class SapReportService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public String getLabelValue(String optionId) {
|
|
|
+ if(Tools.isEmpty(optionId)) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ String url = "https://api15.sapsf.cn/odata/v2/PicklistLabel(locale='zh_CN',optionId=" + optionId
|
|
|
+ + ")?$format=json";
|
|
|
+ JsonNode node = requestService.getForObject(url, getHttpHeaders());
|
|
|
+ return JsonNodeUtil.getValue(node, "d", "label");
|
|
|
+ }
|
|
|
}
|