|
@@ -666,14 +666,14 @@ func (this *ActivitySpecialTripCoAntroller) MeetingDo() {
|
|
|
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
- condition += " AND is_meeting = 1 AND activity_id = ? "
|
|
|
- pars = append(pars, activityId)
|
|
|
- listOldMeetingDetail, err := cygx.GetCygxActivitySpecialMeetingDetailList(condition, pars)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "GetCygxActivitySpecialMeetingDetailList,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
+ //condition += " AND is_meeting = 1 AND activity_id = ? "
|
|
|
+ //pars = append(pars, activityId)
|
|
|
+ //listOldMeetingDetail, err := cygx.GetCygxActivitySpecialMeetingDetailList(condition, pars)
|
|
|
+ //if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // br.Msg = "获取失败"
|
|
|
+ // br.ErrMsg = "GetCygxActivitySpecialMeetingDetailList,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
//获取之前已经到会的人
|
|
|
//var oldMeetingUserid = make(map[int]bool)
|
|
|
|
|
@@ -694,53 +694,53 @@ func (this *ActivitySpecialTripCoAntroller) MeetingDo() {
|
|
|
|
|
|
var items []*cygx.CygxActivitySpecialMeetingDetail
|
|
|
var itemsBill []*cygx.CygxActivitySpecialTripBill
|
|
|
- if len(listOldMeetingDetail) > 0 {
|
|
|
- for _, v := range listOldMeetingDetail {
|
|
|
- if mapUserLastTripBill[v.UserId] == nil {
|
|
|
- continue
|
|
|
- }
|
|
|
- //如果上一次空降的用户,这一次提交的时候没有带入,而且还被扣点了,那么就进行返点处理
|
|
|
- if !newMeetingUserid[v.UserId] && v.IsAirborne == 1 && mapUserLastTripBill[v.UserId].BillDetailed < 0 {
|
|
|
- var itemBill = new(cygx.CygxActivitySpecialTripBill)
|
|
|
- //流水记录表
|
|
|
- itemBill.UserId = v.UserId
|
|
|
- itemBill.ActivityId = activityInfo.ActivityId
|
|
|
- itemBill.CreateTime = time.Now()
|
|
|
- itemBill.Mobile = v.Mobile
|
|
|
- itemBill.Email = v.Email
|
|
|
- itemBill.CompanyId = v.CompanyId
|
|
|
- itemBill.CompanyName = v.CompanyName
|
|
|
- itemBill.RealName = v.RealName
|
|
|
- itemBill.Source = 2
|
|
|
- itemBill.DoType = 2
|
|
|
- itemBill.BillDetailed = 1 // 流水加一
|
|
|
- itemBill.RegisterPlatform = 1
|
|
|
- itemBill.ChartPermissionId = activityInfo.ChartPermissionId
|
|
|
- itemBill.ChartPermissionName = activityInfo.ChartPermissionName
|
|
|
- itemBill.AdminId = AdminUser.AdminId
|
|
|
- itemBill.Way = 2
|
|
|
- userType, tripRemaining, mapChartName, err := cygxService.GetChartPermissionSpecialSurplusByCompany(v.CompanyId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取专项调研剩余次数失败"
|
|
|
- br.ErrMsg = "获取专项调研剩余次数失败,err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- if userType == 2 {
|
|
|
- //tripRemaining += itemBill.BillDetailed要处理
|
|
|
- itemBill.Total = strconv.Itoa(tripRemaining) + "次"
|
|
|
- } else {
|
|
|
- for k, num := range mapChartName {
|
|
|
- if activityInfo.ChartPermissionName == k {
|
|
|
- //num += itemBill.BillDetailed要处理
|
|
|
- }
|
|
|
- itemBill.Total += k + strconv.Itoa(num) + "次+"
|
|
|
- }
|
|
|
- itemBill.Total = strings.TrimRight(itemBill.Total, "+")
|
|
|
- }
|
|
|
- itemsBill = append(itemsBill, itemBill)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //if len(listOldMeetingDetail) > 0 {
|
|
|
+ // for _, v := range listOldMeetingDetail {
|
|
|
+ // if mapUserLastTripBill[v.UserId] == nil {
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ // //如果上一次空降的用户,这一次提交的时候没有带入,而且还被扣点了,那么就进行返点处理
|
|
|
+ // if !newMeetingUserid[v.UserId] && v.IsAirborne == 1 && mapUserLastTripBill[v.UserId].BillDetailed < 0 {
|
|
|
+ // //var itemBill = new(cygx.CygxActivitySpecialTripBill)
|
|
|
+ // //流水记录表
|
|
|
+ // itemBill.UserId = v.UserId
|
|
|
+ // itemBill.ActivityId = activityInfo.ActivityId
|
|
|
+ // itemBill.CreateTime = time.Now()
|
|
|
+ // itemBill.Mobile = v.Mobile
|
|
|
+ // itemBill.Email = v.Email
|
|
|
+ // itemBill.CompanyId = v.CompanyId
|
|
|
+ // itemBill.CompanyName = v.CompanyName
|
|
|
+ // itemBill.RealName = v.RealName
|
|
|
+ // itemBill.Source = 2
|
|
|
+ // itemBill.DoType = 2
|
|
|
+ // itemBill.BillDetailed = 1 // 流水加一
|
|
|
+ // itemBill.RegisterPlatform = 1
|
|
|
+ // itemBill.ChartPermissionId = activityInfo.ChartPermissionId
|
|
|
+ // itemBill.ChartPermissionName = activityInfo.ChartPermissionName
|
|
|
+ // itemBill.AdminId = AdminUser.AdminId
|
|
|
+ // itemBill.Way = 2
|
|
|
+ // userType, tripRemaining, mapChartName, err := cygxService.GetChartPermissionSpecialSurplusByCompany(v.CompanyId)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "获取专项调研剩余次数失败"
|
|
|
+ // br.ErrMsg = "获取专项调研剩余次数失败,err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if userType == 2 {
|
|
|
+ // //tripRemaining += itemBill.BillDetailed要处理
|
|
|
+ // itemBill.Total = strconv.Itoa(tripRemaining) + "次"
|
|
|
+ // } else {
|
|
|
+ // for k, num := range mapChartName {
|
|
|
+ // if activityInfo.ChartPermissionName == k {
|
|
|
+ // //num += itemBill.BillDetailed要处理
|
|
|
+ // }
|
|
|
+ // itemBill.Total += k + strconv.Itoa(num) + "次+"
|
|
|
+ // }
|
|
|
+ // itemBill.Total = strings.TrimRight(itemBill.Total, "+")
|
|
|
+ // }
|
|
|
+ // itemsBill = append(itemsBill, itemBill)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
for _, v := range listUser {
|
|
|
var item = new(cygx.CygxActivitySpecialMeetingDetail)
|
|
@@ -757,46 +757,46 @@ func (this *ActivitySpecialTripCoAntroller) MeetingDo() {
|
|
|
if _, ok := UserMap[v.UserId]; !ok {
|
|
|
item.IsAirborne = 1
|
|
|
}
|
|
|
- var itemBill = new(cygx.CygxActivitySpecialTripBill)
|
|
|
+ //var itemBill = new(cygx.CygxActivitySpecialTripBill)
|
|
|
//如果是空降客户,(没有扣点记录,或者上一次的流水不为负) 就进行扣点处理
|
|
|
- if item.IsAirborne == 1 && (mapUserLastTripBill[v.UserId] == nil || mapUserLastTripBill[v.UserId].BillDetailed >= 0) {
|
|
|
- //流水记录表
|
|
|
- itemBill.UserId = v.UserId
|
|
|
- itemBill.ActivityId = activityInfo.ActivityId
|
|
|
- itemBill.CreateTime = time.Now()
|
|
|
- itemBill.Mobile = v.Mobile
|
|
|
- itemBill.Email = v.Email
|
|
|
- itemBill.CompanyId = v.CompanyId
|
|
|
- itemBill.CompanyName = v.CompanyName
|
|
|
- itemBill.RealName = v.RealName
|
|
|
- itemBill.Source = 2
|
|
|
- itemBill.DoType = 1
|
|
|
- itemBill.BillDetailed = -1 // 流水减一
|
|
|
- itemBill.RegisterPlatform = 1
|
|
|
- itemBill.ChartPermissionId = activityInfo.ChartPermissionId
|
|
|
- itemBill.ChartPermissionName = activityInfo.ChartPermissionName
|
|
|
- itemBill.AdminId = AdminUser.AdminId
|
|
|
- itemBill.Way = 2
|
|
|
- userType, tripRemaining, mapChartName, err := cygxService.GetChartPermissionSpecialSurplusByCompany(v.CompanyId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取专项调研剩余次数失败"
|
|
|
- br.ErrMsg = "获取专项调研剩余次数失败,err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- if userType == 2 {
|
|
|
- tripRemaining -= 1
|
|
|
- itemBill.Total = strconv.Itoa(tripRemaining) + "次"
|
|
|
- } else {
|
|
|
- for k, num := range mapChartName {
|
|
|
- if activityInfo.ChartPermissionName == k {
|
|
|
- num -= 1
|
|
|
- }
|
|
|
- itemBill.Total += k + strconv.Itoa(num) + "次+"
|
|
|
- }
|
|
|
- itemBill.Total = strings.TrimRight(itemBill.Total, "+")
|
|
|
- }
|
|
|
- itemsBill = append(itemsBill, itemBill)
|
|
|
- }
|
|
|
+ //if item.IsAirborne == 1 && (mapUserLastTripBill[v.UserId] == nil || mapUserLastTripBill[v.UserId].BillDetailed >= 0) {
|
|
|
+ // //流水记录表
|
|
|
+ // itemBill.UserId = v.UserId
|
|
|
+ // itemBill.ActivityId = activityInfo.ActivityId
|
|
|
+ // itemBill.CreateTime = time.Now()
|
|
|
+ // itemBill.Mobile = v.Mobile
|
|
|
+ // itemBill.Email = v.Email
|
|
|
+ // itemBill.CompanyId = v.CompanyId
|
|
|
+ // itemBill.CompanyName = v.CompanyName
|
|
|
+ // itemBill.RealName = v.RealName
|
|
|
+ // itemBill.Source = 2
|
|
|
+ // itemBill.DoType = 1
|
|
|
+ // itemBill.BillDetailed = -1 // 流水减一
|
|
|
+ // itemBill.RegisterPlatform = 1
|
|
|
+ // itemBill.ChartPermissionId = activityInfo.ChartPermissionId
|
|
|
+ // itemBill.ChartPermissionName = activityInfo.ChartPermissionName
|
|
|
+ // itemBill.AdminId = AdminUser.AdminId
|
|
|
+ // itemBill.Way = 2
|
|
|
+ // userType, tripRemaining, mapChartName, err := cygxService.GetChartPermissionSpecialSurplusByCompany(v.CompanyId)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "获取专项调研剩余次数失败"
|
|
|
+ // br.ErrMsg = "获取专项调研剩余次数失败,err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if userType == 2 {
|
|
|
+ // tripRemaining -= 1
|
|
|
+ // itemBill.Total = strconv.Itoa(tripRemaining) + "次"
|
|
|
+ // } else {
|
|
|
+ // for k, num := range mapChartName {
|
|
|
+ // if activityInfo.ChartPermissionName == k {
|
|
|
+ // num -= 1
|
|
|
+ // }
|
|
|
+ // itemBill.Total += k + strconv.Itoa(num) + "次+"
|
|
|
+ // }
|
|
|
+ // itemBill.Total = strings.TrimRight(itemBill.Total, "+")
|
|
|
+ // }
|
|
|
+ // itemsBill = append(itemsBill, itemBill)
|
|
|
+ //}
|
|
|
items = append(items, item)
|
|
|
}
|
|
|
err = cygx.MeetingDopecialMeet(meetingUids, noMeetingUids, activityId, items, itemsBill)
|
|
@@ -806,6 +806,7 @@ func (this *ActivitySpecialTripCoAntroller) MeetingDo() {
|
|
|
return
|
|
|
}
|
|
|
go cygxService.ActivitySpecialUserLabelLogAdd(activityId, userIdArr)
|
|
|
+ go cygxService.SpecialActivityPointsBillSubmitMeeting(activityId, AdminUser.AdminId)
|
|
|
//添加操作日志记录
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|