|
@@ -39,10 +39,9 @@ public class SapOrgService extends BaseService {
|
|
|
JsonNode userNode = iterator.next();
|
|
|
String externalCode = userNode.get("externalCode").asText().trim();
|
|
|
String externalName = null;
|
|
|
- if (userNode.get("externalName") != null) {
|
|
|
- externalName = userNode.get("externalName").asText().trim();
|
|
|
- } else if (userNode.get("name") != null) {
|
|
|
- externalName = userNode.get("name").asText().trim();
|
|
|
+ if (WebConstants.ORG1.equals(entityName) || WebConstants.ORG2.equals(entityName)
|
|
|
+ || WebConstants.ORG3.equals(entityName)) {
|
|
|
+ externalName = userNode.get("name_zh_CN").asText().trim();
|
|
|
} else {
|
|
|
externalName = userNode.get("externalName_zh_CN").asText().trim();
|
|
|
}
|
|
@@ -72,10 +71,10 @@ public class SapOrgService extends BaseService {
|
|
|
|
|
|
public List<SapUser> setOrg(List<SapUser> sapUsers) throws Exception {
|
|
|
HttpHeaders headers = getHttpHeaders();
|
|
|
- Map<String, String> businessUnitMap = getOrgMap(headers, "FOBusinessUnit");
|
|
|
- Map<String, String> divisionMap = getOrgMap(headers, "FODivision");
|
|
|
- Map<String, String> departmentMap = getOrgMap(headers, "FODepartment");
|
|
|
- Map<String, String> orgunit4Map = getOrgMap(headers, "cust_org4");// cust_orgunit4/cust_org4
|
|
|
+ Map<String, String> businessUnitMap = getOrgMap(headers, WebConstants.ORG1);
|
|
|
+ Map<String, String> divisionMap = getOrgMap(headers, WebConstants.ORG2);
|
|
|
+ Map<String, String> departmentMap = getOrgMap(headers, WebConstants.ORG3);
|
|
|
+ Map<String, String> orgunit4Map = getOrgMap(headers, WebConstants.ORG4);// cust_orgunit4/cust_org4
|
|
|
|
|
|
String userIds = "";
|
|
|
Map<String, SapUser> map = Maps.newHashMap();
|
|
@@ -165,22 +164,22 @@ public class SapOrgService extends BaseService {
|
|
|
SapOrg org = SapOrg.builder().parentId(parentId).build();
|
|
|
return toInfoDetails((List<SapOrg>) findList("SapOrgMapper.selectListByParentId", org));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void updateWxDepartId(SapOrg org) throws Exception {
|
|
|
update("SapOrgMapper.updateWxDepartId", org);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@SuppressWarnings("unchecked")
|
|
|
public List<SapOrg> selectListByName(String name) throws Exception {
|
|
|
return toInfoDetails((List<SapOrg>) findList("SapOrgMapper.selectListByName", name));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public SapOrg selectById(String id) throws Exception {
|
|
|
return (SapOrg) findObject("SapOrgMapper.selectById", id);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public SapOrg toInfoDetail(SapOrg sapOrg) throws Exception {
|
|
|
- if(sapOrg != null) {
|
|
|
+ if (sapOrg != null) {
|
|
|
sapOrg.setParentDepart(selectById(sapOrg.getParentId()));
|
|
|
}
|
|
|
return sapOrg;
|