|
@@ -507,7 +507,7 @@ func (this *ContractAllocationController) CompanyContracDetail() {
|
|
|
}
|
|
|
|
|
|
//var contractPermissionList []*company.ContractPermissionList
|
|
|
- expMap := map[int]string{0: "(3w)", 1: "(5w)", 2: "(10w)"} // 买方研选价格
|
|
|
+ //expMap := map[int]string{0: "(3w)", 1: "(5w)", 2: "(10w)"} // 买方研选价格
|
|
|
hasPermissions, e := company.GetCompanyContractPermissionByCompanyContractId(companyContractId)
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -515,8 +515,12 @@ func (this *ContractAllocationController) CompanyContracDetail() {
|
|
|
return
|
|
|
}
|
|
|
hasMap := make(map[int]*company.CompanyContractPermission)
|
|
|
+ var pointMoney float64
|
|
|
for _, p := range hasPermissions {
|
|
|
hasMap[p.ChartPermissionId] = p
|
|
|
+ if p.ChartPermissionId == utils.YAN_XUAN_KOU_DIAN_BAO_ID {
|
|
|
+ pointMoney = 0.2 * p.Points
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
raiPermissions, e := company.GetPermissionLookItemsExt("2", utils.COMPANY_PRODUCT_RAI_NAME)
|
|
@@ -528,6 +532,7 @@ func (this *ContractAllocationController) CompanyContracDetail() {
|
|
|
mapPermissionNameHave := make(map[string]bool) // 判断合同是否存在某一行业权限种类
|
|
|
var expensiveYx int
|
|
|
for _, n := range raiPermissions {
|
|
|
+
|
|
|
match := hasMap[n.ChartPermissionId]
|
|
|
if match == nil {
|
|
|
continue
|
|
@@ -537,32 +542,44 @@ func (this *ContractAllocationController) CompanyContracDetail() {
|
|
|
// 买方研选(3w/5w/10w)
|
|
|
if n.PermissionName == utils.CHART_PERMISSION_NAME_MF_YANXUAN {
|
|
|
expensiveYx = match.ExpensiveYx
|
|
|
- n.PermissionName += expMap[match.ExpensiveYx]
|
|
|
+ //n.PermissionName += expMap[match.ExpensiveYx]
|
|
|
continue
|
|
|
}
|
|
|
}
|
|
|
|
|
|
resp.Money = contractItem.Money / 10000
|
|
|
//有研选时,对研选套餐类型做文案处理
|
|
|
- respItemYx := new(cygx.AllocationPermissionListResp)
|
|
|
- if mapPermissionNameHave[utils.CHART_PERMISSION_NAME_MF_YANXUAN] {
|
|
|
+ respItemYx := new(cygx.AllocationPermissionListResp) // 研选订阅
|
|
|
+ respItemYxKouDian := new(cygx.AllocationPermissionListResp) // 研选扣点
|
|
|
+ if mapPermissionNameHave[utils.CHART_PERMISSION_NAME_MF_YANXUAN] || mapPermissionNameHave[utils.YAN_XUAN_KOU_DIAN_BAO_NAME] {
|
|
|
var moneyYx float64
|
|
|
- if expensiveYx == 0 {
|
|
|
- moneyYx = 3
|
|
|
- } else if expensiveYx == 1 {
|
|
|
- moneyYx = 5
|
|
|
- } else if expensiveYx == 2 {
|
|
|
- moneyYx = 10
|
|
|
+ if mapPermissionNameHave[utils.CHART_PERMISSION_NAME_MF_YANXUAN] {
|
|
|
+ if expensiveYx == 0 {
|
|
|
+ moneyYx = 3
|
|
|
+ } else if expensiveYx == 1 {
|
|
|
+ moneyYx = 5
|
|
|
+ } else if expensiveYx == 2 {
|
|
|
+ moneyYx = 10
|
|
|
+ }
|
|
|
+ respItemYx.Proportion = 0
|
|
|
+ respItemYx.Money = moneyYx
|
|
|
+ respItemYx.ChartPermissionName = utils.CHART_PERMISSION_NAME_MF_YANXUAN
|
|
|
+ respItemYx.List = append(respItemYx.List, &cygx.AllocationRealNameListResp{utils.CHART_PERMISSION_NAME_MF_YANXUAN, 0, moneyYx})
|
|
|
+ }
|
|
|
+
|
|
|
+ if mapPermissionNameHave[utils.YAN_XUAN_KOU_DIAN_BAO_NAME] {
|
|
|
+ respItemYxKouDian.Proportion = 0
|
|
|
+ respItemYxKouDian.Money = pointMoney
|
|
|
+ respItemYxKouDian.ChartPermissionName = utils.YAN_XUAN_KOU_DIAN_BAO_NAME
|
|
|
+ respItemYxKouDian.List = append(respItemYxKouDian.List, &cygx.AllocationRealNameListResp{utils.YAN_XUAN_KOU_DIAN_BAO_NAME, 0, pointMoney})
|
|
|
}
|
|
|
- resp.TotalPointsContent = fmt.Sprint(resp.Money, "W,", "其中", moneyYx, "w默认归属买方研选,请对剩余", resp.Money-moneyYx, "w按照100%进行比值分配")
|
|
|
+
|
|
|
+ resp.TotalPointsContent = fmt.Sprint(resp.Money, "W,", "其中", moneyYx+pointMoney, "w默认归属买方研选,请对剩余", resp.Money-moneyYx-pointMoney, "w按照100%进行比值分配")
|
|
|
if showDetail {
|
|
|
resp.TotalPointsContent = fmt.Sprint(resp.Money, "W")
|
|
|
}
|
|
|
resp.Money = resp.Money - moneyYx
|
|
|
- respItemYx.Proportion = 0
|
|
|
- respItemYx.Money = moneyYx
|
|
|
- respItemYx.ChartPermissionName = utils.CHART_PERMISSION_NAME_MF_YANXUAN
|
|
|
- respItemYx.List = append(respItemYx.List, &cygx.AllocationRealNameListResp{utils.CHART_PERMISSION_NAME_MF_YANXUAN, 0, moneyYx})
|
|
|
+
|
|
|
} else {
|
|
|
resp.TotalPointsContent = fmt.Sprint(resp.Money, "W")
|
|
|
}
|
|
@@ -591,9 +608,15 @@ func (this *ContractAllocationController) CompanyContracDetail() {
|
|
|
respItem.List = v
|
|
|
respList = append(respList, respItem)
|
|
|
}
|
|
|
+ //研选订阅
|
|
|
if respItemYx.ChartPermissionName != "" {
|
|
|
respList = append(respList, respItemYx)
|
|
|
}
|
|
|
+ //研选扣点
|
|
|
+ if respItemYxKouDian.ChartPermissionName != "" {
|
|
|
+ respList = append(respList, respItemYxKouDian)
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
listUser, err := cygx.GetCygxAllocationCompanyContractListById(companyContractId)
|
|
|
if err != nil {
|
|
@@ -637,7 +660,7 @@ func (this *ContractAllocationController) CompanyContracDetail() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- permissionNameArr := []string{"医药", "消费", "科技", "智造", "策略", "买方研选"}
|
|
|
+ permissionNameArr := []string{"医药", "消费", "科技", "智造", "策略", utils.CHART_PERMISSION_NAME_MF_YANXUAN, utils.YAN_XUAN_KOU_DIAN_BAO_NAME}
|
|
|
for _, v := range permissionNameArr {
|
|
|
for _, v2 := range respList {
|
|
|
if v2.ChartPermissionName == v {
|