|
@@ -1890,11 +1890,12 @@ func SpecialActivityPointsBillRoadShowReduce(log models.YanXuanActivityPointsRed
|
|
err = errors.New("GetCygxActivitySpecialTripBill" + e.Error())
|
|
err = errors.New("GetCygxActivitySpecialTripBill" + e.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- mapActivityPointsBill := make(map[int]*models.CygxActivitySpecialTripBill)
|
|
|
|
|
|
+ mapActivityPointsBill := make(map[string]*models.CygxActivitySpecialTripBill)
|
|
var itemsOld []*models.CygxActivitySpecialTripBill // 之前扣过点的流水记录
|
|
var itemsOld []*models.CygxActivitySpecialTripBill // 之前扣过点的流水记录
|
|
for _, v := range activityPointsBillList { //获取这场路演,某个研究员最后一次的扣点记录
|
|
for _, v := range activityPointsBillList { //获取这场路演,某个研究员最后一次的扣点记录
|
|
- if mapActivityPointsBill[v.ResearcherId] == nil {
|
|
|
|
- mapActivityPointsBill[v.ResearcherId] = v
|
|
|
|
|
|
+ keyBill := fmt.Sprint(v.ResearcherId, "_CID", companyId)
|
|
|
|
+ if mapActivityPointsBill[keyBill] == nil {
|
|
|
|
+ mapActivityPointsBill[keyBill] = v
|
|
if v.BillDetailed <= 0 && v.DoType == 1 {
|
|
if v.BillDetailed <= 0 && v.DoType == 1 {
|
|
itemsOld = append(itemsOld, v)
|
|
itemsOld = append(itemsOld, v)
|
|
}
|
|
}
|
|
@@ -1946,6 +1947,7 @@ func SpecialActivityPointsBillRoadShowReduce(log models.YanXuanActivityPointsRed
|
|
var itemCompanys []*models.CygxActivitySpecialPermissionPoints
|
|
var itemCompanys []*models.CygxActivitySpecialPermissionPoints
|
|
//mapResearcherId := make(map[int]bool)
|
|
//mapResearcherId := make(map[int]bool)
|
|
for _, user := range researcherList {
|
|
for _, user := range researcherList {
|
|
|
|
+ keyBill := fmt.Sprint(user.ResearcherId, "_CID", companyId)
|
|
//mapResearcherId[user.ResearcherId] = true
|
|
//mapResearcherId[user.ResearcherId] = true
|
|
item := new(models.CygxActivitySpecialTripBill)
|
|
item := new(models.CygxActivitySpecialTripBill)
|
|
item.ActivityId = activityId
|
|
item.ActivityId = activityId
|
|
@@ -1961,7 +1963,7 @@ func SpecialActivityPointsBillRoadShowReduce(log models.YanXuanActivityPointsRed
|
|
item.TableSource = utils.CYGX_OBJ_ROADSHOW
|
|
item.TableSource = utils.CYGX_OBJ_ROADSHOW
|
|
|
|
|
|
//如果没有扣点记录就对他们进行扣点处理
|
|
//如果没有扣点记录就对他们进行扣点处理
|
|
- if mapActivityPointsBill[user.ResearcherId] == nil || mapActivityPointsBill[user.ResearcherId].BillDetailed > 0 {
|
|
|
|
|
|
+ if mapActivityPointsBill[keyBill] == nil || mapActivityPointsBill[keyBill].DoType == 2 {
|
|
points := mapCompanyPoints[companyId] + billDetailed
|
|
points := mapCompanyPoints[companyId] + billDetailed
|
|
item.BillDetailed = billDetailed
|
|
item.BillDetailed = billDetailed
|
|
item.DoType = 1
|
|
item.DoType = 1
|