3 changed files with 52 additions and 5 deletions
-
42cclqms-java/src/main/java/com/gaotao/common/utils/OaAccountMessage.java
-
12cclqms-java/src/main/java/com/gaotao/modules/workflow/service/impl/OaWorkflowServiceImpl.java
-
3cclqms-java/src/main/java/com/gaotao/modules/workflow/service/impl/WorkflowManageServiceImpl.java
@ -0,0 +1,42 @@ |
|||||
|
package com.gaotao.common.utils; |
||||
|
|
||||
|
/** |
||||
|
* OA 人员映射失败时的提示文案。 |
||||
|
*/ |
||||
|
public final class OaAccountMessage { |
||||
|
|
||||
|
private OaAccountMessage() { |
||||
|
} |
||||
|
|
||||
|
public static String oaUserNotFound(String person, String account) { |
||||
|
return oaUserNotFound(person, null, account); |
||||
|
} |
||||
|
|
||||
|
public static String oaUserNotFound(String personName, String personCode, String account) { |
||||
|
return "未获取到人员[" + formatPerson(personName, personCode) + "]的域控账号[" + formatAccount(account) + "]对应的OA人员!"; |
||||
|
} |
||||
|
|
||||
|
private static String formatPerson(String personName, String personCode) { |
||||
|
String name = trimToEmpty(personName); |
||||
|
String code = trimToEmpty(personCode); |
||||
|
if (!name.isEmpty() && !code.isEmpty() && !name.equals(code)) { |
||||
|
return name + "(" + code + ")"; |
||||
|
} |
||||
|
if (!name.isEmpty()) { |
||||
|
return name; |
||||
|
} |
||||
|
if (!code.isEmpty()) { |
||||
|
return code; |
||||
|
} |
||||
|
return "未知人员"; |
||||
|
} |
||||
|
|
||||
|
private static String formatAccount(String account) { |
||||
|
String value = trimToEmpty(account); |
||||
|
return value.isEmpty() ? "空" : value; |
||||
|
} |
||||
|
|
||||
|
private static String trimToEmpty(String value) { |
||||
|
return value == null ? "" : value.trim(); |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue