columns) {
18 | super(caption, items,columns);
19 | }
20 |
21 | public Object render() {
22 | HSSFWorkbook workbook = new HSSFWorkbook();
23 | String caption = getCaption();
24 | if (StringUtils.isEmpty(caption)) {
25 | caption = "Export";
26 | }
27 | HSSFSheet sheet = workbook.createSheet(caption);
28 |
29 | // renderer header
30 | HSSFRow hssfRow = sheet.createRow(0);
31 | int columncount = 0;
32 | for (HtmlColumn col : getColumns()) {
33 | HSSFCell cell = hssfRow.createCell(columncount++);
34 | cell.setCellValue(new HSSFRichTextString(col.getTitle()));
35 | }
36 |
37 | // renderer body
38 | List> items = getItems();
39 | int rowcount = 1;
40 | for (Object item : items) {
41 | HSSFRow r = sheet.createRow(rowcount++);
42 | columncount = 0;
43 | for (HtmlColumn col : getColumns()) {
44 | HSSFCell cell = r.createCell(columncount++);
45 | Object value = ItemUtils.getItemValue(item, col.getColumn());
46 | if (value == null) {
47 | value = "";
48 | }
49 |
50 | if (value instanceof Number) {
51 | Double number = Double.valueOf(value.toString());
52 | cell.setCellValue(number);
53 | } else {
54 | cell.setCellValue(new HSSFRichTextString(value.toString()));
55 | }
56 | }
57 | }
58 | return workbook;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/sample/core/src/com/sxx/jcc/core/view/ExcelViewExporter.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.core.view;
2 |
3 | import javax.servlet.ServletOutputStream;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.poi.hssf.usermodel.HSSFWorkbook;
7 |
8 |
9 | public class ExcelViewExporter extends AbstractViewExporter {
10 |
11 | public ExcelViewExporter(View view, HttpServletResponse response,
12 | String fileName) {
13 | super(view, response, fileName);
14 | }
15 |
16 | @Override
17 | public String getContextType() {
18 | return "application/vnd.ms-excel;charset=UTF-8";
19 | }
20 |
21 | @Override
22 | public String getExtensionName() {
23 | return "xls";
24 | }
25 |
26 | public void export() throws Exception {
27 | HttpServletResponse response = super.getResponse();
28 | HSSFWorkbook workbook = (HSSFWorkbook) this.getView().render();
29 | responseHeaders(response);
30 | ServletOutputStream out=response.getOutputStream();
31 | workbook.write(out);
32 | out.flush();
33 | out.close();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/sample/core/src/com/sxx/jcc/core/view/ExportType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2004 original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.sxx.jcc.core.view;
17 |
18 | /**
19 | *
20 | * The export types for the table.
21 | *
22 | *
23 | * @since 2.0
24 | * @author Jeff Johnston
25 | */
26 | public enum ExportType {
27 | CSV, EXCEL, JEXCEL, PDF, PDFP;
28 |
29 | public String toParam() {
30 | switch (this) {
31 | case CSV:
32 | return "csv";
33 | case EXCEL:
34 | return "excel";
35 | case JEXCEL:
36 | return "jexcel";
37 | case PDF:
38 | return "pdf";
39 | case PDFP:
40 | return "pdfp";
41 | default:
42 | return "";
43 | }
44 | }
45 |
46 | public static ExportType valueOfParam(String param) {
47 | for (ExportType exportType : ExportType.values()) {
48 | if (exportType.toParam().equals(param)) {
49 | return exportType;
50 | }
51 | }
52 |
53 | return null;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/sample/core/src/com/sxx/jcc/core/view/View.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.core.view;
2 |
3 | public interface View {
4 | public String getCaption();
5 | public Object render();
6 | }
7 |
--------------------------------------------------------------------------------
/sample/core/src/com/sxx/jcc/core/view/ViewExporter.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.core.view;
2 |
3 |
4 | public interface ViewExporter {
5 | public View getView();
6 |
7 | public void setView(View view);
8 |
9 | public void export() throws Exception;
10 | }
11 |
--------------------------------------------------------------------------------
/sample/core/src/com/sxx/jcc/core/view/utils/BeanUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2004 original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.sxx.jcc.core.view.utils;
17 |
18 | import java.lang.reflect.Method;
19 |
20 | import org.apache.log4j.Logger;
21 |
22 | /**
23 | * Utilities for java bean.
24 | *
25 | * @author wliu
26 | */
27 | public class BeanUtils {
28 |
29 | private static final Logger logger = Logger.getLogger(BeanUtils.class);
30 |
31 | /**
32 | * the possible prefixes for read method
33 | */
34 | private static final String[] getterPrefixes = { "get", "is"};
35 |
36 | /**
37 | * Gets the type of a property of an object.
38 | *
39 | * @param object The object that the property belongs to, cannot be null.
40 | * @param property The property to get type, can be nested. for example, 'foo.bar.baz'.
41 | * @return The type of the property. If the property doesn't exists in the object, returns null.
42 | */
43 | public static Class getPropertyType(Object object, String property) {
44 | if (object == null) {
45 | throw new IllegalArgumentException("Object cannot be null.");
46 | }
47 | return getPropertyType(object.getClass(), property);
48 | }
49 |
50 | /**
51 | * Gets the type of a property of a class.
52 | *
53 | * @param clazz The class that the property belongs to, cannot be null.
54 | * @param property The property to get type, can be nested. for example, 'foo.bar.baz'.
55 | * @return The type of the property. If the property doesn't exists in the clazz, returns null.
56 | */
57 | public static Class getPropertyType(Class clazz, String property) {
58 | if (clazz == null) {
59 | throw new IllegalArgumentException("Clazz cannot be null.");
60 | }
61 |
62 | if (property == null) {
63 | throw new IllegalArgumentException("Property cannot be null.");
64 | }
65 |
66 | int dotIndex = property.lastIndexOf('.');
67 |
68 | if (dotIndex == -1) {
69 | Method method = getReadMethod(clazz, property);
70 | return method == null ? null : method.getReturnType();
71 | }
72 |
73 | String deepestProperty = property.substring(dotIndex + 1);
74 | String parentProperty = property.substring(0, dotIndex);
75 | return getPropertyType(getPropertyType(clazz, parentProperty), deepestProperty);
76 | }
77 |
78 | /**
79 | * Gets the read method for a property in a class.
80 | *
81 | * for example:
82 | * class Foo {
83 | * public String getBar() { return "bar"; }
84 | * public Boolean isBaz() { return false; }
85 | * }
86 | *
87 | * BeanUtils.getReadMethod(Foo.class, "bar"); // return Foo#getBar()
88 | * BeanUtils.getReadMethod(Foo.class, "baz"); // return Foo#isBaz()
89 | * BeanUtils.getReadMethod(Foo.class, "baa"); // return null
90 | *
91 | *
92 | * @param clazz The class to get read method.
93 | * @param property The property to get read method for, can NOT be nested.
94 | * @return The read method (getter) for the property, if there is no read method for
95 | * the property, returns null.
96 | */
97 | public static Method getReadMethod(Class clazz, String property) {
98 | // Capitalize the property
99 | StringBuffer buf = new StringBuffer();
100 | buf.append(property.substring(0, 1).toUpperCase());
101 | if (property.length() > 1) {
102 | buf.append(property.substring(1));
103 | }
104 |
105 | Method method = null;
106 | for (String prefix : getterPrefixes) {
107 | String methodName = prefix + buf.toString();
108 | try {
109 | method = clazz.getMethod(methodName);
110 |
111 | // Once get method successfully, jump out the loop.
112 | break;
113 | } catch (NoSuchMethodException e) {
114 | // do nothing but logging
115 | logger.debug("No such read method '" + methodName + "()' in class '" +
116 | clazz.getName() + "'.");
117 | } catch (SecurityException e) {
118 | // do nothing but logging
119 | logger.debug("Error occurs while getting read method '" + methodName + "()' in class '" +
120 | clazz.getName() + "'.");
121 | }
122 | }
123 |
124 | return method;
125 | }
126 | }
--------------------------------------------------------------------------------
/sample/core/src/com/sxx/jcc/core/view/utils/ExportUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2004 original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.sxx.jcc.core.view.utils;
17 |
18 | import org.apache.commons.lang.StringUtils;
19 |
20 | import com.sxx.jcc.core.view.View;
21 |
22 |
23 | /**
24 | *
25 | * Utility class to work with the Exports.
26 | *
27 | *
28 | * @since 2.2
29 | * @author Jeff Johnston
30 | */
31 | public class ExportUtils {
32 |
33 | /**
34 | * Use the view caption for the export. If the caption is not defined then use a default.
35 | *
36 | * @param view The view to export.
37 | * @param exportType The type of view to export.
38 | * @return The file name of export.
39 | */
40 | public static String exportFileName(View view, String exportType) {
41 | String caption = view.getCaption();
42 | if (StringUtils.isNotBlank(caption)) {
43 | StringUtils.replace(caption, " ", "_");
44 | return caption.toLowerCase() + "." + exportType;
45 | }
46 | return "table-data." + exportType;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/sample/core/src/com/sxx/jcc/core/view/utils/ItemUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2004 original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.sxx.jcc.core.view.utils;
17 |
18 | import java.util.Collection;
19 | import java.util.Map;
20 |
21 | import org.apache.commons.beanutils.PropertyUtils;
22 | import org.slf4j.Logger;
23 | import org.slf4j.LoggerFactory;
24 |
25 | /**
26 | * General utilities to process the Collecton of Beans or the Collection of
27 | * Maps. Most methods wrap or add value to the commons Beanutils.
28 | *
29 | * @since 2.1
30 | * @author Jeff Johnston
31 | */
32 | public class ItemUtils {
33 |
34 | private static final Logger logger = LoggerFactory.getLogger(ItemUtils.class);
35 | public static final String JMESA_ITEM = "jmesa-item";
36 |
37 | private ItemUtils() {
38 | // hide constructor
39 | }
40 |
41 | /**
42 | * Get the value from the Bean or Map by property.
43 | *
44 | * @param item The Bean or Map.
45 | * @param property The Bean attribute or Map key.
46 | * @return The value from the Bean or Map.
47 | */
48 | public static Object getItemValue(Object item, String property) {
49 | Object itemValue = null;
50 |
51 | try {
52 | if (item instanceof Map) {
53 | itemValue = ((Map, ?>) item).get(property);
54 | if (itemValue != null) {
55 | return itemValue;
56 | }
57 |
58 | // ports such as the tags will store the original bean
59 | Object bean = ((Map, ?>) item).get(JMESA_ITEM);
60 |
61 | if (bean == null) {
62 | logger.debug("the map does not have property " + property);
63 | return null;
64 | }
65 |
66 | itemValue = getItemValue(bean, property);
67 | } else {
68 | itemValue = PropertyUtils.getProperty(item, property);
69 | }
70 | } catch (Exception e) {
71 | logger.debug("item class " + item.getClass().getName() + " does not have property " + property);
72 | }
73 |
74 | return itemValue;
75 | }
76 |
77 | /**
78 | * Get the Class for the property.
79 | *
80 | * @param items The Collection of Beans or Maps.
81 | * @param property The Bean attribute or Map key.
82 | * @return The Class for the property.
83 | */
84 | public static Class> getPropertyClassType(Collection> items, String property)
85 | throws Exception {
86 |
87 | Object item = items.iterator().next();
88 |
89 | if (item instanceof Map) {
90 | for (Object object : items) {
91 | Map, ?> map = (Map, ?>) object;
92 | Object val = map.get(property);
93 |
94 | if (val == null) {
95 | continue;
96 | }
97 |
98 | return val.getClass();
99 | }
100 | }
101 |
102 | Class> type = null;
103 | try {
104 | type = PropertyUtils.getPropertyType(item, property);
105 | } catch (Exception e) {
106 | if (logger.isDebugEnabled()) {
107 | logger.debug("Had problems getting property type by object, trying reflection...");
108 | }
109 | type = BeanUtils.getPropertyType(item, property);
110 | }
111 | return type;
112 | }
113 | }
--------------------------------------------------------------------------------
/sample/core/src/memcached.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.alisoft.xplatform.asf.cache.memcached.MemcachedErrorHandler
5 |
6 |
7 | com.alisoft.xplatform.asf.cache.memcached.MemcachedErrorHandler
8 |
9 |
11 | 127.0.0.1:11211
12 |
13 |
15 | 127.0.0.1:11211
16 |
17 |
18 | mclient0
19 |
20 |
--------------------------------------------------------------------------------
/sample/core/src/struts.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | exceptionAction
34 | /redirect.jsp
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/sample/temp:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/config/DisruptorConfigure.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.config;
2 |
3 | import java.util.concurrent.Executor;
4 | import java.util.concurrent.Executors;
5 |
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.stereotype.Component;
8 |
9 | import com.lmax.disruptor.BlockingWaitStrategy;
10 | import com.lmax.disruptor.dsl.Disruptor;
11 | import com.lmax.disruptor.dsl.ProducerType;
12 | import com.sxx.jcc.common.utils.disruptor.UserDataEventFactory;
13 | import com.sxx.jcc.common.utils.disruptor.UserEventHandler;
14 | import com.sxx.jcc.common.utils.event.UserDataEvent;
15 |
16 | @Component
17 | public class DisruptorConfigure {
18 | @SuppressWarnings({ "unchecked"})
19 | @Bean(name="disruptor")
20 | public Disruptor disruptor() {
21 | Executor executor = Executors.newCachedThreadPool();
22 | UserDataEventFactory factory = new UserDataEventFactory();
23 | Disruptor disruptor = new Disruptor(factory, 1024, executor, ProducerType.MULTI , new BlockingWaitStrategy());
24 | disruptor.handleEventsWith(new UserEventHandler());
25 | disruptor.start();
26 | return disruptor;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/config/SessionConfigItem.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.config;
2 |
3 | public class SessionConfigItem implements java.io.Serializable{
4 | /**
5 | * 存放客服服务时间段
6 | */
7 | private static final long serialVersionUID = 3520656734252136303L;
8 |
9 | private String workinghours ;
10 | private String type;
11 | private String worktype;
12 | public String getWorkinghours() {
13 | return workinghours;
14 | }
15 | public void setWorkinghours(String workinghours) {
16 | this.workinghours = workinghours;
17 | }
18 | public String getType() {
19 | return type;
20 | }
21 | public void setType(String type) {
22 | this.type = type;
23 | }
24 | public String getWorktype() {
25 | return worktype;
26 | }
27 | public void setWorktype(String worktype) {
28 | this.worktype = worktype;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/AgentReport.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 |
6 | import javax.persistence.Column;
7 | import javax.persistence.Entity;
8 | import javax.persistence.GeneratedValue;
9 | import javax.persistence.Id;
10 | import javax.persistence.Table;
11 |
12 | import org.hibernate.annotations.GenericGenerator;
13 |
14 | import com.sxx.jcc.common.utils.XKTools;
15 |
16 |
17 | @Entity
18 | @Table(name = "xk_webim_monitor")
19 | public class AgentReport implements java.io.Serializable{
20 |
21 | /**
22 | *
23 | */
24 | private static final long serialVersionUID = 5931219598388385394L;
25 |
26 | private String id ;
27 | private Date createtime = new Date();
28 | private int agents ; //坐席数量
29 | private int readyagents ; //就绪坐席
30 | private int incall; //通话中
31 | private int users ; //服务中的用户
32 | private int inquene ; //队列中的用户
33 | private int busy ; //队列中忙的坐席
34 | private String orgi;
35 |
36 | private String worktype ;
37 | private String workresult ;
38 | private String dataid ;
39 |
40 | private String datestr = XKTools.simpleDateFormat.format(new Date());
41 | private String hourstr = new SimpleDateFormat("HH").format(new Date());
42 | private String datehourstr = new SimpleDateFormat("yyyy-MM-dd HH").format(new Date());
43 | public String getOrgi() {
44 | return orgi;
45 | }
46 | public void setOrgi(String orgi) {
47 | this.orgi = orgi;
48 | }
49 | private String type = "status"; //坐席状态
50 |
51 | public int getAgents() {
52 | return agents;
53 | }
54 | public void setAgents(int agents) {
55 | this.agents = agents;
56 | }
57 | public int getUsers() {
58 | return users;
59 | }
60 | public void setUsers(int users) {
61 | this.users = users;
62 | }
63 | public int getInquene() {
64 | return inquene;
65 | }
66 | public void setInquene(int inquene) {
67 | this.inquene = inquene;
68 | }
69 | public String getType() {
70 | return type;
71 | }
72 | public void setType(String type) {
73 | this.type = type;
74 | }
75 | public int getBusy() {
76 | return busy;
77 | }
78 | public void setBusy(int busy) {
79 | this.busy = busy;
80 | }
81 | @Id
82 | @Column(length = 32)
83 | @GeneratedValue(generator = "system-uuid")
84 | @GenericGenerator(name = "system-uuid", strategy = "uuid")
85 | public String getId() {
86 | return id;
87 | }
88 | public void setId(String id) {
89 | this.id = id;
90 | }
91 | public Date getCreatetime() {
92 | return createtime;
93 | }
94 | public void setCreatetime(Date createtime) {
95 | this.createtime = createtime;
96 | }
97 | public String getDatestr() {
98 | return datestr;
99 | }
100 | public void setDatestr(String datestr) {
101 | this.datestr = datestr;
102 | }
103 | public String getHourstr() {
104 | return hourstr;
105 | }
106 | public void setHourstr(String hourstr) {
107 | this.hourstr = hourstr;
108 | }
109 | public String getDatehourstr() {
110 | return datehourstr;
111 | }
112 | public void setDatehourstr(String datehourstr) {
113 | this.datehourstr = datehourstr;
114 | }
115 | public String getWorktype() {
116 | return worktype;
117 | }
118 | public void setWorktype(String worktype) {
119 | this.worktype = worktype;
120 | }
121 | public String getWorkresult() {
122 | return workresult;
123 | }
124 | public void setWorkresult(String workresult) {
125 | this.workresult = workresult;
126 | }
127 | public String getDataid() {
128 | return dataid;
129 | }
130 | public void setDataid(String dataid) {
131 | this.dataid = dataid;
132 | }
133 | public int getReadyagents() {
134 | return readyagents;
135 | }
136 | public void setReadyagents(int readyagents) {
137 | this.readyagents = readyagents;
138 | }
139 | public int getIncall() {
140 | return incall;
141 | }
142 | public void setIncall(int incall) {
143 | this.incall = incall;
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/BlackEntity.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.util.Date;
4 |
5 | import javax.persistence.Column;
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.Id;
9 | import javax.persistence.Table;
10 |
11 | import org.hibernate.annotations.GenericGenerator;
12 |
13 | @Entity
14 | @Table(name = "xk_blacklist")
15 | public class BlackEntity implements java.io.Serializable{
16 | /**
17 | *
18 | */
19 | private static final long serialVersionUID = 7852633351774613958L;
20 | private String id ;
21 | private String orgi ; //orgi
22 | private String userid ; //加黑用户ID
23 | private String contactid ; //联系人ID
24 | private String sessionid ; //当前会话
25 | private Date createtime = new Date() ; //加黑时间
26 |
27 | private int controltime ; //加黑时间,1小时~N小时
28 | private Date endtime ; //结束时间
29 |
30 | private String agentuser ; //用户名
31 |
32 | private String channel ; //渠道
33 | private String creater ; //创建人,和 加黑坐席同一个人
34 | private String agentid ; //加黑坐席
35 | private String phone ; //用户电话
36 | private String openid ; //用户openid
37 | private String agentserviceid ; //agent service id
38 | private String description ; //备注黑名单原因
39 | private int times ; //对话次数
40 | private int chattime ; //最后一次对话时长
41 |
42 | @Id
43 | @Column(length = 32)
44 | @GeneratedValue(generator = "system-uuid")
45 | @GenericGenerator(name = "system-uuid", strategy = "uuid")
46 | public String getId() {
47 | return id;
48 | }
49 | public void setId(String id) {
50 | this.id = id;
51 | }
52 | public String getOrgi() {
53 | return orgi;
54 | }
55 | public void setOrgi(String orgi) {
56 | this.orgi = orgi;
57 | }
58 | public String getUserid() {
59 | return userid;
60 | }
61 | public void setUserid(String userid) {
62 | this.userid = userid;
63 | }
64 | public String getContactid() {
65 | return contactid;
66 | }
67 | public void setContactid(String contactid) {
68 | this.contactid = contactid;
69 | }
70 | public String getSessionid() {
71 | return sessionid;
72 | }
73 | public void setSessionid(String sessionid) {
74 | this.sessionid = sessionid;
75 | }
76 | public Date getCreatetime() {
77 | return createtime;
78 | }
79 | public void setCreatetime(Date createtime) {
80 | this.createtime = createtime;
81 | }
82 | public String getChannel() {
83 | return channel;
84 | }
85 | public void setChannel(String channel) {
86 | this.channel = channel;
87 | }
88 | public String getCreater() {
89 | return creater;
90 | }
91 | public void setCreater(String creater) {
92 | this.creater = creater;
93 | }
94 | public String getAgentid() {
95 | return agentid;
96 | }
97 | public void setAgentid(String agentid) {
98 | this.agentid = agentid;
99 | }
100 | public String getPhone() {
101 | return phone;
102 | }
103 | public void setPhone(String phone) {
104 | this.phone = phone;
105 | }
106 | public String getOpenid() {
107 | return openid;
108 | }
109 | public void setOpenid(String openid) {
110 | this.openid = openid;
111 | }
112 | public String getDescription() {
113 | return description;
114 | }
115 | public void setDescription(String description) {
116 | this.description = description;
117 | }
118 | public String getAgentserviceid() {
119 | return agentserviceid;
120 | }
121 | public void setAgentserviceid(String agentserviceid) {
122 | this.agentserviceid = agentserviceid;
123 | }
124 | public int getTimes() {
125 | return times;
126 | }
127 | public void setTimes(int times) {
128 | this.times = times;
129 | }
130 | public int getChattime() {
131 | return chattime;
132 | }
133 | public void setChattime(int chattime) {
134 | this.chattime = chattime;
135 | }
136 | public int getControltime() {
137 | return controltime;
138 | }
139 | public void setControltime(int controltime) {
140 | this.controltime = controltime;
141 | }
142 | public Date getEndtime() {
143 | return endtime;
144 | }
145 | public void setEndtime(Date endtime) {
146 | this.endtime = endtime;
147 | }
148 | public String getAgentuser() {
149 | return agentuser;
150 | }
151 | public void setAgentuser(String agentuser) {
152 | this.agentuser = agentuser;
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/MessageDataBean.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import com.sxx.jcc.system.pojo.AgentUser;
4 |
5 |
6 | public interface MessageDataBean {
7 |
8 | public String getId() ;
9 |
10 | public String getNickName();
11 |
12 |
13 | public String getOrgi() ;
14 |
15 | /**
16 | * 对话的文本内容
17 | * @return
18 | */
19 | public String getMessage() ;
20 |
21 | /**
22 | * 消息类型
23 | * @return
24 | */
25 | public String getMessageType() ;
26 |
27 | /**
28 | * 来源用户
29 | * @return
30 | */
31 | public String getFromUser() ;
32 |
33 | /**
34 | * 目标用户
35 | * @return
36 | */
37 | public String getToUser();
38 | /**
39 | * 渠道信息
40 | * @return
41 | */
42 | public SNSAccount getSnsAccount();
43 | /**
44 | * 坐席用户信息
45 | * @return
46 | */
47 | public AgentUser getAgentUser() ;
48 |
49 | /**
50 | * 获取渠道来源的消息信息
51 | * @return
52 | */
53 | public Object getChannelMessage() ;
54 |
55 | /**
56 | * 渠道上对应的用户信息
57 | * @return
58 | */
59 | public Object getUser();
60 |
61 |
62 | public void setContextid(String contextid) ;
63 |
64 | public String getContextid() ;
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/MessageInContent.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import com.sxx.jcc.common.utils.XKDataContext;
4 | import com.sxx.jcc.system.pojo.AgentUser;
5 |
6 |
7 |
8 |
9 | public class MessageInContent implements MessageDataBean,java.io.Serializable{
10 |
11 | /**
12 | *
13 | */
14 | private static final long serialVersionUID = 1L;
15 | public String id ;
16 | private String nickName;
17 | private String orgi ;
18 | private String message ;
19 | private String filename ;
20 | private int filesize ;
21 | private String messageType;
22 | private String fromUser;
23 | private String calltype = XKDataContext.CallTypeEnum.IN.toString() ;
24 | private String toUser;
25 | private SNSAccount snsAccount ;
26 | private AgentUser agentUser ;
27 | private Object channelMessage ;
28 | private String agentserviceid ;
29 |
30 | private boolean topic ;
31 |
32 | private int duration ; //音频时长
33 |
34 | private String attachmentid ;
35 |
36 | private boolean noagent ;
37 |
38 | private boolean quickagent ;
39 |
40 | private Object user ;
41 | private String contextid ;
42 | private String createtime ;
43 |
44 | public String getId() {
45 | return id;
46 | }
47 | public void setId(String id) {
48 | this.id = id;
49 | }
50 | public String getNickName() {
51 | return nickName;
52 | }
53 | public void setNickName(String nickName) {
54 | this.nickName = nickName;
55 | }
56 | public String getOrgi() {
57 | return orgi;
58 | }
59 | public void setOrgi(String orgi) {
60 | this.orgi = orgi;
61 | }
62 | public String getMessage() {
63 | return message;
64 | }
65 | public void setMessage(String message) {
66 | this.message = message;
67 | }
68 | public String getMessageType() {
69 | return messageType;
70 | }
71 | public void setMessageType(String messageType) {
72 | this.messageType = messageType;
73 | }
74 | public String getFromUser() {
75 | return fromUser;
76 | }
77 | public void setFromUser(String fromUser) {
78 | this.fromUser = fromUser;
79 | }
80 | public String getToUser() {
81 | return toUser;
82 | }
83 | public void setToUser(String toUser) {
84 | this.toUser = toUser;
85 | }
86 | public SNSAccount getSnsAccount() {
87 | return snsAccount;
88 | }
89 | public void setSnsAccount(SNSAccount snsAccount) {
90 | this.snsAccount = snsAccount;
91 | }
92 | public AgentUser getAgentUser() {
93 | return agentUser;
94 | }
95 | public void setAgentUser(AgentUser agentUser) {
96 | this.agentUser = agentUser;
97 | }
98 | public Object getChannelMessage() {
99 | return channelMessage;
100 | }
101 | public void setChannelMessage(Object channelMessage) {
102 | this.channelMessage = channelMessage;
103 | }
104 | public Object getUser() {
105 | return user;
106 | }
107 | public void setUser(Object user) {
108 | this.user = user;
109 | }
110 | public String getContextid() {
111 | return contextid;
112 | }
113 | public void setContextid(String contextid) {
114 | this.contextid = contextid;
115 | }
116 | public String getCalltype() {
117 | return calltype;
118 | }
119 | public void setCalltype(String calltype) {
120 | this.calltype = calltype;
121 | }
122 | public String getCreatetime() {
123 | return createtime;
124 | }
125 | public void setCreatetime(String createtime) {
126 | this.createtime = createtime;
127 | }
128 | public String getFilename() {
129 | return filename;
130 | }
131 | public void setFilename(String filename) {
132 | this.filename = filename;
133 | }
134 | public int getFilesize() {
135 | return filesize;
136 | }
137 | public void setFilesize(int filesize) {
138 | this.filesize = filesize;
139 | }
140 | public String getAgentserviceid() {
141 | return agentserviceid;
142 | }
143 | public void setAgentserviceid(String agentserviceid) {
144 | this.agentserviceid = agentserviceid;
145 | }
146 | public String getAttachmentid() {
147 | return attachmentid;
148 | }
149 | public void setAttachmentid(String attachmentid) {
150 | this.attachmentid = attachmentid;
151 | }
152 | public boolean isNoagent() {
153 | return noagent;
154 | }
155 | public void setNoagent(boolean noagent) {
156 | this.noagent = noagent;
157 | }
158 | public boolean isTopic() {
159 | return topic;
160 | }
161 | public void setTopic(boolean topic) {
162 | this.topic = topic;
163 | }
164 | public boolean isQuickagent() {
165 | return quickagent;
166 | }
167 | public void setQuickagent(boolean quickagent) {
168 | this.quickagent = quickagent;
169 | }
170 | public int getDuration() {
171 | return duration;
172 | }
173 | public void setDuration(int duration) {
174 | this.duration = duration;
175 | }
176 |
177 | }
178 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/MessageLeave.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.io.Serializable;
4 | import java.util.Date;
5 |
6 | import javax.persistence.Column;
7 | import javax.persistence.Entity;
8 | import javax.persistence.GeneratedValue;
9 | import javax.persistence.Id;
10 | import javax.persistence.Table;
11 |
12 | import org.hibernate.annotations.GenericGenerator;
13 | import org.hibernate.annotations.Proxy;
14 |
15 | @Entity
16 | @Table(name = "xk_message_leave")
17 | @Proxy(lazy = false)
18 | public class MessageLeave implements Serializable{
19 | /**
20 | *
21 | */
22 | private static final long serialVersionUID = MessageLeave.class.hashCode();
23 | private String appid;
24 | private String id;
25 | private String msgDetail;
26 | private String msgEmail;
27 | private String userid;
28 | private Date createDate;
29 |
30 | @Id
31 | @Column(length = 32)
32 | @GeneratedValue(generator = "system-uuid")
33 | @GenericGenerator(name = "system-uuid", strategy = "uuid")
34 | public String getId() {
35 | return id;
36 | }
37 |
38 | public String getAppid() {
39 | return appid;
40 | }
41 |
42 | public void setAppid(String appid) {
43 | this.appid = appid;
44 | }
45 |
46 | public void setId(String id) {
47 | this.id = id;
48 | }
49 |
50 | public String getMsgDetail() {
51 | return msgDetail;
52 | }
53 |
54 | public void setMsgDetail(String msgDetail) {
55 | this.msgDetail = msgDetail;
56 | }
57 |
58 | public String getMsgEmail() {
59 | return msgEmail;
60 | }
61 |
62 | public void setMsgEmail(String msgEmail) {
63 | this.msgEmail = msgEmail;
64 | }
65 |
66 | public String getUserid() {
67 | return userid;
68 | }
69 |
70 | public void setUserid(String userid) {
71 | this.userid = userid;
72 | }
73 |
74 | public Date getCreateDate() {
75 | return createDate;
76 | }
77 |
78 | public void setCreateDate(Date createDate) {
79 | this.createDate = createDate;
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/MessageOutContent.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.util.List;
4 |
5 | import com.sxx.jcc.core.server.message.OtherMessageItem;
6 |
7 | public class MessageOutContent extends MessageInContent{
8 | /**
9 | *
10 | */
11 | private static final long serialVersionUID = 1L;
12 | private List suggest = null ;
13 |
14 | public List getSuggest() {
15 | return suggest;
16 | }
17 |
18 | public void setSuggest(List suggest) {
19 | this.suggest = suggest;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/QuickReply.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.util.Date;
4 |
5 | import javax.persistence.Column;
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.Id;
9 | import javax.persistence.Table;
10 |
11 | import org.hibernate.annotations.GenericGenerator;
12 |
13 | import com.sxx.jcc.common.utils.XKTools;
14 |
15 | @Entity
16 | @Table(name = "uk_quickreply")
17 | public class QuickReply {
18 |
19 | private String id = XKTools.getUUID();
20 |
21 | private String title ; //标题
22 | private String content ; //内容
23 |
24 | private String type ; //公用 /私有
25 | private String creater; //创建人
26 | private Date createtime = new Date(); //创建时间
27 |
28 | private String orgi ; //
29 |
30 | private String cate ; //所属分类
31 |
32 |
33 | @Id
34 | @Column(length = 32)
35 | @GeneratedValue(generator = "system-uuid")
36 | @GenericGenerator(name = "system-uuid", strategy = "assigned")
37 | public String getId() {
38 | return id;
39 | }
40 |
41 | public void setId(String id) {
42 | this.id = id;
43 | }
44 |
45 | public String getTitle() {
46 | return title;
47 | }
48 |
49 | public void setTitle(String title) {
50 | this.title = title;
51 | }
52 |
53 | public String getContent() {
54 | return content;
55 | }
56 |
57 | public void setContent(String content) {
58 | this.content = content;
59 | }
60 |
61 | public String getType() {
62 | return type;
63 | }
64 |
65 | public void setType(String type) {
66 | this.type = type;
67 | }
68 |
69 | public String getCreater() {
70 | return creater;
71 | }
72 |
73 | public void setCreater(String creater) {
74 | this.creater = creater;
75 | }
76 |
77 | public Date getCreatetime() {
78 | return createtime;
79 | }
80 |
81 | public void setCreatetime(Date createtime) {
82 | this.createtime = createtime;
83 | }
84 |
85 | public String getCate() {
86 | return cate;
87 | }
88 |
89 | public void setCate(String cate) {
90 | this.cate = cate;
91 | }
92 |
93 | public String getOrgi() {
94 | return orgi;
95 | }
96 |
97 | public void setOrgi(String orgi) {
98 | this.orgi = orgi;
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/QuickType.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.util.Date;
4 |
5 | import javax.persistence.Column;
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.Id;
9 | import javax.persistence.Table;
10 |
11 | import org.hibernate.annotations.GenericGenerator;
12 |
13 | @Entity
14 | @Table(name = "uk_quick_type")
15 | public class QuickType implements java.io.Serializable{
16 |
17 | /**
18 | *
19 | */
20 | private static final long serialVersionUID = 1115593425069549681L;
21 |
22 | private String id ;
23 | private String name ;
24 | private String code ;
25 |
26 | private int inx; //知识分类排序位置
27 |
28 | private String quicktype ; //个人/公共
29 | private Date createtime ;
30 | private String creater;
31 | private String username ;
32 |
33 | private Date startdate; //有效期开始
34 | private Date enddate ; //有效期结束
35 |
36 | private boolean enable ; //状态是否可用
37 |
38 | private String description ;//分类备注描述信息
39 |
40 | private Date updatetime ;
41 | private String parentid ; //父级ID
42 | private String orgi ;
43 |
44 | @Id
45 | @Column(length = 32)
46 | @GeneratedValue(generator = "system-uuid")
47 | @GenericGenerator(name = "system-uuid", strategy = "uuid")
48 | public String getId() {
49 | return id;
50 | }
51 | public void setId(String id) {
52 | this.id = id;
53 | }
54 | public String getName() {
55 | return name;
56 | }
57 | public void setName(String name) {
58 | this.name = name;
59 | }
60 | public String getCode() {
61 | return code;
62 | }
63 | public void setCode(String code) {
64 | this.code = code;
65 | }
66 | public int getInx() {
67 | return inx;
68 | }
69 | public void setInx(int inx) {
70 | this.inx = inx;
71 | }
72 | public String getQuicktype() {
73 | return quicktype;
74 | }
75 | public void setQuicktype(String quicktype) {
76 | this.quicktype = quicktype;
77 | }
78 | public Date getCreatetime() {
79 | return createtime;
80 | }
81 | public void setCreatetime(Date createtime) {
82 | this.createtime = createtime;
83 | }
84 | public String getCreater() {
85 | return creater;
86 | }
87 | public void setCreater(String creater) {
88 | this.creater = creater;
89 | }
90 | public String getUsername() {
91 | return username;
92 | }
93 | public void setUsername(String username) {
94 | this.username = username;
95 | }
96 | public Date getStartdate() {
97 | return startdate;
98 | }
99 | public void setStartdate(Date startdate) {
100 | this.startdate = startdate;
101 | }
102 | public Date getEnddate() {
103 | return enddate;
104 | }
105 | public void setEnddate(Date enddate) {
106 | this.enddate = enddate;
107 | }
108 | public boolean isEnable() {
109 | return enable;
110 | }
111 | public void setEnable(boolean enable) {
112 | this.enable = enable;
113 | }
114 | public String getDescription() {
115 | return description;
116 | }
117 | public void setDescription(String description) {
118 | this.description = description;
119 | }
120 | public Date getUpdatetime() {
121 | return updatetime;
122 | }
123 | public void setUpdatetime(Date updatetime) {
124 | this.updatetime = updatetime;
125 | }
126 | public String getParentid() {
127 | return parentid;
128 | }
129 | public void setParentid(String parentid) {
130 | this.parentid = parentid;
131 | }
132 | public String getOrgi() {
133 | return orgi;
134 | }
135 | public void setOrgi(String orgi) {
136 | this.orgi = orgi;
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/SocketIOMessage.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | public class SocketIOMessage {
4 | private String message;
5 |
6 | public String getMessage() {
7 | return message;
8 | }
9 |
10 | public void setMessage(String message) {
11 | this.message = message;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/UserTraceHistory.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.util.Date;
4 |
5 | import javax.persistence.Column;
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.Id;
9 | import javax.persistence.Table;
10 |
11 | import org.hibernate.annotations.GenericGenerator;
12 | import org.hibernate.annotations.Proxy;
13 |
14 | import com.sxx.jcc.common.utils.event.UserEvent;
15 |
16 |
17 | @Entity
18 | @Table(name="xk_userevent")
19 | public class UserTraceHistory implements UserEvent {
20 | /**
21 | *
22 | */
23 | private static final long serialVersionUID = -9167939944520945485L;
24 | private String id;
25 | private String orgi;
26 | private String username ;
27 | private String title ;
28 | private Date updatetime = new Date();
29 | private String url ;
30 |
31 | @Id
32 | @Column(length=32)
33 | @GeneratedValue(generator="system-uuid")
34 | @GenericGenerator(name="system-uuid", strategy="assigned")
35 | public String getId() {
36 | return id;
37 | }
38 | public void setId(String id) {
39 | this.id = id;
40 | }
41 | public String getOrgi() {
42 | return orgi;
43 | }
44 | public void setOrgi(String orgi) {
45 | this.orgi = orgi;
46 | }
47 | public String getTitle() {
48 | return title;
49 | }
50 | public void setTitle(String title) {
51 | this.title = title;
52 | }
53 | public Date getUpdatetime() {
54 | return updatetime;
55 | }
56 | public void setUpdatetime(Date updatetime) {
57 | this.updatetime = updatetime;
58 | }
59 | public String getUrl() {
60 | return url;
61 | }
62 | public void setUrl(String url) {
63 | this.url = url;
64 | }
65 | public String getUsername() {
66 | return username;
67 | }
68 | public void setUsername(String username) {
69 | this.username = username;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/pojo/WorkserviceTime.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.pojo;
2 |
3 | import java.util.Date;
4 |
5 | import javax.persistence.Column;
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.Id;
9 | import javax.persistence.Table;
10 |
11 | import org.hibernate.annotations.GenericGenerator;
12 |
13 | @Entity
14 | @Table(name = "xk_workservice_time")
15 | public class WorkserviceTime implements java.io.Serializable{
16 |
17 | /**
18 | *
19 | */
20 | private static final long serialVersionUID = 1115593425069549681L;
21 |
22 | private String id ;
23 | private String timetype ;//日期类型(字典项 com.dic.workservice.time)
24 | private String scope ; //日期范围类型(单天 one/范围 more/ 星期 week)
25 | private String begin ; //日期开始 格式 2018-9-3
26 | private String end ; //日期结束 格式 2018-9-3
27 | private Date createtime ;
28 | private String creater;
29 | private Date updatetime ;
30 | private String orgi ;
31 | private String apply;//适用场景(文字客服 webim / 排班 sche)
32 | private String week;
33 |
34 | public WorkserviceTime(){}
35 |
36 | public WorkserviceTime(String id){
37 | this.id = id ;
38 | }
39 | @Id
40 | @Column(length = 32)
41 | @GeneratedValue(generator = "system-uuid")
42 | @GenericGenerator(name = "system-uuid", strategy = "uuid")
43 | public String getId() {
44 | return id;
45 | }
46 | public void setId(String id) {
47 | this.id = id;
48 | }
49 |
50 | public String getTimetype() {
51 | return timetype;
52 | }
53 |
54 | public void setTimetype(String timetype) {
55 | this.timetype = timetype;
56 | }
57 |
58 | public String getScope() {
59 | return scope;
60 | }
61 |
62 | public void setScope(String scope) {
63 | this.scope = scope;
64 | }
65 |
66 | public String getBegin() {
67 | return begin;
68 | }
69 |
70 | public void setBegin(String begin) {
71 | this.begin = begin;
72 | }
73 |
74 | public String getEnd() {
75 | return end;
76 | }
77 |
78 | public void setEnd(String end) {
79 | this.end = end;
80 | }
81 |
82 | public Date getCreatetime() {
83 | return createtime;
84 | }
85 |
86 | public void setCreatetime(Date createtime) {
87 | this.createtime = createtime;
88 | }
89 |
90 | public String getCreater() {
91 | return creater;
92 | }
93 |
94 | public void setCreater(String creater) {
95 | this.creater = creater;
96 | }
97 |
98 | public Date getUpdatetime() {
99 | return updatetime;
100 | }
101 |
102 | public void setUpdatetime(Date updatetime) {
103 | this.updatetime = updatetime;
104 | }
105 |
106 | public String getOrgi() {
107 | return orgi;
108 | }
109 |
110 | public void setOrgi(String orgi) {
111 | this.orgi = orgi;
112 | }
113 |
114 | public String getApply() {
115 | return apply;
116 | }
117 |
118 | public void setApply(String apply) {
119 | this.apply = apply;
120 | }
121 |
122 | public String getWeek() {
123 | return week;
124 | }
125 |
126 | public void setWeek(String week) {
127 | this.week = week;
128 | }
129 |
130 |
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/queue/AgentStatusBusyOrgiFilterPredicate.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.queue;
2 |
3 | import java.util.Map;
4 |
5 | import org.apache.commons.lang.StringUtils;
6 |
7 | import com.hazelcast.query.Predicate;
8 | import com.sxx.jcc.webim.pojo.AgentStatus;
9 |
10 | public class AgentStatusBusyOrgiFilterPredicate implements Predicate {
11 | /**
12 | *
13 | */
14 | private static final long serialVersionUID = 1236581634096258855L;
15 | private String orgi ;
16 | /**
17 | *
18 | */
19 | public AgentStatusBusyOrgiFilterPredicate(String orgi){
20 | this.orgi = orgi ;
21 | }
22 | public boolean apply(Map.Entry mapEntry) {
23 | return mapEntry.getValue()!=null && !StringUtils.isBlank(orgi) && orgi.equals(mapEntry.getValue().getOrgi()) && mapEntry.getValue().isBusy();
24 | }
25 | }
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/queue/AgentStatusOrgiFilterPredicate.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.queue;
2 |
3 | import java.util.Map;
4 |
5 | import org.apache.commons.lang.StringUtils;
6 |
7 | import com.hazelcast.query.Predicate;
8 | import com.sxx.jcc.webim.pojo.AgentStatus;
9 |
10 | public class AgentStatusOrgiFilterPredicate implements Predicate {
11 | /**
12 | *
13 | */
14 | private static final long serialVersionUID = 1236581634096258855L;
15 | private String orgi ;
16 | /**
17 | *
18 | */
19 | public AgentStatusOrgiFilterPredicate(String orgi){
20 | this.orgi = orgi ;
21 | }
22 |
23 | public boolean apply(Map.Entry mapEntry) {
24 | return mapEntry.getValue()!=null && !StringUtils.isBlank(orgi) && orgi.equals(mapEntry.getValue().getOrgi());
25 | }
26 | }
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/queue/AgentUserOrgiFilterPredicate.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.queue;
2 |
3 | import java.util.Map;
4 |
5 | import org.apache.commons.lang.StringUtils;
6 |
7 | import com.hazelcast.query.Predicate;
8 | import com.sxx.jcc.system.pojo.AgentUser;
9 | /**
10 | * @author liuyonghong
11 | *
12 | */
13 | public class AgentUserOrgiFilterPredicate implements Predicate {
14 |
15 | private static final long serialVersionUID = 1236581634096258855L;
16 | private String orgi;
17 | private String status;
18 |
19 | public AgentUserOrgiFilterPredicate() {
20 | }
21 |
22 | public AgentUserOrgiFilterPredicate(String orgi, String status) {
23 | this.orgi = orgi;
24 | this.status = status;
25 | }
26 |
27 | @Override
28 | public boolean apply(Map.Entry mapEntry) {
29 | return mapEntry.getValue()!=null && mapEntry.getValue().getStatus()!=null && !StringUtils.isBlank(orgi) && orgi.equals(mapEntry.getValue().getOrgi()) && mapEntry.getValue().getStatus()!=null && mapEntry.getValue().getStatus().equals(status);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/sample/webim/src/com/sxx/jcc/webim/rpc/AgentTopicListener.java:
--------------------------------------------------------------------------------
1 | package com.sxx.jcc.webim.rpc;
2 |
3 | import com.hazelcast.core.Message;
4 | import com.hazelcast.core.MessageListener;
5 | public class AgentTopicListener implements MessageListener