|
@@ -11,8 +11,8 @@ import (
|
|
|
"hongze/hongze_yb/models/tables/wx_user"
|
|
|
"hongze/hongze_yb/models/tables/yb_comment_anonymous_user"
|
|
|
"hongze/hongze_yb/models/tables/yb_community_question_comment"
|
|
|
- "hongze/hongze_yb/services"
|
|
|
"hongze/hongze_yb/services/alarm_msg"
|
|
|
+ "hongze/hongze_yb/services/company_approval_message"
|
|
|
"hongze/hongze_yb/services/user"
|
|
|
"hongze/hongze_yb/services/wechat"
|
|
|
"hongze/hongze_yb/services/wx_app"
|
|
@@ -147,6 +147,8 @@ func Delete(user user.UserInfo, communityQuestionCommentID uint64) (err error, e
|
|
|
errMsg = `删除留言出错`
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ go afterDelete(communityQuestionCommentInfo)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -395,7 +397,7 @@ func messageToAdmin(wxUser user.UserInfo, communityQuestionComment *yb_community
|
|
|
var err error
|
|
|
|
|
|
defer func() {
|
|
|
- go alarm_msg.SendAlarmMsg("问答评论完成后发送消息给管理员失败"+time.Now().Format("2006-01-02 15:04:05")+";Err:"+err.Error(), 3)
|
|
|
+ go alarm_msg.SendAlarmMsg("新增问答评论信息完成后,发送消息给管理员失败"+time.Now().Format("2006-01-02 15:04:05")+";Err:"+err.Error(), 3)
|
|
|
}()
|
|
|
|
|
|
//因为产品说只要给沛总发送信息,那么没办法咯,只去获取沛总的信息 2022-07-19 11:29:16
|
|
@@ -415,15 +417,15 @@ func messageToAdmin(wxUser user.UserInfo, communityQuestionComment *yb_community
|
|
|
func systemMessageToAdmin(adminInfo admin.Admin, wxUser user.UserInfo, communityQuestionComment *yb_community_question_comment.YbCommunityQuestionComment) {
|
|
|
var err error
|
|
|
defer func() {
|
|
|
- go alarm_msg.SendAlarmMsg("站内评论信息发送给管理员失败"+time.Now().Format("2006-01-02 15:04:05")+";Err:"+err.Error(), 3)
|
|
|
+ go alarm_msg.SendAlarmMsg("新增问答评论信息完成后,站内评论信息发送给管理员失败"+time.Now().Format("2006-01-02 15:04:05")+";Err:"+err.Error(), 3)
|
|
|
}()
|
|
|
// 接收人的admin_id
|
|
|
receiveUserId := int(adminInfo.AdminID)
|
|
|
|
|
|
var msgType, sourceType, approvalStatus int8
|
|
|
- msgType = services.CompanyApprovalMessageMessageTypeByApply
|
|
|
- sourceType = services.CompanyApprovalMessageSourceTypeByQuestionComment
|
|
|
- approvalStatus = services.CompanyApprovalMessageApprovalStatusByPending
|
|
|
+ msgType = company_approval_message.CompanyApprovalMessageMessageTypeByApply
|
|
|
+ sourceType = company_approval_message.CompanyApprovalMessageSourceTypeByQuestionComment
|
|
|
+ approvalStatus = company_approval_message.CompanyApprovalMessageApprovalStatusByPending
|
|
|
|
|
|
companyInfo, err := company.GetByCompanyId(wxUser.CompanyID)
|
|
|
if err != nil {
|
|
@@ -440,7 +442,7 @@ func systemMessageToAdmin(adminInfo admin.Admin, wxUser user.UserInfo, community
|
|
|
remark := communityQuestionComment.Content
|
|
|
content := communityQuestionComment.Content
|
|
|
|
|
|
- messageInfo := services.MessageInfo{
|
|
|
+ messageInfo := company_approval_message.MessageInfo{
|
|
|
CompanyName: companyInfo.CompanyName,
|
|
|
ProductId: productId,
|
|
|
CompanyProductStatus: companyProductInfo.Status,
|
|
@@ -450,7 +452,7 @@ func systemMessageToAdmin(adminInfo admin.Admin, wxUser user.UserInfo, community
|
|
|
UserName: communityQuestionComment.RealName,
|
|
|
}
|
|
|
//客户添加消息
|
|
|
- err = services.AddCompanyApprovalMessage(utils.AdminId, receiveUserId, int(wxUser.CompanyID), int(communityQuestionComment.CommunityQuestionCommentID), msgType, sourceType, approvalStatus, companyName, remark, content, messageInfo)
|
|
|
+ err = company_approval_message.AddCompanyApprovalMessage(utils.AdminId, receiveUserId, int(wxUser.CompanyID), int(communityQuestionComment.CommunityQuestionCommentID), msgType, sourceType, approvalStatus, companyName, remark, content, messageInfo)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -459,7 +461,7 @@ func wxMessageToAdmin(adminInfo admin.Admin, communityQuestionComment *yb_commun
|
|
|
var err error
|
|
|
|
|
|
defer func() {
|
|
|
- go alarm_msg.SendAlarmMsg("问答评论信息发送微信模板消息给管理员失败"+time.Now().Format("2006-01-02 15:04:05")+";Err:"+err.Error(), 3)
|
|
|
+ go alarm_msg.SendAlarmMsg("新增问答评论信息完成后,微信模板消息发送给管理员失败"+time.Now().Format("2006-01-02 15:04:05")+";Err:"+err.Error(), 3)
|
|
|
}()
|
|
|
|
|
|
wxUser, err := wx_user.GetByMobile(adminInfo.Mobile)
|
|
@@ -470,3 +472,13 @@ func wxMessageToAdmin(adminInfo admin.Admin, communityQuestionComment *yb_commun
|
|
|
err = wechat.SendQuestionCommentToAdmin(int(communityQuestionComment.CommunityQuestionCommentID), int(wxUser.UserID), communityQuestionComment.Content)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// 删除评论后的逻辑处理
|
|
|
+func afterDelete(communityQuestionComment *yb_community_question_comment.YbCommunityQuestionComment) {
|
|
|
+ var err error
|
|
|
+ defer func() {
|
|
|
+ go alarm_msg.SendAlarmMsg("问答评论信息删除后,标记站内消息失败"+time.Now().Format("2006-01-02 15:04:05")+";Err:"+err.Error(), 3)
|
|
|
+ }()
|
|
|
+ err = company_approval_message.CancelCompanyApprovalMessage(int(communityQuestionComment.CommunityQuestionCommentID), company_approval_message.CompanyApprovalMessageSourceTypeByQuestionComment)
|
|
|
+ return
|
|
|
+}
|