xingzai 6 miesięcy temu
rodzic
commit
4f3355b598
2 zmienionych plików z 78 dodań i 6 usunięć
  1. 56 4
      controllers/company.go
  2. 22 2
      controllers/cygx/user_feedback.go

+ 56 - 4
controllers/company.go

@@ -8237,7 +8237,8 @@ func (this *CompanyController) EditTryOutCompanyReason() {
 	endDateTime, _ = time.Parse(utils.FormatDate, endDate)
 	sub := time.Now().Sub(endDateTime)
 	renewalReason.ExpirationTimeExceeded = int(sub.Hours() / 24)
-	err = company.AddRenewalReason(&renewalReason)
+	var newId int64
+	newId, err = company.AddRenewalReason(&renewalReason)
 	if err != nil {
 		br.Msg = "新增续约情况说明操作异常!"
 		br.ErrMsg = "新增续约情况说明操作异常,err:" + err.Error()
@@ -8342,6 +8343,22 @@ func (this *CompanyController) EditTryOutCompanyReason() {
 		return
 	}
 
+	if req.ProductId == utils.COMPANY_PRODUCT_RAI_ID {
+		//权益客户新增历史备注总表
+		itemRecord := new(company.CompanyHistoryRemark)
+		itemRecord.CompanyId = req.CompanyId
+		itemRecord.Content = req.Remark
+		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_renewal_reason"
+		itemRecord.TableId = int(newId)
+		go services.AddCompanyHistoryRemark(itemRecord)
+	}
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "编辑成功"
@@ -8437,7 +8454,8 @@ func (this *CompanyController) AddTryOutCompanyReason() {
 	endDateTime, _ = time.Parse(utils.FormatDate, endDate)
 	sub := time.Now().Sub(endDateTime)
 	renewalReason.ExpirationTimeExceeded = int(sub.Hours() / 24)
-	err = company.AddRenewalReason(&renewalReason)
+	var newId int64
+	newId, err = company.AddRenewalReason(&renewalReason)
 	if err != nil {
 		br.Msg = "新增续约情况说明操作异常!"
 		br.ErrMsg = "新增续约情况说明操作异常,err:" + err.Error()
@@ -8523,6 +8541,22 @@ func (this *CompanyController) AddTryOutCompanyReason() {
 			companyProduct.ProductName, sysUser.RealName, remark, operation, approveContent, approveContentExtra, sysUser.RealName, "", companyProduct.Status)
 	}
 
+	if req.ProductId == utils.COMPANY_PRODUCT_RAI_ID {
+		//权益客户新增历史备注总表
+		itemRecord := new(company.CompanyHistoryRemark)
+		itemRecord.CompanyId = req.CompanyId
+		itemRecord.Content = req.Remark
+		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_renewal_reason"
+		itemRecord.TableId = int(newId)
+		go services.AddCompanyHistoryRemark(itemRecord)
+	}
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "编辑成功"
@@ -8678,7 +8712,9 @@ func (this *CompanyController) AddRenewalReason() {
 	endDateTime, _ = time.Parse(utils.FormatDate, endDate)
 	sub := time.Now().Sub(endDateTime)
 	renewalReason.ExpirationTimeExceeded = int(sub.Hours() / 24)
-	err = company.AddRenewalReason(&renewalReason)
+
+	var newId int64
+	newId, err = company.AddRenewalReason(&renewalReason)
 	if err != nil {
 		br.Msg = "新增续约情况说明操作异常!"
 		br.ErrMsg = "新增续约情况说明操作异常,err:" + err.Error()
@@ -8774,6 +8810,22 @@ func (this *CompanyController) AddRenewalReason() {
 		}
 	}
 
+	if req.ProductId == utils.COMPANY_PRODUCT_RAI_ID {
+		//权益客户新增历史备注总表
+		itemRecord := new(company.CompanyHistoryRemark)
+		itemRecord.CompanyId = req.CompanyId
+		itemRecord.Content = req.Remark
+		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_renewal_reason"
+		itemRecord.TableId = int(newId)
+		go services.AddCompanyHistoryRemark(itemRecord)
+	}
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "编辑成功"
@@ -9524,7 +9576,7 @@ func (this *CompanyController) DelRemark() {
 	_ = services.AddCompanyOperationRecord(product.CompanyId, product.SellerId, sysUser.AdminId, product.ProductId, sysUser.AdminId, product.CompanyName, product.ProductName, sysUser.RealName, "删除备注", "del_remark", content, sysUser.RealName, "", product.Status)
 
 	if item.ProductId == utils.COMPANY_PRODUCT_RAI_ID {
-		go services.DelCompanyHistoryRemark("company_product_remark", req.RemarkId)
+		go services.DelCompanyHistoryRemark("company_product_remark", req.RemarkId) // 删除
 	}
 	br.Ret = 200
 	br.Success = true

+ 22 - 2
controllers/cygx/user_feedback.go

@@ -4,7 +4,9 @@ import (
 	"encoding/json"
 	"hongze/hz_crm_api/controllers"
 	"hongze/hz_crm_api/models"
+	"hongze/hz_crm_api/models/company"
 	"hongze/hz_crm_api/models/cygx"
+	"hongze/hz_crm_api/services"
 	"time"
 )
 
@@ -60,12 +62,28 @@ func (this *UserFeedbackController) UserFeedbackAdd() {
 	item.RealName = wxUser.RealName
 	item.AdminId = sysUser.AdminId
 	item.CreateTime = time.Now()
-	_, err = cygx.AddCygxUserFeedback(item)
+	var newId int64
+	newId, err = cygx.AddCygxUserFeedback(item)
 	if err != nil {
 		br.Msg = "新增失败."
 		br.ErrMsg = "新增失败,Err:" + err.Error()
 		return
 	}
+
+	//权益客户新增历史备注总表
+	itemRecord := new(company.CompanyHistoryRemark)
+	itemRecord.CompanyId = wxUser.CompanyId
+	itemRecord.Content = req.Content
+	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 = "cygx_user_feedback"
+	itemRecord.TableId = int(newId)
+	go services.AddCompanyHistoryRemark(itemRecord)
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "操作成功"
@@ -134,7 +152,6 @@ func (this *UserFeedbackController) UserFeedbackDel() {
 		return
 	}
 	userFeedbackId := req.UserFeedbackId
-
 	if userFeedbackId < 0 {
 		br.Msg = "参数错误!"
 		return
@@ -146,6 +163,9 @@ func (this *UserFeedbackController) UserFeedbackDel() {
 		br.ErrMsg = "删除失败,Err:" + err.Error()
 		return
 	}
+
+	go services.DelCompanyHistoryRemark("cygx_user_feedback", userFeedbackId) // 删除
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "删除成功"