Bladeren bron

Merge remote-tracking branch 'origin/debug' into debug

zwxi 1 jaar geleden
bovenliggende
commit
3ce846fb63

+ 172 - 69
controllers/overseas_custom/custom.go

@@ -11,74 +11,6 @@ import (
 	"time"
 )
 
-// @Title 海外客户统计数据
-// @Description 海外客户统计数据
-// @Param   Keywords	query	string	false	"关键词:客户名称/社会信用码/联系人手机号/邮箱"
-// @Param   SellerId	query	int		false	"销售ID"
-// @Success 200 {object} models.EnglishCompanyPageListResp
-// @router /custom/statistics [get]
-func (this *OverseasCustomController) CustomStatistics() {
-	br := new(models.BaseResponse).Init()
-	br.IsSendEmail = false
-	defer func() {
-		this.Data["json"] = br
-		this.ServeJSON()
-	}()
-	sysUser := this.SysUser
-	if sysUser == nil {
-		br.Msg = "请登录"
-		br.ErrMsg = "请登录,SysUser Is Empty"
-		br.Ret = 408
-		return
-	}
-
-	keywords := this.GetString("Keywords", "")
-	sellerId, _ := this.GetInt("SellerId", 0)
-
-	obj := new(overseas_custom.Custom)
-
-	var cond string
-	var pars []interface{}
-	if keywords != "" {
-		k := "%" + keywords + "%"
-		enCompanyIds, e := models.GetEnCompanyIdsByKeyword(k)
-		if e != nil {
-			br.Msg = "获取失败"
-			br.ErrMsg = "关键词获取英文客户IDs失败, Err: " + e.Error()
-			return
-		}
-
-		//获取中文客户
-
-		companyIds, err := obj.GetCompanyIdsByKeyword(k)
-		if err != nil {
-			br.Msg = "获取失败"
-			br.ErrMsg = "关键词获取客户IDs失败, Err: " + err.Error()
-			return
-		}
-
-		companyIds = append(companyIds, enCompanyIds...)
-
-		cond += fmt.Sprintf(` AND c.company_id IN (%s) `, utils.GetOrmInReplace(len(companyIds)))
-		pars = append(pars, companyIds)
-	}
-	if sellerId > 0 {
-		cond = ` AND m.seller_id=? `
-		pars = append(pars, sellerId)
-	}
-
-	list, err := obj.GetCustomTotal(cond, pars)
-	if err != nil {
-		br.Msg = "获取失败"
-		br.ErrMsg = "获取各状态总数失败, Err: " + err.Error()
-		return
-	}
-	br.Ret = 200
-	br.Success = true
-	br.Msg = "获取成功"
-	br.Data = list
-}
-
 // @Title 获取海外客户列表数据
 // @Description 获取海外客户列表数据
 // @Param   PageSize   query   int  true       "每页数据条数"
@@ -89,6 +21,7 @@ func (this *OverseasCustomController) CustomStatistics() {
 // @Param   CustomType	query	int		false	"1:海外客户,2:隐藏客户"
 // @Param   SortField	query	string		false	"排序字段:ViewTotal,RoadShowTotal,CreateTime"
 // @Param   SortDesc	query	int		false	"1:降序,默认,2:升序"
+// @Param   OverseasLabel	query	int		false	"海外客户试用子标签:1未分类、2  推进、3 跟踪、4 预备、"
 // @Success 200 {object} models.EnglishCompanyPageListResp
 // @router /custom/list [get]
 func (this *OverseasCustomController) CustomList() {
@@ -114,6 +47,7 @@ func (this *OverseasCustomController) CustomList() {
 	companyStatus := this.GetString("CompanyStatus")
 	sortField := this.GetString("SortField")
 	sortDesc, _ := this.GetInt("SortDesc")
+	overseasLabel, _ := this.GetInt("OverseasLabel", 0)
 
 	var startSize int
 	if pageSize <= 0 {
@@ -148,7 +82,7 @@ func (this *OverseasCustomController) CustomList() {
 
 		companyIds = append(companyIds, enCompanyIds...)
 
-		condition += fmt.Sprintf(` AND c.company_id IN (%s) `, utils.GetOrmInReplace(len(companyIds)))
+		condition += fmt.Sprintf(` AND m.company_id IN (%s) `, utils.GetOrmInReplace(len(companyIds)))
 		pars = append(pars, companyIds)
 	}
 	if sellerId > 0 {
@@ -156,6 +90,11 @@ func (this *OverseasCustomController) CustomList() {
 		pars = append(pars, sellerId)
 	}
 
+	if overseasLabel > 0 {
+		condition = ` AND m.overseas_label=? `
+		pars = append(pars, overseasLabel)
+	}
+
 	total, err := obj.GetCustomListCount(condition, pars, companyStatus)
 	if err != nil {
 		br.Msg = "获取失败"
@@ -169,11 +108,35 @@ func (this *OverseasCustomController) CustomList() {
 		br.ErrMsg = "获取数据失败, Err: " + err.Error()
 		return
 	}
+
+	for _, v := range list {
+		if v.Source == 1 && v.OverseasStatus != "" {
+			v.CompanyStatus = v.OverseasStatus
+		}
+	}
+
+	statisticsDataList, err := obj.GetCustomTotal(condition, pars)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取各状态总数失败, Err: " + err.Error()
+		return
+	}
+
+	overseasLabelDataList, err := obj.GetCustomOverseasLabelTotal(condition, pars)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取各状态总数失败, Err: " + err.Error()
+		return
+	}
+
 	page := paging.GetPaging(currentIndex, pageSize, total)
 
 	resp := new(overseas_custom.CustomListResp)
 	resp.Paging = page
 	resp.List = list
+	resp.StatisticsData = statisticsDataList
+	resp.OverseasLabelData = overseasLabelDataList
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"
@@ -256,3 +219,143 @@ func (this *OverseasCustomController) CustomHide() {
 	br.Success = true
 	br.Msg = "隐藏成功"
 }
+
+// @Title 客户状态设置
+// @Description 客户状态设置
+// @Param	request  body  overseas_custom.CustomHideReq  true  "type json string"
+// @Success 200 string "操作成功"
+// @router /custom/status_set [post]
+func (this *OverseasCustomController) CustomStatusSet() {
+	br := new(models.BaseResponse).Init()
+	br.IsSendEmail = false
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	sysUser := this.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+
+	var req overseas_custom.CustomHideReq
+	if err := json.Unmarshal(this.Ctx.Input.RequestBody, &req); err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+
+	if req.CompanyId <= 0 {
+		br.Msg = "参数错误!"
+		return
+	}
+
+	obj := new(overseas_custom.Custom)
+	item, err := obj.GetCustomByCompanyId(req.CompanyId)
+	if err != nil {
+		br.Msg = "隐藏失败!"
+		br.ErrMsg = "隐藏失败,Err:" + err.Error()
+		return
+	}
+	//是否隐藏:0:不隐藏,1:隐藏
+	var overseasStatus string
+	if item.OverseasStatus == "" {
+		overseasStatus = "正式"
+	} else {
+		overseasStatus = ""
+	}
+
+	if req.CompanyId > 1000000 {
+		enCompanyObj := new(models.EnglishCompany)
+		// 更新客户
+		nowTime := time.Now().Local()
+		enCompanyObj.CompanyId = req.CompanyId - utils.EnCompanyIdStep
+		enCompanyObj.OverseasStatus = overseasStatus
+		enCompanyObj.ModifyTime = nowTime
+		updateCols := []string{"OverseasStatus", "ModifyTime"}
+		if err = enCompanyObj.Update(updateCols); err != nil {
+			br.Msg = "隐藏失败"
+			br.ErrMsg = "更新英文客户转正式状态失败, Err:" + err.Error()
+			return
+		}
+	} else {
+		companyObj := new(company.Company)
+		companyObj.CompanyId = req.CompanyId
+		companyObj.OverseasStatus = overseasStatus
+		updateCols := []string{"OverseasStatus"}
+		err = companyObj.Update(updateCols)
+		if err != nil {
+			br.Msg = "隐藏失败"
+			br.ErrMsg = "更新客户转正式状态失败, Err:" + err.Error()
+			return
+		}
+	}
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "操作成功"
+}
+
+// @Title 客户子标签设置
+// @Description 客户子标签设置
+// @Param	request  body  overseas_custom.CustomOverseasLabelSetReq  true  "type json string"
+// @Success 200 string "操作成功"
+// @router /custom/overseas_label_set [post]
+func (this *OverseasCustomController) CustomOverseasLabelSet() {
+	br := new(models.BaseResponse).Init()
+	br.IsSendEmail = false
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	//海外客户试用子标签:1未分类、2  推进、3 跟踪、4 预备、
+	sysUser := this.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+
+	var req overseas_custom.CustomOverseasLabelSetReq
+	if err := json.Unmarshal(this.Ctx.Input.RequestBody, &req); err != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + err.Error()
+		return
+	}
+
+	if req.CompanyId <= 0 {
+		br.Msg = "参数错误!"
+		return
+	}
+
+	if req.CompanyId > 1000000 {
+		enCompanyObj := new(models.EnglishCompany)
+		// 更新客户
+		nowTime := time.Now().Local()
+		enCompanyObj.CompanyId = req.CompanyId - utils.EnCompanyIdStep
+		enCompanyObj.OverseasLabel = req.OverseasLabel
+		enCompanyObj.ModifyTime = nowTime
+		updateCols := []string{"OverseasLabel", "ModifyTime"}
+		if err := enCompanyObj.Update(updateCols); err != nil {
+			br.Msg = "设置失败"
+			br.ErrMsg = "设置英文客户标签状态失败, Err:" + err.Error()
+			return
+		}
+	} else {
+		companyObj := new(company.Company)
+		companyObj.CompanyId = req.CompanyId
+		companyObj.OverseasLabel = req.OverseasLabel
+		updateCols := []string{"OverseasLabel"}
+		err := companyObj.Update(updateCols)
+		if err != nil {
+			br.Msg = "设置失败"
+			br.ErrMsg = "设置客户标签状态失败, Err:" + err.Error()
+			return
+		}
+	}
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "设置成功"
+}

+ 2 - 1
models/company/company.go

@@ -43,7 +43,8 @@ type Company struct {
 	OpenCompanyCode string    `description:"开放给第三方的客户编码,不让第三方定位我们的客户信息"`
 	Nation          string    `description:"所属国家"`
 	IsHide          int       `description:"是否隐藏:0:不隐藏,1:隐藏"`
-	OverseasStatus  int       `description:"海外客户状态:'正式','试用','关闭'"`
+	OverseasStatus  string    `description:"海外客户状态:'正式','试用','关闭'"`
+	OverseasLabel   int       `description:"海外客户试用子标签:1未分类、2  推进、3 跟踪、4 预备、"`
 }
 
 // 新增客户

+ 10 - 9
models/cygx/activity_points_set.go

@@ -6,15 +6,16 @@ import (
 )
 
 type YanXuanActivityPointsRedis struct {
-	UserId           int       `description:"用户ID"`
-	ComapnyId        int       `description:"公司ID"`
-	ActivityId       int       `description:"活动ID"`
-	PublishStatus    int       `description:"发布状态 1已发布,0未发布"`
-	SourceType       int       `description:"1:报名、 2:取消报名、3:活动编辑、4:活动发布,取消发布、5:活动到会。"`
-	AdminId          int       `description:"管理员、销售ID"`
-	Source           int       `description:" 来源,1客户端,2后台添加, 3开发人员手动添加、4定时任务"`
-	RegisterPlatform int       `description:"来源 1小程序,2:网页"`
-	CreateTime       time.Time `description:"创建时间"`
+	UserId            int       `description:"用户ID"`
+	ComapnyId         int       `description:"公司ID"`
+	CompanyContractId int       `description:"合同id"`
+	ActivityId        int       `description:"活动ID"`
+	PublishStatus     int       `description:"发布状态 1已发布,0未发布"`
+	SourceType        int       `description:"1:报名、 2:取消报名、3:活动编辑、4:活动发布,取消发布、5:活动到会。"`
+	AdminId           int       `description:"管理员、销售ID"`
+	Source            int       `description:" 来源,1客户端,2后台添加, 3开发人员手动添加、4定时任务"`
+	RegisterPlatform  int       `description:"来源 1小程序,2:网页"`
+	CreateTime        time.Time `description:"创建时间"`
 }
 
 type CygxActivityPointsSet struct {

+ 2 - 1
models/english_company.go

@@ -28,7 +28,8 @@ type EnglishCompany struct {
 	Status         int       `description:"1:正式,2:临时,3:终止"`
 	Nation         string    `description:"所属国家"`
 	IsHide         int       `description:"是否隐藏:0:不隐藏,1:隐藏"`
-	OverseasStatus int       `description:"海外客户状态:'正式','试用','关闭'"`
+	OverseasStatus string    `description:"海外客户状态:'正式','试用','关闭'"`
+	OverseasLabel  int       `description:"海外客户试用子标签:1未分类、2  推进、3 跟踪、4 预备、"`
 }
 
 type EnglishCompanyListItem struct {

+ 78 - 14
models/overseas_custom/custom.go

@@ -19,7 +19,9 @@ type Custom struct {
 	LastViewTime   string `description:"最近阅读时间"`
 	CreateTime     string `description:"创建时间"`
 	IsHide         int    `description:"是否隐藏:0:不隐藏,1:隐藏"`
-	OverseasStatus int    `description:"海外客户状态:'正式','试用','关闭'"`
+	OverseasStatus string `description:"海外客户状态:'正式','试用','关闭'"`
+	Source         int    `description:"来源:1,英文客户,2:客户列表"`
+	OverseasLabel  int    `description:"海外客户试用子标签:1未分类、2  推进、3 跟踪、4 预备、"`
 }
 
 type CustomTotal struct {
@@ -44,7 +46,7 @@ func (obj *Custom) GetCustomTotal(condition string, pars []interface{}) (list []
 				WHEN '永续' THEN '正式'
 				WHEN '试用' THEN '试用'
 				ELSE '关闭' END AS company_status,
-				b.view_total,b.road_show_total,a.created_time AS create_time,b.last_view_time
+				b.view_total,b.road_show_total,a.created_time AS create_time,b.last_view_time,b.overseas_label
 				FROM company AS a
 				INNER JOIN company_product AS b ON a.company_id=b.company_id
 				INNER JOIN overseas_custom_seller AS c ON b.seller_id=c.seller_id
@@ -54,7 +56,7 @@ func (obj *Custom) GetCustomTotal(condition string, pars []interface{}) (list []
 				CASE t.enabled
 				WHEN 0 THEN '关闭'
 				ELSE '试用' END AS company_status,
-				t.view_total,0 AS road_show_total,t.create_time,'' AS last_view_time
+				t.view_total,0 AS road_show_total,t.create_time,'' AS last_view_time,t.overseas_label
 				FROM %s.english_company AS t
 				INNER JOIN overseas_custom_seller AS n ON t.seller_id=n.seller_id
 				)AS m
@@ -100,7 +102,7 @@ func (obj *Custom) GetCustomListCount(condition string, pars []interface{}, comp
 				WHEN '永续' THEN '正式'
 				WHEN '试用' THEN '试用'
 				ELSE '关闭' END AS company_status,
-				b.view_total,b.road_show_total,a.created_time AS create_time,b.last_view_time
+				b.view_total,b.road_show_total,a.created_time AS create_time,b.last_view_time,b.overseas_label
 				FROM company AS a
 				INNER JOIN company_product AS b ON a.company_id=b.company_id
 				INNER JOIN overseas_custom_seller AS c ON b.seller_id=c.seller_id
@@ -118,7 +120,7 @@ func (obj *Custom) GetCustomListCount(condition string, pars []interface{}, comp
 				CASE t.enabled
 				WHEN 0 THEN '关闭'
 				ELSE '试用' END AS company_status,
-				t.view_total,0 AS road_show_total,t.create_time,'' AS last_view_time
+				t.view_total,0 AS road_show_total,t.create_time,'' AS last_view_time,t.overseas_label
 				FROM %s.english_company AS t
 				INNER JOIN overseas_custom_seller AS n ON t.seller_id=n.seller_id
              WHERE 1=1 `
@@ -156,11 +158,12 @@ func (obj *Custom) GetCustomList(condition string, pars []interface{}, companySt
 				WHEN '永续' THEN '正式'
 				WHEN '试用' THEN '试用'
 				ELSE '关闭' END AS company_status,
-				b.view_total,b.road_show_total,a.created_time AS create_time,b.last_view_time,a.is_hide,a.overseas_status
+				b.view_total,b.road_show_total,a.created_time AS create_time,b.last_view_time,a.is_hide,a.overseas_status,
+				2 AS source,b.overseas_label
 				FROM company AS a
 				INNER JOIN company_product AS b ON a.company_id=b.company_id
 				INNER JOIN overseas_custom_seller AS c ON b.seller_id=c.seller_id
-				WHERE b.is_overseas = 0`
+				WHERE b.product_id=1 AND b.is_overseas = 0`
 	if companyStatus == "正式" {
 		sql += ` AND b.status IN('正式','永续') `
 	} else if companyStatus == "试用" {
@@ -174,7 +177,8 @@ func (obj *Custom) GetCustomList(condition string, pars []interface{}, companySt
 				CASE t.enabled
 				WHEN 0 THEN '关闭'
 				ELSE '试用' END AS company_status,
-				t.view_total,0 AS road_show_total,t.create_time,'' AS last_view_time,a.is_hide,a.overseas_status
+				t.view_total,0 AS road_show_total,t.create_time,'' AS last_view_time,t.is_hide,t.overseas_status,
+				1 AS source,t.overseas_label
 				FROM %s.english_company AS t
 				INNER JOIN overseas_custom_seller AS n ON t.seller_id=n.seller_id
              WHERE 1=1 `
@@ -207,20 +211,20 @@ func (obj *Custom) GetCustomList(condition string, pars []interface{}, companySt
 		sortDescStr = "ASC"
 	}
 
-	sql += ` ORDER BY %s `
-	sql = fmt.Sprintf(sql, sortFieldStr, sortDescStr)
+	sql += ` ORDER BY %s %s`
 	sql += ` LIMIT ?,? `
-	sql = fmt.Sprintf(sql, databaseName)
+	sql = fmt.Sprintf(sql, databaseName, sortFieldStr, sortDescStr)
 	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&list)
 	return
 }
 
 type CustomListResp struct {
-	Paging *paging.PagingItem
-	List   []*Custom
+	Paging            *paging.PagingItem
+	List              []*Custom
+	StatisticsData    []*CustomTotal
+	OverseasLabelData []*OverseasLabelTotal
 }
 
-// EnglishCompanySaveReq 英文客户-保存请求体
 type CustomHideReq struct {
 	CompanyId int `description:"客户ID"`
 }
@@ -235,6 +239,10 @@ func (obj *Custom) GetCustomByCompanyId(companyId int) (list *Custom, err error)
 		databaseName = "hongze_rddp"
 	}
 
+	if companyId > utils.EnCompanyIdStep {
+		companyId = companyId - utils.EnCompanyIdStep
+	}
+
 	sql = `SELECT * FROM (
 				SELECT a.company_id,a.company_name,a.nation,b.seller_id,b.seller_name,
 				CASE b.status 
@@ -264,3 +272,59 @@ func (obj *Custom) GetCustomByCompanyId(companyId int) (list *Custom, err error)
 	_, err = o.Raw(sql, companyId).QueryRows(&list)
 	return
 }
+
+type OverseasLabelTotal struct {
+	OverseasLabel int `description:"海外客户试用子标签:1未分类、2  推进、3 跟踪、4 预备、"`
+	Total         int `description:"总数"`
+}
+
+func (obj *Custom) GetCustomOverseasLabelTotal(condition string, pars []interface{}) (list []*OverseasLabelTotal, err error) {
+	o := orm.NewOrm()
+	sql := ``
+	var databaseName string
+	if utils.RunMode == "debug" {
+		databaseName = "test_v2_hongze_rddp"
+	} else {
+		databaseName = "hongze_rddp"
+	}
+
+	sql = `SELECT overseas_label,COUNT(1) AS total FROM (
+				SELECT a.company_id,a.company_name,a.nation,b.seller_id,b.seller_name,
+				CASE b.status 
+				WHEN '正式' THEN '正式'
+				WHEN '永续' THEN '正式'
+				WHEN '试用' THEN '试用'
+				ELSE '关闭' END AS company_status,
+				b.view_total,b.road_show_total,a.created_time AS create_time,b.last_view_time,b.overseas_label
+				FROM company AS a
+				INNER JOIN company_product AS b ON a.company_id=b.company_id
+				INNER JOIN overseas_custom_seller AS c ON b.seller_id=c.seller_id
+				WHERE b.is_overseas = 0
+				UNION ALL
+				SELECT t.company_id+10000000,t.company_name,t.nation,t.seller_id,t.seller_name,
+				CASE t.enabled
+				WHEN 0 THEN '关闭'
+				ELSE '试用' END AS company_status,
+				t.view_total,0 AS road_show_total,t.create_time,'' AS last_view_time,t.overseas_label
+				FROM %s.english_company AS t
+				INNER JOIN overseas_custom_seller AS n ON t.seller_id=n.seller_id
+				)AS m
+		WHERE 1=1                       
+`
+
+	if condition != "" {
+		sql += condition
+	}
+
+	sql += ` GROUP BY m.overseas_label `
+
+	sql = fmt.Sprintf(sql, databaseName)
+
+	_, err = o.Raw(sql, pars).QueryRows(&list)
+	return
+}
+
+type CustomOverseasLabelSetReq struct {
+	CompanyId     int `description:"客户ID"`
+	OverseasLabel int `description:"海外客户试用子标签:1未分类、2  推进、3 跟踪、4 预备、"`
+}

+ 45 - 0
routers/commentsRouter.go

@@ -7189,6 +7189,51 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"],
+        beego.ControllerComments{
+            Method: "CustomHide",
+            Router: `/custom/hide`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"],
+        beego.ControllerComments{
+            Method: "CustomList",
+            Router: `/custom/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"],
+        beego.ControllerComments{
+            Method: "CustomStatusSet",
+            Router: `/custom/status_set`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"],
+        beego.ControllerComments{
+            Method: "SaleList",
+            Router: `/sale/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/overseas_custom:OverseasCustomController"],
+        beego.ControllerComments{
+            Method: "SaleSave",
+            Router: `/sale/save`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/roadshow:CalendarController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/roadshow:CalendarController"],
         beego.ControllerComments{
             Method: "Accept",

+ 4 - 4
services/company_apply/company_approval.go

@@ -420,10 +420,10 @@ func Approved(approvalRecord *contract.ContractApprovalRecord, opUser *system.Ad
 
 				//客户研选行业转正时(王芳审批通过),模板消息提醒汪洋
 				services.AddCompanyApprovalMessageWangYang(recordInfo.CompanyId, recordInfo.CompanyContractId, recordInfo.ApplyRealName, companyInfo.CompanyName)
-				cygxService.YanXuanCompanyApproval(recordInfo.CompanyId)                              //研选审批通过的时候研选扣点更新
-				cygxService.HandleAllocationCompanyContractByYanXuan(recordInfo.CompanyContractId)    //如果合同只有研选的时候,自动处理派点
-				cygxService.HandleCompanyContractPackageDifference(recordInfo.CompanyContractId)      // 更新与上一份合同的金额的对比 '增加套餐','减少套餐','维持套餐'
-				cygxService.HandleCompanyContractPermissionContractType(recordInfo.CompanyContractId) // 更新合同权限表中的权限名称,以及对应的行业权限类型(行业新签、行业续约)
+				cygxService.YanXuanCompanyApproval(recordInfo.CompanyId, recordInfo.CompanyContractId) //研选审批通过的时候研选扣点更新
+				cygxService.HandleAllocationCompanyContractByYanXuan(recordInfo.CompanyContractId)     //如果合同只有研选的时候,自动处理派点
+				cygxService.HandleCompanyContractPackageDifference(recordInfo.CompanyContractId)       // 更新与上一份合同的金额的对比 '增加套餐','减少套餐','维持套餐'
+				cygxService.HandleCompanyContractPermissionContractType(recordInfo.CompanyContractId)  // 更新合同权限表中的权限名称,以及对应的行业权限类型(行业新签、行业续约)
 			}
 		}()
 	} else {

+ 2 - 2
services/cygx/activity_points_set.go

@@ -310,7 +310,7 @@ func YanXuanActivityPointsBillSubmitMeeting(activityId, adminId int) (err error)
 }
 
 // 6 研选审批通过的时候研选扣点更新
-func YanXuanCompanyApproval(comapnyId int) (err error) {
+func YanXuanCompanyApproval(comapnyId, companyContractId int) (err error) {
 	defer func() {
 		if err != nil {
 			fmt.Println(err)
@@ -319,7 +319,7 @@ func YanXuanCompanyApproval(comapnyId int) (err error) {
 		}
 	}()
 	//SourceType int       `description:"1:报名、 2:取消报名、3:活动编辑、4:活动发布,取消发布、5:活动到会。"`
-	log := &cygx.YanXuanActivityPointsRedis{ComapnyId: comapnyId, SourceType: 6, Source: 2, CreateTime: time.Now()}
+	log := &cygx.YanXuanActivityPointsRedis{ComapnyId: comapnyId, CompanyContractId: companyContractId, SourceType: 6, Source: 2, CreateTime: time.Now()}
 	if utils.Re == nil {
 		err := utils.Rc.LPush(utils.CYGX_YANXUAN_POINTS_KEY, log)
 		if err != nil {