Browse Source

no message

xingzai 6 months ago
parent
commit
b543157303
3 changed files with 38 additions and 29 deletions
  1. 1 0
      controllers/company.go
  2. 27 24
      models/company/company.go
  3. 10 5
      services/company.go

+ 1 - 0
controllers/company.go

@@ -1766,6 +1766,7 @@ func (this *CompanyController) List() {
 				CloseReason:     v.CloseReason,
 				ShareSellerId:   v.ShareSellerId,
 				ShareSellerIds:  v.ShareSellerIds,
+				IsUserMaker:     v.IsUserMaker,
 			}
 			if v.ShareSellerIds != "" {
 				shareSellerIds := strings.Split(v.ShareSellerIds, ",")

+ 27 - 24
models/company/company.go

@@ -213,6 +213,7 @@ type CompanyItem struct {
 	CloseReason         string               `description:"关闭原因"`
 	CloseTime           string               `description:"关闭时间"`
 	Nation              string               `description:"所属国家"`
+	IsUserMaker         int                  `description:"近四周之内是否包含决策人互动过 ,0否,1是"`
 	LatestServiceRecord time.Time            `description:"最近沟通时间"`
 	FirstDate           time.Time            `description:"首次服务时间"`
 }
@@ -281,6 +282,7 @@ type CompanyListItem struct {
 	CloseReason      string               `description:"关闭客户原因"`
 	CloseTime        string               `description:"关闭客户时间"`
 	IsScrounge       int                  `description:"是否白嫖 0不是 1是"`
+	IsUserMaker      int                  `description:"近四周之内是否包含决策人互动过 ,0否,1是"`
 }
 
 type TryStageSliceItem struct {
@@ -320,7 +322,7 @@ func GetCompanyList(condition, status, sortStr string, pars []interface{}, start
 	// 权益客户: 以权益最后一次阅读时间作为参考
 	t := time.Now().Local().AddDate(0, 0, -7).Format(utils.FormatDate)
 
-	sql := `SELECT a.company_id,a.company_name,a.credit_code,a.company_code,a.created_time,a.province,a.city,a.address,a.region_type,b.group_id,b.road_show_total,b.is_share,
+	sql := `SELECT a.company_id,a.company_name,a.credit_code,a.company_code,a.created_time,a.province,a.city,a.address,a.region_type,b.group_id,b.road_show_total,b.is_share,b.is_user_maker,
 			CASE 
      WHEN GROUP_CONCAT(b.status) LIKE "%永续%" THEN 1
 	 WHEN GROUP_CONCAT(b.status) LIKE "%正式%" THEN 2
@@ -1235,29 +1237,30 @@ type CheckCompanyInfoRepeatResp struct {
 }
 
 type ButtonPermission struct {
-	BtnView          bool `description:"查看按钮权限:true显示,false不显示"`
-	BtnEdit          bool `description:"编辑按钮权限:true显示,false不显示"`
-	BtnDelete        bool `description:"删除按钮权限:true显示,false不显示"`
-	BtnSuspend       bool `description:"暂停/启用按钮权限:true显示,false不显示"`
-	BtnDelay         bool `description:"申请延期按钮权限:true显示,false不显示"`
-	BtnTurnPositive  bool `description:"申请转正按钮权限:true显示,false不显示"`
-	BtnUpdate        bool `description:"服务更新按钮权限:true显示,false不显示"`
-	BtnAddAgreement  bool `description:"补充协议按钮权限:true显示,false不显示"`
-	BtnThaw          bool `description:"申请解冻按钮权限:true显示,false不显示"`
-	BtnApplyReceive  bool `description:"申请领取按钮权限:true显示,false不显示"`
-	BtnReceive       bool `description:"领取客户按钮权限:true显示,false不显示"`
-	BtnModifySeller  bool `description:"修改销售按钮权限:true显示,false不显示"`
-	BtnReceiveOther  bool `description:"领取其他部门客户按钮权限:true显示,false不显示"`
-	BtnFreeze        bool `description:"冻结按钮权限:true显示,false不显示"`
-	BtnTryOut        bool `description:"增开试用:true显示,false不显示"`
-	BtnDetail        bool `description:"详情按钮:true显示,false不显示"`
-	BtnRemarkEdit    bool `description:"编辑备注按钮:true显示,false不显示"`
-	BtnRemarkView    bool `description:"查看备注按钮:true显示,false不显示"`
-	BtnShare         bool `description:"设置共享按钮:true显示,false不显示"`
-	BtnServiceRecord bool `description:"查看服务记录按钮:true显示,false不显示"`
-	BtnClose         bool `description:"关闭客户按钮:true显示,false不显示"`
-	BtnLoss          bool `description:"转流失按钮:true显示,false不显示"`
-	IsResearchShow   bool `description:"研选详情展示控制:true显示,false不显示"`
+	BtnView              bool `description:"查看按钮权限:true显示,false不显示"`
+	BtnEdit              bool `description:"编辑按钮权限:true显示,false不显示"`
+	BtnDelete            bool `description:"删除按钮权限:true显示,false不显示"`
+	BtnSuspend           bool `description:"暂停/启用按钮权限:true显示,false不显示"`
+	BtnDelay             bool `description:"申请延期按钮权限:true显示,false不显示"`
+	BtnTurnPositive      bool `description:"申请转正按钮权限:true显示,false不显示"`
+	BtnUpdate            bool `description:"服务更新按钮权限:true显示,false不显示"`
+	BtnAddAgreement      bool `description:"补充协议按钮权限:true显示,false不显示"`
+	BtnThaw              bool `description:"申请解冻按钮权限:true显示,false不显示"`
+	BtnApplyReceive      bool `description:"申请领取按钮权限:true显示,false不显示"`
+	BtnReceive           bool `description:"领取客户按钮权限:true显示,false不显示"`
+	BtnModifySeller      bool `description:"修改销售按钮权限:true显示,false不显示"`
+	BtnReceiveOther      bool `description:"领取其他部门客户按钮权限:true显示,false不显示"`
+	BtnFreeze            bool `description:"冻结按钮权限:true显示,false不显示"`
+	BtnTryOut            bool `description:"增开试用:true显示,false不显示"`
+	BtnDetail            bool `description:"详情按钮:true显示,false不显示"`
+	BtnRemarkEdit        bool `description:"编辑备注按钮:true显示,false不显示"`
+	BtnRemarkView        bool `description:"查看备注按钮:true显示,false不显示"`
+	BtnRemarkViewHistory bool `description:"查看历史备注按钮:true显示,false不显示"`
+	BtnShare             bool `description:"设置共享按钮:true显示,false不显示"`
+	BtnServiceRecord     bool `description:"查看服务记录按钮:true显示,false不显示"`
+	BtnClose             bool `description:"关闭客户按钮:true显示,false不显示"`
+	BtnLoss              bool `description:"转流失按钮:true显示,false不显示"`
+	IsResearchShow       bool `description:"研选详情展示控制:true显示,false不显示"`
 }
 
 type ButtonSearchPermission struct {

+ 10 - 5
services/company.go

@@ -1163,7 +1163,8 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
 						button.BtnModifySeller = true
 						//button.BtnShare = true
 						button.BtnRemarkEdit = true
-						button.BtnRemarkView = true
+						button.BtnRemarkView = true //权益销售隐藏
+						button.BtnRemarkViewHistory = true
 					} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
 						button.BtnEdit = true
 						button.BtnDelete = true
@@ -1173,7 +1174,8 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
 						button.BtnModifySeller = true
 						button.BtnFreeze = true
 						button.BtnRemarkEdit = true
-						button.BtnRemarkView = true
+						button.BtnRemarkView = true //权益销售隐藏
+						button.BtnRemarkViewHistory = true
 						//button.BtnShare = true
 					} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
 						button.BtnThaw = true
@@ -1204,14 +1206,17 @@ func GetCompanyPermissionButton(roleTypeCode, status, itemSellerIds, itemGroupId
 				if productStatus == utils.COMPANY_STATUS_FORMAL { //正式
 					button.BtnModifySeller = true
 					//button.BtnShare = true
-					button.BtnRemarkView = true
+					button.BtnRemarkView = true //权益销售隐藏
+					button.BtnRemarkViewHistory = true
 				} else if productStatus == utils.COMPANY_STATUS_TRY_OUT { //试用
 					button.BtnModifySeller = true
-					button.BtnRemarkView = true
+					button.BtnRemarkView = true //权益销售隐藏
+					button.BtnRemarkViewHistory = true
 					//button.BtnShare = true
 				} else if productStatus == utils.COMPANY_STATUS_FREEZE { //冻结
 					button.BtnModifySeller = true
-					button.BtnRemarkView = true
+					button.BtnRemarkView = true //权益销售隐藏
+					button.BtnRemarkViewHistory = true
 				} else if productStatus == utils.COMPANY_STATUS_LOSE { //流失
 					if sellerId == sysUserId || groupId == sysUserGroupId || utils.InArrayByStr(shareSellerIdArr, strconv.Itoa(sysUserId)) || shareSellerId == sysUserId {
 						button.BtnApplyReceive = true