瀏覽代碼

Merge branch 'debug' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

xingzai 1 年之前
父節點
當前提交
81c0dfb5f9
共有 1 個文件被更改,包括 25 次插入3 次删除
  1. 25 3
      controllers/company_apply_v2.go

+ 25 - 3
controllers/company_apply_v2.go

@@ -519,8 +519,15 @@ func (this *CompanyApplyController) ApplyTurnPositive() {
 		br.ErrMsg = "客户状态为:" + companyProduct.Status + ";不可进行转正申请"
 		return
 	}
+
+	companyItem, e := company.GetCompanyById(req.CompanyId)
+	if e != nil {
+		br.Msg = "客户信息有误"
+		br.ErrMsg = "获取客户信息失败, Err: " + e.Error()
+		return
+	}
 	//客户归属判断
-	if companyProduct.SellerId != sysUser.AdminId {
+	if companyProduct.SellerId != sysUser.AdminId && companyItem.ShareSellerId != sysUser.AdminId {
 		br.Msg = "客户信息异常"
 		br.ErrMsg = "客户信息异常,不是当前所属销售,客户所属销售:" + companyProduct.SellerName + ";当前销售:" + sysUser.AdminName
 		return
@@ -1397,12 +1404,19 @@ func (this *CompanyApplyController) ApplyThaw() {
 		return
 	}
 
+	companyItem, e := company.GetCompanyById(req.CompanyId)
+	if e != nil {
+		br.Msg = "客户信息有误"
+		br.ErrMsg = "获取客户信息失败, Err: " + e.Error()
+		return
+	}
 	//客户归属判断
-	if companyProduct.SellerId != sysUser.AdminId {
+	if companyProduct.SellerId != sysUser.AdminId && companyItem.ShareSellerId != sysUser.AdminId {
 		br.Msg = "客户信息异常"
 		br.ErrMsg = "客户信息异常,不是当前所属销售,客户所属销售:" + companyProduct.SellerName + ";当前销售:" + sysUser.AdminName
 		return
 	}
+
 	// CRM8.8(仅针对权益客户)-此处同申请试用的逻辑
 	if companyProduct.ProductId == utils.COMPANY_PRODUCT_RAI_ID {
 		reportPermissions, e := company.GetCompanyReportPermission(req.CompanyId, utils.COMPANY_PRODUCT_RAI_ID)
@@ -1643,12 +1657,20 @@ func (this *CompanyApplyController) ApplyDelay() {
 		br.Msg = "存在待审批订单,不可重复提交"
 		return
 	}
+
+	companyItem, e := company.GetCompanyById(req.CompanyId)
+	if e != nil {
+		br.Msg = "客户信息有误"
+		br.ErrMsg = "获取客户信息失败, Err: " + e.Error()
+		return
+	}
 	//客户归属判断
-	if companyProduct.SellerId != sysUser.AdminId {
+	if companyProduct.SellerId != sysUser.AdminId && companyItem.ShareSellerId != sysUser.AdminId {
 		br.Msg = "客户信息异常"
 		br.ErrMsg = "客户信息异常,不是当前所属销售,客户所属销售:" + companyProduct.SellerName + ";当前销售:" + sysUser.AdminName
 		return
 	}
+
 	// CRM8.8(仅针对权益客户)-申请延期的权限不再进行选择, 而是自动将所有的试用权限延期
 	if companyProduct.ProductId == utils.COMPANY_PRODUCT_RAI_ID {
 		reportPermissions, e := company.GetCompanyReportPermission(req.CompanyId, utils.COMPANY_PRODUCT_RAI_ID)