|  |  |  | 
|---|
|  |  |  | int x = bay; | 
|---|
|  |  |  | int y = row; | 
|---|
|  |  |  | //2楼 | 
|---|
|  |  |  | if(floor == 1){ | 
|---|
|  |  |  | x = generateMap1Bay(bay); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //2楼 | 
|---|
|  |  |  | if(floor == 2){ | 
|---|
|  |  |  | y = generateMap2Row(row); | 
|---|
|  |  |  | //y = generateMap2Bay(bay); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ////3楼 | 
|---|
|  |  |  | //if(floor == 3){ | 
|---|
|  |  |  | //    y = generateMap3Row(row); | 
|---|
|  |  |  | //    x = generateMap3Bay(bay); | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | if(floor == 3){ | 
|---|
|  |  |  | y = generateMap3Row(row); | 
|---|
|  |  |  | //                x = generateMap3Bay(bay); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ArrayList rowData = arrayLists.get(x); | 
|---|
|  |  |  | Object o = rowData.get(y); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return JSONObject.toJSONString(arrayLists); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | private Integer generateMap1Bay(int bay){ | 
|---|
|  |  |  | int y = bay; | 
|---|
|  |  |  | Integer[] bayAdd = {1,3,5,7,9,11,13,15,17,19}; | 
|---|
|  |  |  | for(int i=0; i<bayAdd.length; i++){ | 
|---|
|  |  |  | if(bay > bayAdd[i]){ | 
|---|
|  |  |  | y ++; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return y; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Integer generateMap2Row(int row){ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Integer generateMap3Row(int row){ | 
|---|
|  |  |  | int x = row; | 
|---|
|  |  |  | Integer[] rowAdd = {2,4,6,7,8,10,12,13,15,17,19,21,23,24,26,28,30,32}; | 
|---|
|  |  |  | Integer[] rowAdd = {2,4,6,8,10,12,14,15,17,19,21,22,24,26,28,30,32}; | 
|---|
|  |  |  | for(int i=0; i<rowAdd.length; i++){ | 
|---|
|  |  |  | if(row >= rowAdd[i]){ | 
|---|
|  |  |  | x ++; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(row >8) x += 9; | 
|---|
|  |  |  | return x; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|