Bladeren bron

Merge branch 'feature/pool381_fms_invice' into debug

xyxie 3 dagen geleden
bovenliggende
commit
7e46db5927
4 gewijzigde bestanden met toevoegingen van 52 en 7 verwijderingen
  1. 6 7
      controllers/statistic_report.go
  2. 23 0
      controllers/sys_user.go
  3. 22 0
      controllers/user_login.go
  4. 1 0
      models/system/sys_user.go

+ 6 - 7
controllers/statistic_report.go

@@ -6133,7 +6133,6 @@ func (this *StatisticReportController) InvoicePaymentList() {
 	sortParam := this.GetString("SortParam")
 	sortType := this.GetString("SortType")
 	sellerIdstr := this.GetString("SellerIds")
-	shareSellerIdstr := this.GetString("ShareSellerIds")
 	cond := `1 = 1`
 	pars := make([]interface{}, 0)
 
@@ -6145,10 +6144,9 @@ func (this *StatisticReportController) InvoicePaymentList() {
 	}
 	if sellerIdstr != "" {
 		//sellerIds := strings.Split(sellerIdstr, ",")
-		cond += ` AND (c.seller_id in (` + sellerIdstr + `) OR d.seller_id in  (` + sellerIdstr + `))`
+		cond += ` AND (c.seller_id in (` + sellerIdstr + `) OR d.seller_id in  (` + sellerIdstr + `)`
 		//pars = append(pars, sellerIds, sellerIds)
-	}
-	if shareSellerIdstr != "" {
+	    shareSellerIdstr := sellerIdstr
 		// 校验入参
 		shareSellerIdsSlice := strings.Split(shareSellerIdstr, ",")
 		shareSellerIds := make([]int, 0)
@@ -6175,14 +6173,15 @@ func (this *StatisticReportController) InvoicePaymentList() {
 		}
 		if len(companyNames) > 0 {
 			 if len(contractCodes) > 0 {
-				cond += ` AND (b.company_name IN (` + utils.GetOrmInReplace(len(companyNames)) + `) OR b.contract_code IN (` + utils.GetOrmInReplace(len(contractCodes)) + `))`
+				cond += ` OR b.company_name IN (` + utils.GetOrmInReplace(len(companyNames)) + `) OR b.contract_code IN (` + utils.GetOrmInReplace(len(contractCodes)) + `)`
 				pars = append(pars, companyNames, contractCodes)
 			 } else {
-				cond += ` AND b.company_name IN (` + utils.GetOrmInReplace(len(companyNames)) + `)`
+				cond += ` OR b.company_name IN (` + utils.GetOrmInReplace(len(companyNames)) + `)`
 				pars = append(pars, companyNames)
 			 }
+			 
 		}
-
+		cond += ` )`
 	}
 	// 套餐筛选
 	if serviceType != "" {

+ 23 - 0
controllers/sys_user.go

@@ -142,13 +142,36 @@ func (this *SysUserController) Login() {
 	//} else {
 	//	productName = "admin"
 	//}
+	// 咨询组的分组id
+	shareGroupId := 0
+	if utils.RunMode == "release" {
+		shareGroupId = 37
+	} else {
+		shareGroupId = 61
+	}
+
+	raiSharedGroupId := 0
+	if utils.RunMode == "release" {
+		raiSharedGroupId = 68
+	} else {
+		raiSharedGroupId = 132
+	}
+
 	if productId == 1 {
 		productName = utils.COMPANY_PRODUCT_FICC_NAME
+		if sysUser.GroupId == shareGroupId {
+			resp.IsShareSeller = 1
+		}
 	} else if productId == 2 {
 		productName = utils.COMPANY_PRODUCT_RAI_NAME
+		if sysUser.GroupId == raiSharedGroupId {
+			resp.IsShareSeller = 1
+		}
 	} else {
 		productName = "admin"
 	}
+
+	
 	resp.ProductName = productName
 	resp.Authority = sysUser.Authority
 	br.Ret = 200

+ 22 - 0
controllers/user_login.go

@@ -502,12 +502,34 @@ func (this *UserLoginController) Login() {
 		resp.RoleTypeCode = utils.ROLE_TYPE_CODE_FICC_SELLER
 	}
 	resp.AdminId = sysUser.AdminId
+
+	// 咨询组的分组id
+	shareGroupId := 0
+	if utils.RunMode == "release" {
+		shareGroupId = 37
+	} else {
+		shareGroupId = 61
+	}
+
+	raiSharedGroupId := 0
+	if utils.RunMode == "release" {
+		raiSharedGroupId = 68
+	} else {
+		raiSharedGroupId = 132
+	}
+
 	var productName string
 	productId := services.GetProductId(sysUser.RoleTypeCode)
 	if productId == 1 {
 		productName = utils.COMPANY_PRODUCT_FICC_NAME
+		if sysUser.GroupId == shareGroupId {
+			resp.IsShareSeller = 1
+		}
 	} else if productId == 2 {
 		productName = utils.COMPANY_PRODUCT_RAI_NAME
+		if sysUser.GroupId == raiSharedGroupId {
+			resp.IsShareSeller = 1
+		}
 	} else {
 		productName = "admin"
 	}

+ 1 - 0
models/system/sys_user.go

@@ -20,6 +20,7 @@ type LoginResp struct {
 	RealName        string `description:"系统用户姓名"`
 	RoleName        string `description:"角色名称"`
 	RoleTypeCode    string `description:"角色类型编码"`
+	IsShareSeller   int    `description:"是否共享销售"`
 	SysRoleTypeCode string `description:"角色类型编码"`
 	AdminId         int    `description:"系统用户id"`
 	ProductName     string `description:"产品名称:admin,ficc,权益"`