liuxiaolong
2020-07-29 85f9175b3064094a09dbe9f71ba37b2f11f38e5f
service/carService.go
@@ -150,9 +150,17 @@
   SpaceType             string       `json:"spaceType"`
}
func (sv *CarService) FindSpaceNo() models.PosResult {
func (sv *CarService) FindSpaceNo(userId string) models.PosResult {
   resultList := make(models.PosResult,0)
   var myPlateNosMap = make(map[string]string)
   vehicles := sv.GetVehicleListByPerson(userId)
   if vehicles != nil {
      for _,veh := range vehicles {
         myPlateNosMap[veh.PlateNo] = veh.PlateNo
         //myPlateNos = append(myPlateNos, veh.PlateNo)
      }
   }
   //bindCars := strings.Join(myPlateNos, ",")
   //先查车库唯一标识
   //parkList := sv.getHikParkList() //先查有几个停车场
   //if parkList != nil {
@@ -161,6 +169,7 @@
         reqBody := map[string]interface{} {
            //"parkSyscode": p.ParkIndexCode,//停车库唯一标识
            //"state": 1, //车位状态,0:空闲,1:停车
            //"bindCars": bindCars,
            "pageNo": 1,
            "pageSize": 1000,
         }
@@ -179,11 +188,16 @@
               return nil
            }
            for _,s := range spaceList {
               isMine := false
               if _,exist := myPlateNosMap[s.PlateNos]; exist {
                  isMine = true
               }
               pi := models.PosInfo {
                  SpaceNo: s.SpaceNo,
                  PosNo: "",
                  State: s.State,
                  PlateNo: s.PlateNos,
                  IsMine: isMine,
               }
               if v,ok := models.SpaceNo2Pos[s.SpaceNo];ok {
                  pi.PosNo = v