|
@@ -19,6 +19,8 @@ import p2.util.P2Exception;
|
|
|
import java.lang.reflect.Constructor;
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.sql.Connection;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
public class Controller extends BaseClass {
|
|
@@ -533,15 +535,15 @@ public class Controller extends BaseClass {
|
|
|
*/
|
|
|
public String getHeadPic(long userid) {
|
|
|
// if (!headPicMap.containsKey(userid)) {
|
|
|
- Rows rows = getAttachmentUrl("tenterprise_users", String.valueOf(userid), "headportrait");
|
|
|
- if (!rows.isEmpty()) {
|
|
|
- if(rows.get(0).getString("fobsurl_thumbnail").equals("")){
|
|
|
- headPicMap.put(userid, rows.get(0).getString("fobsurl"));
|
|
|
- }else{
|
|
|
- headPicMap.put(userid, rows.get(0).getString("fobsurl_thumbnail"));
|
|
|
- }
|
|
|
-
|
|
|
+ Rows rows = getAttachmentUrl("tenterprise_users", String.valueOf(userid), "headportrait");
|
|
|
+ if (!rows.isEmpty()) {
|
|
|
+ if (rows.get(0).getString("fobsurl_thumbnail").equals("")) {
|
|
|
+ headPicMap.put(userid, rows.get(0).getString("fobsurl"));
|
|
|
+ } else {
|
|
|
+ headPicMap.put(userid, rows.get(0).getString("fobsurl_thumbnail"));
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
// }
|
|
|
return headPicMap.getOrDefault(userid, "");
|
|
|
}
|
|
@@ -666,7 +668,7 @@ public class Controller extends BaseClass {
|
|
|
/**
|
|
|
* 通知前端执行指定方法
|
|
|
*/
|
|
|
- public void sendSystemWebSocketMessage(String classname, String method,long userid) {
|
|
|
+ public void sendSystemWebSocketMessage(String classname, String method, long userid) {
|
|
|
if (parameter.websocketClients.containsKey(userid)) {
|
|
|
JSONObject methodobject = new JSONObject();
|
|
|
methodobject.put("type", "callmethod");
|
|
@@ -677,6 +679,7 @@ public class Controller extends BaseClass {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 通知前端执行指定方法
|
|
|
*/
|
|
@@ -836,4 +839,19 @@ public class Controller extends BaseClass {
|
|
|
public Date getLoginDate(long userid) {
|
|
|
return parameter.loginDate.getOrDefault(userid, getDateTime());
|
|
|
}
|
|
|
+
|
|
|
+ public long getTimestamp(String time) {
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ Date date = null;
|
|
|
+ try {
|
|
|
+ date = format.parse(time);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //日期转时间戳(毫秒)
|
|
|
+ return date.getTime();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|