Browse Source

no message

xingzai 8 months ago
parent
commit
8ffea8eea9
2 changed files with 34 additions and 1 deletions
  1. 15 1
      controllers/company_service_record.go
  2. 19 0
      services/company_record.go

+ 15 - 1
controllers/company_service_record.go

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"hongze/hz_crm_api/models"
 	"hongze/hz_crm_api/models/company"
+	"hongze/hz_crm_api/services"
 	"hongze/hz_crm_api/utils"
 	"strings"
 	"time"
@@ -135,7 +136,20 @@ func (this *CompanyServiceRecordController) ServiceRecordAdd() {
 		br.ErrMsg = "新增沟通记录失败, Err: " + e.Error()
 		return
 	}
-	fmt.Println(newId)
+
+	//权益客户新增历史备注总表
+	itemRecord := new(company.CompanyHistoryRemark)
+	itemRecord.CompanyId = req.CompanyType
+	itemRecord.CompanyId = req.CompanyId
+	itemRecord.SysAdminId = sysUser.AdminId
+	itemRecord.SysAdminName = sysUser.RealName
+	itemRecord.CreateTime = time.Now().Local()
+	itemRecord.ModifyTime = time.Now().Local()
+	itemRecord.ShowTime = time.Now().Local()
+	itemRecord.ProductId = 2
+	itemRecord.TableName = "company_service_record"
+	itemRecord.TableId = newId
+	go services.AddCompanyHistoryRemark(itemRecord)
 
 	br.Ret = 200
 	br.Success = true

+ 19 - 0
services/company_record.go

@@ -1 +1,20 @@
 package services
+
+import (
+	"fmt"
+	"hongze/hz_crm_api/models/company"
+	"hongze/hz_crm_api/services/alarm_msg"
+)
+
+// 权益客户新增历史备注
+func AddCompanyHistoryRemark(item *company.CompanyHistoryRemark) {
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go alarm_msg.SendAlarmMsg("权益客户新增历史备注,失败:"+err.Error()+fmt.Sprint(item), 2)
+		}
+	}()
+	err = company.AddCompanyHistoryRemark(item)
+	return
+}