|
@@ -414,7 +414,7 @@ func CheckActivitySpecialUpdatePower(adminId int, activityInfo *cygx.ActivitySpe
|
|
|
}
|
|
|
|
|
|
// GetChartPermissionSpecialSurplusByCompany 获取公司专项调研次数-分品种
|
|
|
-func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, chartNumMap map[int]int,mapChartName map[string]int, err error) {
|
|
|
+func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, tripRemaining int,mapChartName map[string]int, err error) {
|
|
|
companyDetail, e := cygx.GetCompanyDetailByIdGroup(companyId)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetCompanyDetailByIdGroup, Err: " + e.Error())
|
|
@@ -430,7 +430,7 @@ func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, cha
|
|
|
specialSurplus = "不限次数"
|
|
|
}
|
|
|
//chartMap := map[int]string{utils.YI_YAO_ID:utils.YI_YAO_NAME, utils.XIAO_FEI_ID:utils.XIAO_FEI_NAME, utils.KE_JI_ID:utils.KE_JI_NAME, utils.ZHI_ZAO_ID:utils.ZHI_ZAO_NAME}
|
|
|
- chartNumMap = map[int]int{utils.YI_YAO_ID:0, utils.XIAO_FEI_ID:0, utils.KE_JI_ID:0, utils.ZHI_ZAO_ID:0}
|
|
|
+ //chartNumMap := map[int]int{utils.YI_YAO_ID:0, utils.XIAO_FEI_ID:0, utils.KE_JI_ID:0, utils.ZHI_ZAO_ID:0}
|
|
|
if companyDetail.Status == "正式" {
|
|
|
var packageType int
|
|
|
userType, packageType, _, _, _ = GetUserType(companyId)
|
|
@@ -471,13 +471,16 @@ func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, cha
|
|
|
//}
|
|
|
var TripBillNum int
|
|
|
for _, v := range listTripBill {
|
|
|
+ if v.ActivityId == 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
TripBillNum += v.BillDetailed
|
|
|
}
|
|
|
// CRM13.2 70w客户有16次专项调研, 45w有10次
|
|
|
packageTypeMap := map[int]int{1: 16, 2: 10}
|
|
|
totalTrip := packageTypeMap[packageType]
|
|
|
|
|
|
- tripRemaining := totalTrip + TripBillNum
|
|
|
+ tripRemaining = totalTrip + TripBillNum
|
|
|
if tripRemaining < 0 {
|
|
|
tripRemaining = 0
|
|
|
}
|
|
@@ -542,6 +545,9 @@ func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, cha
|
|
|
}
|
|
|
//var TripBillNum int
|
|
|
for _, v := range listTripBill {
|
|
|
+ if v.ActivityId == 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
mapPermissionNameTrip[v.ChartPermissionName] += v.BillDetailed
|
|
|
}
|
|
|
for _, v := range chartList {
|
|
@@ -567,8 +573,7 @@ func ActivitySpecialCompanyApproval(companyId int,companyName string) (err error
|
|
|
itemBill.CompanyName = companyName
|
|
|
itemBill.Source = 2
|
|
|
itemBill.DoType = 2
|
|
|
- itemBill.BillDetailed = 1 // 流水加一
|
|
|
-
|
|
|
+ itemBill.Content = "套餐转正"
|
|
|
if userType == 2{
|
|
|
packageTypeMap := map[int]int{1: 16, 2: 10}
|
|
|
totalTrip := packageTypeMap[packageType]
|