|
@@ -1041,17 +1041,24 @@ func (this *MessaggeService) Chat(in *messagecenter.MessageEntity) (fool bool, e
|
|
|
messageId = MessageAdd(tx, in.Appid, in.Title, in.Content, createperson, in.Link, in.Item, in.Type)
|
|
|
//是否客服介入
|
|
|
isCustomerServiceAccess := 0
|
|
|
-
|
|
|
+ //除客服消息以外的系统消息
|
|
|
+ if in.ItemType == 9 {
|
|
|
+ in.ItemType = 6
|
|
|
+ }
|
|
|
//群聊
|
|
|
if isGroup {
|
|
|
+ //修改类型为群聊
|
|
|
+ if in.ItemType != 6 {
|
|
|
+ in.ItemType = 3
|
|
|
+ }
|
|
|
fieids := []string{"appid", "messag_id", "type", "send_user_id", "send_user_type", "receive_user_id", "receive_user_type", "own_type", "own_id", "create_time", "chat_group_id", "isread"}
|
|
|
for _, v := range in.GroupIds {
|
|
|
args := []interface{}{}
|
|
|
- args = append(args, in.Appid, messageId, in.Type, in.SendId, 2, in.SendId, 2, 2, in.SendId, nowTime, v, 1)
|
|
|
+ args = append(args, in.Appid, messageId, in.ItemType, in.SendId, 2, in.SendId, 2, 2, in.SendId, nowTime, v, 1)
|
|
|
groupUser := GetUserByGroupId(tx, v, in.SendId)
|
|
|
for _, vv := range groupUser {
|
|
|
log.Println("获取到群组下员工:", vv)
|
|
|
- args = append(args, in.Appid, messageId, in.Type, in.SendId, 2, vv, 2, 2, vv, nowTime, v, 0)
|
|
|
+ args = append(args, in.Appid, messageId, in.ItemType, in.SendId, 2, vv, 2, 2, vv, nowTime, v, 0)
|
|
|
}
|
|
|
MessageMailBoxAdd(tx, fieids, args)
|
|
|
//最后一次聊天
|
|
@@ -1062,11 +1069,15 @@ func (this *MessaggeService) Chat(in *messagecenter.MessageEntity) (fool bool, e
|
|
|
}
|
|
|
//1v1
|
|
|
if isOneToOne {
|
|
|
+ //修改类型为个人
|
|
|
+ if in.ItemType != 6 {
|
|
|
+ in.ItemType = 2
|
|
|
+ }
|
|
|
fieids := []string{"appid", "messag_id", "type", "send_user_id", "send_user_type", "receive_user_id", "receive_user_type", "own_type", "own_id", "create_time", "isread"}
|
|
|
args := []interface{}{}
|
|
|
- args = append(args, in.Appid, messageId, in.Type, in.SendId, 2, in.SendId, 2, 2, in.SendId, nowTime, 1)
|
|
|
+ args = append(args, in.Appid, messageId, in.ItemType, in.SendId, 2, in.SendId, 2, 2, in.SendId, nowTime, 1)
|
|
|
for _, v := range in.ReceiverIds {
|
|
|
- args = append(args, in.Appid, messageId, in.Type, in.SendId, 2, v, 2, 2, v, nowTime, 0)
|
|
|
+ args = append(args, in.Appid, messageId, in.ItemType, in.SendId, 2, v, 2, 2, v, nowTime, 0)
|
|
|
|
|
|
//最后一次聊天
|
|
|
SocializeSummaryAddOrUpdate(tx, 0, in.SendId, v, messageId, isCustomerServiceAccess, nowTime)
|