|
@@ -18,7 +18,7 @@ public abstract class BaseService {
|
|
|
|
|
|
@Resource(name = "daoSupport")
|
|
@Resource(name = "daoSupport")
|
|
private DAO dao;
|
|
private DAO dao;
|
|
-
|
|
|
|
|
|
+
|
|
public Integer save(String sqlStr, Object paramObj) throws Exception {
|
|
public Integer save(String sqlStr, Object paramObj) throws Exception {
|
|
return dao.save(sqlStr, paramObj);
|
|
return dao.save(sqlStr, paramObj);
|
|
}
|
|
}
|
|
@@ -38,7 +38,7 @@ public abstract class BaseService {
|
|
public Object findList(String sqlStr, Object paramObj) throws Exception {
|
|
public Object findList(String sqlStr, Object paramObj) throws Exception {
|
|
return dao.findForList(sqlStr, paramObj);
|
|
return dao.findForList(sqlStr, paramObj);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public HttpHeaders getHttpHeaders() {
|
|
public HttpHeaders getHttpHeaders() {
|
|
HttpHeaders headers = new HttpHeaders();
|
|
HttpHeaders headers = new HttpHeaders();
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
@@ -47,14 +47,14 @@ public abstract class BaseService {
|
|
headers.add("Authorization", authorizationStr);
|
|
headers.add("Authorization", authorizationStr);
|
|
return headers;
|
|
return headers;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
String sapApiUser = ConfConfig.getConfigString("sapApi.user");
|
|
String sapApiUser = ConfConfig.getConfigString("sapApi.user");
|
|
String authorizationStr = stringBuilder.append("Basic ").append(Base64Util.encodeString(sapApiUser)).toString();
|
|
String authorizationStr = stringBuilder.append("Basic ").append(Base64Util.encodeString(sapApiUser)).toString();
|
|
System.out.println(authorizationStr);
|
|
System.out.println(authorizationStr);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public String getPersonIds(List<SapUser> sapUsers) {
|
|
public String getPersonIds(List<SapUser> sapUsers) {
|
|
String personIds = "";
|
|
String personIds = "";
|
|
for (SapUser sapUser : sapUsers) {
|
|
for (SapUser sapUser : sapUsers) {
|
|
@@ -70,7 +70,7 @@ public abstract class BaseService {
|
|
}
|
|
}
|
|
return userIds;
|
|
return userIds;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public static String formatPosition(String str) {
|
|
public static String formatPosition(String str) {
|
|
if(Tools.isEmpty(str)) {
|
|
if(Tools.isEmpty(str)) {
|
|
return "";
|
|
return "";
|
|
@@ -78,7 +78,7 @@ public abstract class BaseService {
|
|
str = str.replace("\n", "");
|
|
str = str.replace("\n", "");
|
|
return str;
|
|
return str;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public static String formatBusinessPhone(String str) {
|
|
public static String formatBusinessPhone(String str) {
|
|
if(Tools.isEmpty(str)) {
|
|
if(Tools.isEmpty(str)) {
|
|
return "";
|
|
return "";
|
|
@@ -87,6 +87,10 @@ public abstract class BaseService {
|
|
if(str.length() == 12) {
|
|
if(str.length() == 12) {
|
|
str = str.replace(" ", "-");
|
|
str = str.replace(" ", "-");
|
|
}
|
|
}
|
|
|
|
+ if(str.indexOf("x")>-1){
|
|
|
|
+ str = str.substring(0,str.indexOf("x"));
|
|
|
|
+ }
|
|
return str;
|
|
return str;
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
+}
|