Browse Source

Merge branch 'crm/need_1001' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

zhangchuanxing 5 months ago
parent
commit
96d5fc79d7
1 changed files with 14 additions and 0 deletions
  1. 14 0
      services/company.go

+ 14 - 0
services/company.go

@@ -8,6 +8,7 @@ import (
 	"hongze/hz_crm_api/models"
 	"hongze/hz_crm_api/models/company"
 	"hongze/hz_crm_api/models/company_user"
+	"hongze/hz_crm_api/models/cygx"
 	"hongze/hz_crm_api/models/system"
 	"hongze/hz_crm_api/services/alarm_msg"
 	"hongze/hz_crm_api/utils"
@@ -2580,6 +2581,9 @@ func GetLsitCompanyStatusButton(companyType, status, signingStatus string) (butt
 
 // AddWxUserMoveLog 添加用户移动日志记录
 func AddWxUserMoveLog(wxUser *models.WxUser, adminUser *system.Admin, newCompanyId int) (err error) {
+	if wxUser.CompanyId == newCompanyId {
+		return
+	}
 	defer func() {
 		if err != nil {
 			go alarm_msg.SendAlarmMsg("添加用户移动日志记录失败,AddWxUserMoveLog "+fmt.Sprint("UserId:", wxUser.UserId, ";err:", err), 3)
@@ -2612,6 +2616,16 @@ func AddWxUserMoveLog(wxUser *models.WxUser, adminUser *system.Admin, newCompany
 	item.SysUserRealName = adminUser.RealName
 	item.CreateTime = time.Now()
 	e = company.AddWxUserMoveLog(item)
+	if e != nil {
+		err = errors.New("AddWxUserMoveLog, New Err: " + e.Error())
+		return
+	}
+
+	e = cygx.RemoveCygxUserRemind(int(wxUser.UserId)) //取消个人提醒
+	if e != nil {
+		err = errors.New("RemoveCygxUserRemind, New Err: " + e.Error())
+		return
+	}
 	return
 }