From 72545a9db7825841384eb26664e9c89ebb76a83d Mon Sep 17 00:00:00 2001 From: "dengchao@xgtl" <2325690622@qq.com> Date: Thu, 16 Apr 2020 10:13:54 +0800 Subject: [PATCH] Replace FieldType.String with FieldType.Text --- .../com/chatopera/cc/model/Favorites.java | 202 ++++------ .../chatopera/cc/model/KbsTopicComment.java | 328 +++++----------- .../com/chatopera/cc/model/OrdersComment.java | 360 +++++------------- 3 files changed, 259 insertions(+), 631 deletions(-) diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java b/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java index 393f24ac..36d8acdd 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/Favorites.java @@ -1,137 +1,65 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2019 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.chatopera.cc.model; - -import com.chatopera.cc.basic.MainUtils; -import org.hibernate.annotations.GenericGenerator; -import org.springframework.data.elasticsearch.annotations.Document; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldType; -import org.springframework.data.elasticsearch.annotations.Parent; - -import javax.persistence.*; -import java.util.Date; - -@Document(indexName = "cskefu", type = "favorites" , createIndex = false ) -@Entity -@Table(name = "uk_favorites") -@org.hibernate.annotations.Proxy(lazy = false) -public class Favorites implements java.io.Serializable{ - - /** - * - */ - private static final long serialVersionUID = 8667838872697390231L; - private String id = MainUtils.getUUID(); - private String name ; - private String code = "true"; - private String title ; - private String model ; - - @Field(type = FieldType.String, store = true) - @Parent(type = "uk_workorders") - private String orderid ; - - private WorkOrders workOrders; - - - private Date createtime = new Date(); - - private Date updatetime = new Date(); - private String creater; - private String username ; - private String orgi ; - - @Id - @Column(length = 32) - @GeneratedValue(generator= "paymentableGenerator") - @GenericGenerator(name= "paymentableGenerator",strategy = "assigned") - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getCode() { - return code; - } - public void setCode(String code) { - this.code = code; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getModel() { - return model; - } - public void setModel(String model) { - this.model = model; - } - public Date getCreatetime() { - return createtime; - } - public void setCreatetime(Date createtime) { - this.createtime = createtime; - } - public String getCreater() { - return creater; - } - public void setCreater(String creater) { - this.creater = creater; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public Date getUpdatetime() { - return updatetime; - } - public void setUpdatetime(Date updatetime) { - this.updatetime = updatetime; - } - public String getOrgi() { - return orgi; - } - public void setOrgi(String orgi) { - this.orgi = orgi; - } - @Transient - public WorkOrders getWorkOrders() { - return workOrders; - } - public void setWorkOrders(WorkOrders workOrders) { - this.workOrders = workOrders; - } - public String getOrderid() { - return orderid; - } - public void setOrderid(String orderid) { - this.orderid = orderid; - } -} +/* + * Copyright (C) 2017 优客服-多渠道客服系统 + * Modifications copyright (C) 2018-2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.chatopera.cc.model; + +import com.chatopera.cc.basic.MainUtils; +import lombok.Data; +import org.hibernate.annotations.GenericGenerator; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.Parent; + +import javax.persistence.*; +import java.util.Date; + +@Data +@Document(indexName = "cskefu", type = "favorites", createIndex = false) +@Entity +@Table(name = "uk_favorites") +@org.hibernate.annotations.Proxy(lazy = false) +public class Favorites implements java.io.Serializable { + private static final long serialVersionUID = 8667838872697390231L; + private String id = MainUtils.getUUID(); + private String name; + private String code = "true"; + private String title; + private String model; + @Field(type = FieldType.Text, store = true) + @Parent(type = "uk_workorders") + private String orderid; + private WorkOrders workOrders; + private Date createtime = new Date(); + private Date updatetime = new Date(); + private String creater; + private String username; + private String orgi; + + @Id + @Column(length = 32) + @GeneratedValue(generator = "paymentableGenerator") + @GenericGenerator(name = "paymentableGenerator", strategy = "assigned") + public String getId() { + return id; + } + + @Transient + public WorkOrders getWorkOrders() { + return workOrders; + } +} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java index 193f5326..95d54ae2 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/KbsTopicComment.java @@ -1,225 +1,103 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2019 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package com.chatopera.cc.model; - -import com.chatopera.cc.basic.MainUtils; -import org.hibernate.annotations.GenericGenerator; -import org.springframework.data.elasticsearch.annotations.Document; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldIndex; -import org.springframework.data.elasticsearch.annotations.FieldType; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Transient; -import java.util.Date; -@Document(indexName = "cskefu", type = "kbs_topiccomment") -public class KbsTopicComment implements UKAgg{ - - /** - * - */ - private static final long serialVersionUID = -4911955236794918875L; - private String id = MainUtils.getUUID(); - private String username; - private String creater ; - - private Date createtime = new Date() ; - - @Field(index = FieldIndex.not_analyzed , type = FieldType.String) - private String dataid ; - - private String content ; //评论内容 - - private Date updatetime = new Date() ; - - private boolean optimal ; //是否最佳答案 - - private int up ; //点赞数量 - private int comments ; //回复数量 - - private boolean admin ; - - private String cate ; - - private String optype ; - private String ipcode ; - private String country ; - private String province ; - private String city ; - private String isp ; - private String region ; - - private int rowcount ; - private String key ; - - private Topic topic ; - - private User user ; - - @Id - @Column(length = 32) - @GeneratedValue(generator = "system-uuid") - @GenericGenerator(name = "system-uuid", strategy = "uuid") - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public String getCreater() { - return creater; - } - public void setCreater(String creater) { - this.creater = creater; - } - public Date getCreatetime() { - return createtime; - } - public void setCreatetime(Date createtime) { - this.createtime = createtime; - } - public String getIpcode() { - return ipcode; - } - public void setIpcode(String ipcode) { - this.ipcode = ipcode; - } - public String getCountry() { - return country; - } - public void setCountry(String country) { - this.country = country; - } - public String getProvince() { - return province; - } - public void setProvince(String province) { - this.province = province; - } - public String getCity() { - return city; - } - public void setCity(String city) { - this.city = city; - } - public String getIsp() { - return isp; - } - public void setIsp(String isp) { - this.isp = isp; - } - public String getRegion() { - return region; - } - public void setRegion(String region) { - this.region = region; - } - public String getDataid() { - return dataid; - } - public void setDataid(String dataid) { - this.dataid = dataid; - } - public String getOptype() { - return optype; - } - public void setOptype(String optype) { - this.optype = optype; - } - public String getContent() { - return content; - } - public void setContent(String content) { - this.content = content; - } - public boolean isOptimal() { - return optimal; - } - public void setOptimal(boolean optimal) { - this.optimal = optimal; - } - public boolean isAdmin() { - return admin; - } - public void setAdmin(boolean admin) { - this.admin = admin; - } - public int getUp() { - return up; - } - public void setUp(int up) { - this.up = up; - } - public int getComments() { - return comments; - } - public void setComments(int comments) { - this.comments = comments; - } - public Date getUpdatetime() { - return updatetime; - } - public void setUpdatetime(Date updatetime) { - this.updatetime = updatetime; - } - @Transient - public Topic getTopic() { - return topic; - } - public void setTopic(Topic topic) { - this.topic = topic; - } - @Transient - public User getUser() { - return user; - } - public void setUser(User user) { - this.user = user; - } - public String getCate() { - return cate; - } - public void setCate(String cate) { - this.cate = cate; - } - @Transient - public int getRowcount() { - return rowcount; - } - public void setRowcount(int rowcount) { - this.rowcount = rowcount; - } - @Transient - public String getKey() { - return key; - } - public void setKey(String key) { - this.key = key; - } - - -} +/* + * Copyright (C) 2017 优客服-多渠道客服系统 + * Modifications copyright (C) 2018-2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package com.chatopera.cc.model; + +import com.chatopera.cc.basic.MainUtils; +import lombok.Data; +import org.hibernate.annotations.GenericGenerator; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Transient; +import java.util.Date; + +@Data +@Document(indexName = "cskefu", type = "kbs_topiccomment") +public class KbsTopicComment implements UKAgg { + + private static final long serialVersionUID = -4911955236794918875L; + private String id = MainUtils.getUUID(); + private String username; + private String creater; + + private Date createtime = new Date(); + + @Field(index = false, type = FieldType.Text) + private String dataid; + + private String content; //评论内容 + + private Date updatetime = new Date(); + + private boolean optimal; //是否最佳答案 + + private int up; //点赞数量 + private int comments; //回复数量 + + private boolean admin; + + private String cate; + + private String optype; + private String ipcode; + private String country; + private String province; + private String city; + private String isp; + private String region; + + private int rowcount; + private String key; + + private Topic topic; + + private User user; + + @Id + @Column(length = 32) + @GeneratedValue(generator = "system-uuid") + @GenericGenerator(name = "system-uuid", strategy = "uuid") + public String getId() { + return id; + } + + @Transient + public Topic getTopic() { + return topic; + } + + @Transient + public User getUser() { + return user; + } + + @Transient + public int getRowcount() { + return rowcount; + } + + @Transient + public String getKey() { + return key; + } +} diff --git a/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java b/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java index 15ccf91b..3fb236c7 100644 --- a/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java +++ b/contact-center/app/src/main/java/com/chatopera/cc/model/OrdersComment.java @@ -1,269 +1,91 @@ -/* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2019 Chatopera Inc, - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.chatopera.cc.model; - -import com.chatopera.cc.basic.MainUtils; -import org.hibernate.annotations.GenericGenerator; -import org.springframework.data.elasticsearch.annotations.Document; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldIndex; -import org.springframework.data.elasticsearch.annotations.FieldType; - -import javax.persistence.*; -import java.util.Date; - -@Document(indexName = "cskefu", type = "orderscomment") -@Entity -@Table(name = "uk_orderscomment") -@org.hibernate.annotations.Proxy(lazy = false) -public class OrdersComment implements UKAgg{ - - /** - * - */ - private static final long serialVersionUID = -4911955236794918875L; - private String id = MainUtils.getUUID(); - private String username; - private String creater ; - - private Date createtime = new Date() ; - - @Field(index = FieldIndex.not_analyzed , type = FieldType.String) - private String dataid ; - - private String content ; //评论内容 - - private Date updatetime = new Date() ; - - private boolean optimal ; //变更用处,流程回复 - - private boolean prirep ; //变更用处, 是否私密回复 - - private int up ; //点赞数量 - private int comments ; //回复数量 - - private boolean admin ; //变更用处 , 是否审批流程 - private boolean datastatus ; //数据状态,是否已删除 - - private String orgi ; - - private String cate ; - - private String optype ; - - private String approval ; //审批结果 - private String retback ; //退回位置 , 退回到 创建人 - - private String accdept ; //转办 部门 - private String accuser ; //转办人 - - - private String ipcode ; - private String country ; - private String province ; - private String city ; - private String isp ; - private String region ; - - private int rowcount ; - private String key ; - - private User user ; - - @Id - @Column(length = 32) - @GeneratedValue(generator= "paymentableGenerator") - @GenericGenerator(name= "paymentableGenerator",strategy = "assigned") - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public String getCreater() { - return creater; - } - public void setCreater(String creater) { - this.creater = creater; - } - public Date getCreatetime() { - return createtime; - } - public void setCreatetime(Date createtime) { - this.createtime = createtime; - } - public String getIpcode() { - return ipcode; - } - public void setIpcode(String ipcode) { - this.ipcode = ipcode; - } - public String getCountry() { - return country; - } - public void setCountry(String country) { - this.country = country; - } - public String getProvince() { - return province; - } - public void setProvince(String province) { - this.province = province; - } - public String getCity() { - return city; - } - public void setCity(String city) { - this.city = city; - } - public String getIsp() { - return isp; - } - public void setIsp(String isp) { - this.isp = isp; - } - public String getRegion() { - return region; - } - public void setRegion(String region) { - this.region = region; - } - public String getDataid() { - return dataid; - } - public void setDataid(String dataid) { - this.dataid = dataid; - } - public String getOptype() { - return optype; - } - public void setOptype(String optype) { - this.optype = optype; - } - public String getContent() { - return content; - } - public void setContent(String content) { - this.content = content; - } - public boolean isOptimal() { - return optimal; - } - public void setOptimal(boolean optimal) { - this.optimal = optimal; - } - public boolean isAdmin() { - return admin; - } - public void setAdmin(boolean admin) { - this.admin = admin; - } - public int getUp() { - return up; - } - public void setUp(int up) { - this.up = up; - } - public int getComments() { - return comments; - } - public void setComments(int comments) { - this.comments = comments; - } - public Date getUpdatetime() { - return updatetime; - } - public void setUpdatetime(Date updatetime) { - this.updatetime = updatetime; - } - @Transient - public User getUser() { - return user; - } - public void setUser(User user) { - this.user = user; - } - public String getCate() { - return cate; - } - public void setCate(String cate) { - this.cate = cate; - } - @Transient - public int getRowcount() { - return rowcount; - } - public void setRowcount(int rowcount) { - this.rowcount = rowcount; - } - @Transient - public String getKey() { - return key; - } - public void setKey(String key) { - this.key = key; - } - public boolean isPrirep() { - return prirep; - } - public void setPrirep(boolean prirep) { - this.prirep = prirep; - } - public String getOrgi() { - return orgi; - } - public void setOrgi(String orgi) { - this.orgi = orgi; - } - public boolean isDatastatus() { - return datastatus; - } - public void setDatastatus(boolean datastatus) { - this.datastatus = datastatus; - } - public String getApproval() { - return approval; - } - public void setApproval(String approval) { - this.approval = approval; - } - public String getRetback() { - return retback; - } - public void setRetback(String retback) { - this.retback = retback; - } - public String getAccdept() { - return accdept; - } - public void setAccdept(String accdept) { - this.accdept = accdept; - } - public String getAccuser() { - return accuser; - } - public void setAccuser(String accuser) { - this.accuser = accuser; - } -} +/* + * Copyright (C) 2017 优客服-多渠道客服系统 + * Modifications copyright (C) 2018-2019 Chatopera Inc, + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.chatopera.cc.model; + +import com.chatopera.cc.basic.MainUtils; +import lombok.Data; +import org.hibernate.annotations.GenericGenerator; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; + +import javax.persistence.*; +import java.util.Date; + +@Data +@Document(indexName = "cskefu", type = "orderscomment") +@Entity +@Table(name = "uk_orderscomment") +@org.hibernate.annotations.Proxy(lazy = false) +public class OrdersComment implements UKAgg { + + private static final long serialVersionUID = -4911955236794918875L; + private String id = MainUtils.getUUID(); + private String username; + private String creater; + private Date createtime = new Date(); + @Field(index = false, type = FieldType.Text) + private String dataid; + private String content; //评论内容 + private Date updatetime = new Date(); + private boolean optimal; //变更用处,流程回复 + private boolean prirep; //变更用处, 是否私密回复 + private int up; //点赞数量 + private int comments; //回复数量 + private boolean admin; //变更用处 , 是否审批流程 + private boolean datastatus; //数据状态,是否已删除 + private String orgi; + private String cate; + private String optype; + private String approval; //审批结果 + private String retback; //退回位置 , 退回到 创建人 + private String accdept; //转办 部门 + private String accuser; //转办人 + private String ipcode; + private String country; + private String province; + private String city; + private String isp; + private String region; + private int rowcount; + private String key; + private User user; + + @Id + @Column(length = 32) + @GeneratedValue(generator = "paymentableGenerator") + @GenericGenerator(name = "paymentableGenerator", strategy = "assigned") + public String getId() { + return id; + } + + @Transient + public User getUser() { + return user; + } + + @Transient + public int getRowcount() { + return rowcount; + } + + @Transient + public String getKey() { + return key; + } +}