ziwen 1 tahun lalu
induk
melakukan
918be6aa08

+ 11 - 2
controllers/company.go

@@ -9220,7 +9220,6 @@ func (this *CompanyTodoController) CompanyActivitySpecialPointsBill() {
 	for i, v := range list {
 		item := cygx.CygxActivitySpecialPointsBillRespItem{
 			Id:                  v.Id,
-			Content:             v.ActivityName,
 			CreateTime:          v.CreateTime.Format(utils.FormatDateTime),
 			CompanyId:           v.CompanyId,
 			CompanyName:         v.CompanyName,
@@ -9232,6 +9231,15 @@ func (this *CompanyTodoController) CompanyActivitySpecialPointsBill() {
 		}
 		if v.ActivityId == 0 {
 			item.Content = v.Content
+		} else {
+			if v.DoType == 1 && v.Way == 1 {
+				item.Content = item.ActivityName + "--报名"
+			} else if v.DoType == 2 && v.Way == 1 {
+				item.Content = item.ActivityName + "--取消报名"
+			} else if v.Way == 4 {
+				item.Content = item.ActivityName + "--活动取消"
+			}
+
 		}
 		if userType == 2 {
 			if i== 0{
@@ -9243,8 +9251,9 @@ func (this *CompanyTodoController) CompanyActivitySpecialPointsBill() {
 				if num > 0 {
 					if i== 0{
 						item.Total += k + strconv.Itoa(num) + "次+"
+					} else {
+						item.Total += k + strconv.Itoa(num-v.BillDetailed) + "次+"
 					}
-					item.Total += k + strconv.Itoa(num-v.BillDetailed) + "次+"
 				}
 			}
 			item.Total = strings.TrimRight(item.Total, "+")

+ 2 - 0
controllers/cygx/activity_special.go

@@ -521,6 +521,8 @@ func (this *ActivitySpecialCoAntroller) PublishAndCancel() {
 		updateParams["PublishDate"] = time.Now()
 	} else {
 		item.PublishStatus = 0
+		// 取消专项调研返点
+		go cygxService.ActivitySpecialPublishAndCancel(activityInfo)
 	}
 	updateParams["PublishStatus"] = item.PublishStatus
 	item.ActivityId = req.ActivityId

+ 2 - 1
models/cygx/activity_special_trip_bill.go

@@ -21,7 +21,7 @@ type CygxActivitySpecialTripBill struct {
 	DoType            int       `description:"操作方式,1报名,2取消报名"`
 	RegisterPlatform  int       `description:"来源 1小程序,2:网页"`
 	ChartPermissionId int       `description:"行业id"`
-	Way               int       `description:"1报名,取消报名。2到会取消到会"`
+	Way               int       `description:"1报名,取消报名。2到会取消到会 3转正或清零 4取消活动"`
 	Content           string    `description:"内容"`
 }
 
@@ -128,6 +128,7 @@ type CygxActivitySpecialTripBillDetailList struct {
 	ChartPermissionId   int       `description:"行业id"`
 	ChartPermissionName string    `description:"行业名称"`
 	Content             string    `description:"内容"`
+	Way                 int       `description:"1报名,取消报名。2到会取消到会 3转正或清零 4取消活动"`
 }
 
 func GetCygxActivitySpecialTripBillDetailList(condition string, pars []interface{}) (item []*CygxActivitySpecialTripBillDetailList, err error) {

+ 19 - 0
services/cygx/activity_special.go

@@ -579,6 +579,7 @@ func ActivitySpecialCompanyApproval(companyId int,companyName string) (err error
 	itemBill.CompanyName = companyName
 	itemBill.Source = 2
 	itemBill.DoType = 2
+	itemBill.Way = 3
 	itemBill.Content = "套餐转正"
 	if userType == 2{
 		packageTypeMap := map[int]int{1: 16, 2: 10}
@@ -592,4 +593,22 @@ func ActivitySpecialCompanyApproval(companyId int,companyName string) (err error
 		return
 	}
 	return
+}
+
+
+// 取消专项调研返点
+func ActivitySpecialPublishAndCancel(activityInfo *cygx.ActivitySpecialDetail) (err error) {
+	itemBill := new(cygx.CygxActivitySpecialTripBill)
+	itemBill.CreateTime = time.Now()
+	itemBill.ActivityId = activityInfo.ActivityId
+	itemBill.Content = activityInfo.ResearchTheme + "--活动取消"
+	itemBill.Source = 2
+	itemBill.DoType = 2
+	itemBill.Way = 4
+	itemBill.BillDetailed = 1
+	err = cygx.AddCygxActivitySpecialTripBill(itemBill)
+	if err != nil {
+		return
+	}
+	return
 }