|
@@ -539,21 +539,21 @@ func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, tri
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
- ActivitySpecialCompanyApproval(7030, 1259, "怀民大套餐客户")
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
func ActivitySpecialCompanyApproval(companyId, companyContractId int, companyName string) (err error) {
|
|
@@ -882,3 +882,68 @@ func HandleActivitySpecialTripBillTotalText(user *cygx.UserAndCompanyName) (tota
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func initnee885() {
|
|
|
+ list, err := cygx.GetBestNewBillList()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+ var items []*cygx.CygxActivitySpecialPermissionPoints
|
|
|
+ for _, v := range list {
|
|
|
+ fmt.Println(v.Total)
|
|
|
+ if v.Total == "" || v.Total == "0" || v.Total == "0次" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
+ sliceTotal := strings.Split(v.Total, "+")
|
|
|
+
|
|
|
+ for _, vs := range sliceTotal {
|
|
|
+ var points string
|
|
|
+ item := new(cygx.CygxActivitySpecialPermissionPoints)
|
|
|
+ if strings.Contains(vs, "医药") {
|
|
|
+ item.ChartPermissionName = "医药"
|
|
|
+ points := strings.Replace(vs, "医药", "", -1)
|
|
|
+ fmt.Println(points)
|
|
|
+ points = strings.Replace(points, "次", "", -1)
|
|
|
+ item.Points, _ = strconv.Atoi(points)
|
|
|
+ item.ChartPermissionId = 22
|
|
|
+ } else if strings.Contains(vs, "消费") {
|
|
|
+ item.ChartPermissionName = "消费"
|
|
|
+ points := strings.Replace(vs, "消费", "", -1)
|
|
|
+ points = strings.Replace(points, "次", "", -1)
|
|
|
+ item.ChartPermissionId = 21
|
|
|
+ item.Points, _ = strconv.Atoi(points)
|
|
|
+ } else if strings.Contains(vs, "科技") {
|
|
|
+ item.ChartPermissionName = "科技"
|
|
|
+ points := strings.Replace(vs, "科技", "", -1)
|
|
|
+ points = strings.Replace(points, "次", "", -1)
|
|
|
+ item.ChartPermissionId = 20
|
|
|
+ item.Points, _ = strconv.Atoi(points)
|
|
|
+ } else if strings.Contains(vs, "智造") {
|
|
|
+ item.ChartPermissionName = "智造"
|
|
|
+ points := strings.Replace(vs, "智造", "", -1)
|
|
|
+ points = strings.Replace(points, "次", "", -1)
|
|
|
+ item.ChartPermissionId = 19
|
|
|
+ item.Points, _ = strconv.Atoi(points)
|
|
|
+ } else {
|
|
|
+ points = strings.Replace(vs, "次", "", -1)
|
|
|
+ item.Points, _ = strconv.Atoi(points)
|
|
|
+ }
|
|
|
+ fmt.Println("points", points)
|
|
|
+ fmt.Println(vs)
|
|
|
+
|
|
|
+ item.CompanyId = v.CompanyId
|
|
|
+ item.CompanyName = v.CompanyName
|
|
|
+ item.CreateTime = time.Now()
|
|
|
+ item.ModifyTime = time.Now()
|
|
|
+ fmt.Println(item)
|
|
|
+ items = append(items, item)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ fmt.Println(len(items))
|
|
|
+ err = cygx.MultiAddCygxActivitySpecialPermissionPoints(items)
|
|
|
+ fmt.Println(err)
|
|
|
+
|
|
|
+}
|