|
@@ -88,11 +88,13 @@ func (this *CompanyController) CompanyShare() {
|
|
|
br.Msg = "设置成功"
|
|
|
}
|
|
|
|
|
|
+// CompanyShareList
|
|
|
// @Title 共享客户列表
|
|
|
// @Description 共享客户列表接口
|
|
|
// @Param SellerId query string false "选择的销售id"
|
|
|
+// @Param OriginalSellerId query string false "选择的原销售id"
|
|
|
// @Param Keyword query string true "搜索关键词"
|
|
|
-// @Param ListParam query int false "筛选字段参数,用来筛选的字段, 枚举值:0:全部 、 1:已分配 、 2:未分配 "
|
|
|
+// @Param ListParam query int false "筛选字段参数,用来筛选的字段, 枚举值:0:全部 、 1:已分配 、 2:未分配 、 3:未共享 "
|
|
|
// @Param SortParam query string false "排序字段参数,用来排序的字段, 枚举值:'viewTotal':总阅读次数 、 'viewTime':阅读时间 、 'roadShowTotal':累计路演次数 、`expireDay:到期时间` 、 `createTime:创建时间` 、 'formalTime': 转正时间 、 'freezeTime':冻结时间 、'lossTime':流失时间 、'tryOutDay':试用天数"
|
|
|
// @Param SortType query string true "如何排序,是正序还是倒序,枚举值:`asc 正序`,`desc 倒叙`"
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
@@ -116,6 +118,7 @@ func (this *CompanyController) CompanyShareList() {
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
sellerIds := this.GetString("SellerId")
|
|
|
+ originalSellerIds := this.GetString("OriginalSellerId")
|
|
|
keyword := this.GetString("Keyword")
|
|
|
//排序参数
|
|
|
sortParam := this.GetString("SortParam")
|
|
@@ -150,6 +153,14 @@ func (this *CompanyController) CompanyShareList() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 咨询组的分组id
|
|
|
+ groupId := 0
|
|
|
+ if utils.RunMode == "release" {
|
|
|
+ groupId = 37
|
|
|
+ } else {
|
|
|
+ groupId = 61
|
|
|
+ }
|
|
|
+
|
|
|
roleTypeCode := sysUser.RoleTypeCode
|
|
|
productId := services.GetProductId(roleTypeCode)
|
|
|
//权限控制
|
|
@@ -171,17 +182,36 @@ func (this *CompanyController) CompanyShareList() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if listParam == 0 {
|
|
|
+ if sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_SELLER || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_GROUP || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_TEAM {
|
|
|
+ //非咨询组销售,那么默认查看“未共享”的客户
|
|
|
+ if sysUser.GroupId != groupId {
|
|
|
+ listParam = 3
|
|
|
+ condition += ` AND b.seller_id = ? `
|
|
|
+ pars = append(pars, sysUser.AdminId)
|
|
|
+ } else {
|
|
|
+ condition += ` AND a.is_share=1 `
|
|
|
+ }
|
|
|
+ } else if sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_ADMIN || sysUser.RoleTypeCode == utils.ROLE_TYPE_CODE_FICC_ADMIN {
|
|
|
+ // 管理员,默认查看“待分配”客户
|
|
|
+ listParam = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if listParam == 1 {
|
|
|
- condition += ` AND a.share_seller <> '' AND a.is_share=1 `
|
|
|
+ condition += ` AND a.share_seller_id > 0 AND a.is_share=1 `
|
|
|
} else if listParam == 2 {
|
|
|
- condition += ` AND a.share_seller = '' AND a.is_share=1 `
|
|
|
- } else {
|
|
|
- condition += ` AND a.is_share=1 `
|
|
|
+ condition += ` AND a.share_seller_id = 0 AND a.is_share=1 `
|
|
|
+ } else if listParam == 3 { // 未共享
|
|
|
+ condition += ` AND a.is_share=0 and b.status="正式"`
|
|
|
}
|
|
|
|
|
|
if sellerIds != "" {
|
|
|
condition += ` AND a.share_seller_id IN (` + sellerIds + `) `
|
|
|
}
|
|
|
+ if originalSellerIds != "" {
|
|
|
+ condition += ` AND b.seller_id IN (` + originalSellerIds + `) `
|
|
|
+ }
|
|
|
|
|
|
total, err := company.GetShareCompanyListCount(condition, pars)
|
|
|
if err != nil {
|
|
@@ -1008,4 +1038,4 @@ func (this *CompanyController) CompanyShareListByCity() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
|
|
|
-}
|
|
|
+}
|