xingzai 1 年間 前
コミット
cf0e0f847c

+ 29 - 7
controllers/company_apply.go

@@ -74,7 +74,7 @@ func (this *CompanyApplyController) ApplyContractHistoryList() {
 	//	raiPermissions = ps
 	//}
 
-	expMap := map[int]string{0: "(3w)", 1: "(5w)"} // 买方研选价格
+	//expMap := map[int]string{0: "(3w)", 1: "(5w)"} // 买方研选价格
 	for i := 0; i < listLen; i++ {
 		companyContract := list[i]
 		list[i].ModifyTimeStr = companyContract.ModifyTime.Format(utils.FormatDateTime)
@@ -120,6 +120,7 @@ func (this *CompanyApplyController) ApplyContractHistoryList() {
 			//	br.ErrMsg = "获取权限信息失败,Err:" + err.Error()
 			//	return
 			//}
+			var expensiveYx int
 			hasPermissions, e := company.GetCompanyContractPermissionByCompanyContractId(companyContract.CompanyContractId)
 			if e != nil {
 				br.Msg = "获取失败"
@@ -129,6 +130,9 @@ func (this *CompanyApplyController) ApplyContractHistoryList() {
 			hasMap := make(map[int]*company.CompanyContractPermission)
 			for _, p := range hasPermissions {
 				hasMap[p.ChartPermissionId] = p
+				if p.ExpensiveYx > 0 {
+					expensiveYx = p.ExpensiveYx
+				}
 			}
 
 			checkItems := make([]*company.PermissionLookItem, 0)
@@ -155,7 +159,14 @@ func (this *CompanyApplyController) ApplyContractHistoryList() {
 				}
 				// 买方研选(3w/5w)
 				if n.PermissionName == utils.CHART_PERMISSION_NAME_MF_YANXUAN {
-					n.PermissionName += expMap[match.ExpensiveYx]
+					if expensiveYx == 1 {
+						n.PermissionName += "(5w)"
+					} else if expensiveYx == 2 {
+						n.PermissionName += "(10w)"
+					} else if expensiveYx == 0 {
+						n.PermissionName += "(3w)"
+					}
+					//n.PermissionName += expMap[match.ExpensiveYx]
 					checkList = append(checkList, n.ChartPermissionId)
 					checkItems = append(checkItems, n)
 					continue
@@ -390,8 +401,8 @@ func (this *CompanyApplyController) ApplyContractDetail() {
 		}
 		permissions := make([]int, 0) // 合同权限IDs
 		checkItems := make([]*company.PermissionLookItem, 0)
-		expMap := map[bool]string{false: "(3w)", true: "(5w)"} // 买方研选价格
-
+		//expMap := map[bool]string{false: "(3w)", true: "(5w)"} // 买方研选价格
+		var expensiveYx int
 		// 未选大套餐, 走老逻辑
 		if detail.RaiPackageType == 0 {
 			mapUpgrade := make(map[int]bool) // 通过合同获取所勾选的升级行业权限
@@ -400,8 +411,9 @@ func (this *CompanyApplyController) ApplyContractDetail() {
 				if v.IsUpgrade == 1 {
 					mapUpgrade[v.ChartPermissionId] = true
 				}
-				if v.ExpensiveYx == 1 {
+				if v.ExpensiveYx > 0 {
 					mapExpensive[v.ChartPermissionId] = true
+					expensiveYx = v.ExpensiveYx
 				}
 				permissions = append(permissions, v.ChartPermissionId)
 			}
@@ -438,7 +450,12 @@ func (this *CompanyApplyController) ApplyContractDetail() {
 					}
 					// 买方研选
 					if p.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
-						p.PermissionName += expMap[mapExpensive[p.ChartPermissionId]]
+						if expensiveYx == 1 {
+							p.PermissionName += "(5w)"
+						} else if expensiveYx == 2 {
+							p.PermissionName += "(10w)"
+						}
+						//p.PermissionName += expMap[mapExpensive[p.ChartPermissionId]]
 					}
 				}
 			}
@@ -474,7 +491,12 @@ func (this *CompanyApplyController) ApplyContractDetail() {
 					continue
 				}
 				if n.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
-					n.PermissionName += expMap[mapExpensive[n.ChartPermissionId]]
+					//n.PermissionName += expMap[mapExpensive[n.ChartPermissionId]]
+					if expensiveYx == 1 {
+						n.PermissionName += "(5w)"
+					} else if expensiveYx == 2 {
+						n.PermissionName += "(10w)"
+					}
 				}
 				if utils.InArrayByInt(permissions, n.ChartPermissionId) {
 					checkList = append(checkList, n.ChartPermissionId)

+ 1 - 1
controllers/company_apply_v2.go

@@ -454,7 +454,7 @@ func (this *CompanyApplyController) ApplyTurnPositive() {
 			// 研选10w的处理
 			if permissionId == utils.PERMISSION_ID_YANXUAN_10W_DIFF {
 				//permissionIdsNew += strconv.Itoa(utils.CHART_PERMISSION_ID_YANXUAN) + ","
-				strPermissionIdArr = append(strPermissionIdArr, strconv.Itoa(utils.PERMISSION_ID_YANXUAN_10W_DIFF))
+				strPermissionIdArr = append(strPermissionIdArr, strconv.Itoa(utils.CHART_PERMISSION_ID_YANXUAN))
 				expensiveYx = 2
 				continue
 			}

+ 3 - 2
controllers/cygx/contract_allocation.go

@@ -549,9 +549,10 @@ func (this *ContractAllocationController) CompanyContracDetail() {
 		var moneyYx float64
 		if expensiveYx == 0 {
 			moneyYx = 3
-		}
-		if expensiveYx == 1 {
+		} else if expensiveYx == 1 {
 			moneyYx = 5
+		} else if expensiveYx == 2 {
+			moneyYx = 10
 		}
 		resp.TotalPointsContent = fmt.Sprint(resp.Money, "W,", "其中", moneyYx, "w默认归属买方研选,请对剩余", resp.Money-moneyYx, "w按照100%进行比值分配")
 		if showDetail {

+ 2 - 1
models/company/company_permission.go

@@ -104,7 +104,7 @@ type CompanyReportPermission struct {
 	Status                    string    `description:"'正式','试用','关闭'"`
 	ModifyTime                time.Time `description:"修改时间"`
 	IsUpgrade                 int       `description:"是否升级,1是,0否"`
-	ExpensiveYx               int       `description:"权益研选: 0-3w; 1-5w"`
+	ExpensiveYx               int       `description:"权益研选: 0-3w; 1-5w ,2: 10W"`
 }
 
 // 新增客户权限
@@ -162,6 +162,7 @@ type PermissionLookItem struct {
 	IsMerge            bool                  `description:"是否合并行业, 给前端的标识, 暂时仅权益使用"`
 	RaiBothHas         bool                  `description:"权益-是否主客观都有"`
 	IsUpgrade          int                   `description:"是否升级,1是,0否"`
+	ExpensiveYx        int                   `description:"权益研选: 0-3w; 1-5w ,2: 10W"`
 	Child              []*PermissionLookItem `description:"子权限"`
 }
 

+ 2 - 0
services/company_permission.go

@@ -70,6 +70,8 @@ func RaiCompanyPermissionAndCheckList(companyId int, unify bool) (resp *company.
 			if v.PermissionName == utils.CHART_PERMISSION_NAME_MF_YANXUAN && strings.Contains("正式,永续", v.Status) {
 				if p.ExpensiveYx == 1 {
 					v.PermissionName = fmt.Sprint(v.PermissionName, "(5w)")
+				} else if p.ExpensiveYx == 2 {
+					v.PermissionName = fmt.Sprint(v.PermissionName, "(10w)")
 				} else {
 					v.PermissionName = fmt.Sprint(v.PermissionName, "(3w)")
 				}