Browse Source

Merge branch 'master' of http://8.136.199.33:3000/hongze/hz_crm_api into crm/crm_16.1

zhangchuanxing 2 months ago
parent
commit
5ccdf4a06e

+ 28 - 12
controllers/company_share.go

@@ -78,12 +78,19 @@ func (this *CompanyController) CompanyShare() {
 		return
 	}
 	//新增操作记录
-	//{
-	//	remark := "移动到:" + seller.RealName
-	//	operation := "move_seller"
-	//	services.AddCompanyOperationRecord(req.CompanyId, seller.AdminId, sysUser.AdminId, productId, sysUser.AdminId, cp.CompanyName,
-	//		cp.ProductName, sysUser.RealName, remark, operation, "", sysUser.RealName, "", cp.Status)
-	//}
+	{
+		var remark string
+		var operation string
+		if req.IsShare == 1 {
+			remark = "设置共享"
+			operation = "set_share"
+		} else {
+			remark = "取消共享"
+			operation = "cancel_share"
+		}
+		services.AddCompanyOperationRecord(req.CompanyId, companyProductItem.SellerId, sysUser.AdminId, productId, sysUser.AdminId, companyProductItem.CompanyName,
+			companyProductItem.ProductName, sysUser.RealName, remark, operation, "", sysUser.RealName, "", companyProductItem.Status)
+	}
 
 	br.Ret = 200
 	br.Success = true
@@ -754,6 +761,7 @@ func (this *CompanyController) MoveShareSeller() {
 		br.ErrMsg = "查找客户失败,Err:" + err.Error()
 		return
 	}
+	oldShareSellerId := companyProductItem.ShareSellerId
 
 	//待更新字段
 	updateCol := make([]string, 0)
@@ -772,13 +780,21 @@ func (this *CompanyController) MoveShareSeller() {
 	{
 		services.UpdateCompanyContractSellerMove(req.CompanyId, productId) //益客户移动所属销售之后,更新所关联的销售信息
 	}
+
 	//新增操作记录
-	//{
-	//	remark := "移动到:" + seller.RealName
-	//	operation := "move_seller"
-	//	services.AddCompanyOperationRecord(req.CompanyId, seller.AdminId, sysUser.AdminId, productId, sysUser.AdminId, cp.CompanyName,
-	//		cp.ProductName, sysUser.RealName, remark, operation, "", sysUser.RealName, "", cp.Status)
-	//}
+	{
+		var remark string
+		var operation string
+		if oldShareSellerId == 0 {
+			remark = "分配给" + seller.RealName
+			operation = "set_share_seller"
+		} else {
+			remark = "移动到" + seller.RealName
+			operation = "set_share_seller"
+		}
+		services.AddCompanyOperationRecord(req.CompanyId, seller.AdminId, sysUser.AdminId, productId, sysUser.AdminId, companyProductItem.CompanyName,
+			companyProductItem.ProductName, sysUser.RealName, remark, operation, "", sysUser.RealName, "", companyProductItem.Status)
+	}
 	//变更销售员与联系人关系
 	//_ = models.UpdateUserSellerRelationByCompanyId(req.CompanyId, productId, seller.AdminId, seller.RealName)
 

+ 6 - 2
controllers/cygx/morning_meeting_review.go

@@ -256,6 +256,7 @@ func (this *MorningMeetingController) PreserveAndPublish() {
 		} else {
 			for _, item := range reqList.List {
 				go services.SendWxMsgWithCygxMorningMeeting(int(meetingId), item.IndustryId, item.IndustryName)
+				go cygxService.UpdateIndustrialManagementTimeLineDateList3ByRedis(item.IndustryId) //处理产业管理时间线相关内容的数据
 			}
 			//添加到首页最新
 			listchapter, err := cygx.GetCygxMorningMeetingReviewsListById(int(meetingId))
@@ -440,6 +441,7 @@ func (this *MorningMeetingController) PreserveAndPublish() {
 		} else {
 			for _, item := range reqList.List {
 				go services.SendWxMsgWithCygxMorningMeeting(reqList.MeetingId, item.IndustryId, item.IndustryName)
+				go cygxService.UpdateIndustrialManagementTimeLineDateList3ByRedis(item.IndustryId) //处理产业管理时间线相关内容的数据
 			}
 			for _, itemchapter := range listchapter {
 				//go cygxService.UpdateResourceData(itemchapter.Id, "meetingreviewchapt", "add", time.Now().Format(utils.FormatDateTime))
@@ -599,6 +601,7 @@ func (this *MorningMeetingController) PublishReport() {
 		for _, item := range list {
 			fmt.Println(item.Id)
 			go services.SendWxMsgWithCygxMorningMeeting(vint, item.IndustryId, item.IndustryName)
+			go cygxService.UpdateIndustrialManagementTimeLineDateList3ByRedis(item.IndustryId) //处理产业管理时间线相关内容的数据
 			//go cygxService.UpdateResourceData(item.Id, "meetingreviewchapt", "add", time.Now().Format(utils.FormatDateTime))
 			go cygxService.UpdateMeetingreviewchaptResourceData(item.Id) //写入首页最新  cygx_resource_data 表
 			go elastic.AddComprehensiveMeetingreviewchapt(item.Id)       //Es添加晨会精华
@@ -648,8 +651,9 @@ func (this *MorningMeetingController) PublishCancleReport() {
 	}
 	for _, item := range list {
 		//go cygxService.UpdateResourceData(item.Id, "meetingreviewchapt", "delete", time.Now().Format(utils.FormatDateTime))
-		go cygxService.UpdateMeetingreviewchaptResourceData(item.Id) //写入首页最新  cygx_resource_data 表
-		go elastic.DeleteComprehensiveMeetingreviewchapt(item.Id)    //Es删除晨会精华
+		go cygxService.UpdateMeetingreviewchaptResourceData(item.Id)                       //写入首页最新  cygx_resource_data 表
+		go elastic.DeleteComprehensiveMeetingreviewchapt(item.Id)                          //Es删除晨会精华
+		go cygxService.UpdateIndustrialManagementTimeLineDateList3ByRedis(item.IndustryId) //处理产业管理时间线相关内容的数据
 	}
 	var condition string
 	var pars []interface{}

+ 1 - 1
controllers/cygx/rai_serve.go

@@ -595,7 +595,7 @@ func RaiServeListExport(this *RaiServeCoAntroller, resp *cygx.CygxRaiServeCompan
 
 	cellD := titleRow.AddCell()
 	cellD.SetStyle(style)
-	cellD.SetValue("咨询销售")
+	cellD.SetValue("服务销售")
 
 	cellE := titleRow.AddCell()
 	cellE.SetStyle(style)

+ 20 - 0
services/cygx/industrial_management.go

@@ -129,3 +129,23 @@ func AddUserIndustryFllowByNewId(industrialManagementId int) (err error) {
 	//}
 	return
 }
+
+// 处理产业管理时间线相关内容的数据
+func UpdateIndustrialManagementTimeLineDateList3ByRedis(industrialManagementId int) (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			msg := fmt.Sprint("industrialManagementId:", industrialManagementId)
+			go alarm_msg.SendAlarmMsg("处理产业管理时间线相关内容的数据,写入Redis队列消息失败: UpdateIndustrialManagementTimeLineDateList3ByRedis"+err.Error()+msg, 2)
+		}
+	}()
+	//SourceType int       `description:"1:报名、 2:取消报名、3:活动编辑、4:活动发布,取消发布、5:活动到会。"`
+	log := &cygx.IndustrialManagementDelte{IndustrialManagementId: industrialManagementId}
+	if utils.Re == nil {
+		err := utils.Rc.LPush(utils.CYGX_ARTICLE_TIME_LINE_KEY, log)
+		if err != nil {
+			fmt.Println("UpdateIndustrialManagementTimeLineDateList3ByRedis LPush Err:" + err.Error())
+		}
+	}
+	return
+}

+ 1 - 0
utils/constants.go

@@ -424,6 +424,7 @@ const (
 	CHART_PERMISSION_NAME_45W                      = "45w大套餐" // 权益45w大套餐名称
 	CHART_PERMISSION_ID_45W                        = 2002     // 权益45w大套餐表示的权限ID(自定义)
 	HONG_GUAN_NAME                          string = "宏观"
+	CYGX_ARTICLE_TIME_LINE_KEY                     = "CYGX_ARTICLE_TIME_LINE_KEY" //产业时间线关联的文章key
 )
 
 // 权益cygx_config配置主键以后放这里