|
@@ -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)
|
|
@@ -1918,6 +1940,7 @@ func (this *CompanyApplyController) ApplyContract() {
|
|
|
//升级
|
|
|
mapUpgrade := make(map[int]int)
|
|
|
mapExpensive := make(map[int]bool)
|
|
|
+ var expensiveYx int
|
|
|
permissionList, err := company.GetCompanyContractPermissionByCompanyContractId(contractItem.CompanyContractId)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取失败"
|
|
@@ -1929,8 +1952,9 @@ func (this *CompanyApplyController) ApplyContract() {
|
|
|
if v.IsUpgrade == 1 {
|
|
|
mapUpgrade[v.ChartPermissionId] = v.ChartPermissionId
|
|
|
}
|
|
|
- if v.ExpensiveYx == 1 {
|
|
|
+ if v.ExpensiveYx > 0 {
|
|
|
mapExpensive[v.ChartPermissionId] = true
|
|
|
+ expensiveYx = v.ExpensiveYx
|
|
|
}
|
|
|
permissionIds = append(permissionIds, v.ChartPermissionId)
|
|
|
}
|
|
@@ -1951,8 +1975,12 @@ func (this *CompanyApplyController) ApplyContract() {
|
|
|
checkList = append(checkList, n.ChartPermissionId+utils.PERMISSION_ID_UPGRADE)
|
|
|
} else {
|
|
|
if mapExpensive[n.ChartPermissionId] {
|
|
|
- // 研选5w
|
|
|
- checkList = append(checkList, n.ChartPermissionId+utils.PERMISSION_ID_YANXUAN_DIFF)
|
|
|
+ // 研选5w与10W
|
|
|
+ if expensiveYx == 1 {
|
|
|
+ checkList = append(checkList, n.ChartPermissionId+utils.PERMISSION_ID_YANXUAN_DIFF) // 5W
|
|
|
+ } else {
|
|
|
+ checkList = append(checkList, utils.PERMISSION_ID_YANXUAN_10W_DIFF) // 10W
|
|
|
+ }
|
|
|
} else {
|
|
|
// 非内部人员, 忽略掉已有的客观权限, 否则前端升级的反选会出现问题, 重新提交的时候只提交主观权限也有对应的处理
|
|
|
if !strings.Contains(n.Remark, "客观") {
|
|
@@ -1967,9 +1995,9 @@ func (this *CompanyApplyController) ApplyContract() {
|
|
|
//mapChartPermissionId[n.ChartPermissionId] = n.ChartPermissionId
|
|
|
}
|
|
|
|
|
|
- // 买方研选3w/5w
|
|
|
+ // 买方研选3w/5w/10w
|
|
|
if n.PermissionName == utils.CHART_PERMISSION_NAME_MF_YANXUAN {
|
|
|
- m3, m5 := new(company.PermissionLookItem), new(company.PermissionLookItem)
|
|
|
+ m3, m5, m10 := new(company.PermissionLookItem), new(company.PermissionLookItem), new(company.PermissionLookItem)
|
|
|
m3.ChartPermissionId = n.ChartPermissionId
|
|
|
m3.PermissionName = fmt.Sprint(n.PermissionName, "(3w)")
|
|
|
plist.Items = append(plist.Items, m3)
|
|
@@ -1977,6 +2005,10 @@ func (this *CompanyApplyController) ApplyContract() {
|
|
|
m5.ChartPermissionId = n.ChartPermissionId + utils.PERMISSION_ID_YANXUAN_DIFF
|
|
|
m5.PermissionName = fmt.Sprint(n.PermissionName, "(5w)")
|
|
|
plist.Items = append(plist.Items, m5)
|
|
|
+
|
|
|
+ m10.ChartPermissionId = utils.PERMISSION_ID_YANXUAN_10W_DIFF
|
|
|
+ m10.PermissionName = fmt.Sprint(n.PermissionName, "(10w)")
|
|
|
+ plist.Items = append(plist.Items, m10)
|
|
|
continue
|
|
|
}
|
|
|
|