| | |
| | | } |
| | | |
| | | func nightPush(curTimes int){ |
| | | |
| | | message := fmt.Sprintf("%s 请尽快驶出停车场", time.Now().Format("2006-01-02 15:04:05")) |
| | | b, e, aliasArr,carOwnNames := service.NightPush("温馨提示", message) |
| | | //记录推送日志 |
| | |
| | | if curTimes == 3 { //只给管理员推送一次这个消息 |
| | | //将具体的车主信息推送给管理员 |
| | | if carOwnNames != nil && len(carOwnNames) >0 { |
| | | //获取车主姓名 |
| | | managerMsg := strings.Join(carOwnNames, ",") |
| | | var filterdNames []string |
| | | for _,con := range carOwnNames { |
| | | if con != "无车牌" { |
| | | filterdNames = append(filterdNames, con) |
| | | } |
| | | } |
| | | if len(filterdNames) == 0 { |
| | | return |
| | | } |
| | | //获取车主姓名,无牌车的消息不给管理员推送 |
| | | managerMsg := strings.Join(filterdNames, ",") |
| | | mb,me, managerArr := service.Push2Manager(fmt.Sprintf("%s 未驶离车辆", time.Now().Format("2006-01-02 15:04:05")), managerMsg, false) |
| | | mLogE := models.Log{ |
| | | Id: uuid.NewV4().String(), |
| | |
| | | } |
| | | c.Data["json"] = resp |
| | | c.ServeJSON() |
| | | } |
| | | } |