|
@@ -539,21 +539,21 @@ func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, tri
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
- ActivitySpecialCompanyApproval(7030, 1259, "怀民大套餐客户")
|
|
|
-
|
|
|
- // //格式化合同开始时间
|
|
|
- // contractStartDate, tmpErr := time.Parse(utils.FormatDate, "2023-12-19")
|
|
|
- //
|
|
|
- // if tmpErr != nil {
|
|
|
- // fmt.Println(tmpErr)
|
|
|
- // return
|
|
|
- // }
|
|
|
- //
|
|
|
- // if time.Now().After(contractStartDate) {
|
|
|
- // fmt.Println("go")
|
|
|
- // }
|
|
|
-}
|
|
|
+//func init() {
|
|
|
+// ActivitySpecialCompanyApproval(7030, 1259, "怀民大套餐客户")
|
|
|
+
|
|
|
+// //格式化合同开始时间
|
|
|
+// contractStartDate, tmpErr := time.Parse(utils.FormatDate, "2023-12-19")
|
|
|
+//
|
|
|
+// if tmpErr != nil {
|
|
|
+// fmt.Println(tmpErr)
|
|
|
+// return
|
|
|
+// }
|
|
|
+//
|
|
|
+// if time.Now().After(contractStartDate) {
|
|
|
+// fmt.Println("go")
|
|
|
+// }
|
|
|
+//}
|
|
|
|
|
|
// 审批通过的时候专项调研次数更新
|
|
|
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
|
|
|
+ }
|
|
|
+ //智造5次+科技5次+消费5次+医药4次
|
|
|
+ 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)
|
|
|
+
|
|
|
+}
|