Blame view

parking-module-pay/src/main/java/com/zteits/pay/util/DealThirdPushUtil.java 2 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  package com.zteits.pay.util;
  
  import java.util.Random;
  
  /***
   *
   * Copyright: Copyright (c) 2017  ZTE-ITS
   *
   * @ClassName: DealThirdPushUtil.java
   * @Description:
   * @version: v1.0.0
   */
  public class DealThirdPushUtil {
  
      /**
       * 根据出入口数量设置名称
       * @param count
       * @param inOut:0 入  1出
       */
      public static String getInOutName(int count, int inOut){
          if( 0 == inOut){
              switch (count){
                  case 0:
                      return "出入口";
                  case 1:
                      return "入口";
                  case 2:
                      return "入口"+getRandom(2);
                  case 3:
                      return "入口"+getRandom(3);
                  case 4:
                      return "入口"+getRandom(4);
                  default:
                      return "入口";
              }
          }else{
              switch (count){
                  case 0:
                      return "出入口";
                  case 1:
                      return "出口";
                  case 2:
                      return "出口"+getRandom(2);
                  case 3:
                      return "出口"+getRandom(3);
                  case 4:
                      return "出口"+getRandom(4);
                  default:
                      return "出口";
              }
          }
      }
  
      /**
       * 根据传入值获取随机数
       * @param r
       */
      private static int getRandom(int r){
          Random random = new Random();
          return random.nextInt(r)+1;
      }
  
      /**
       * 返回车辆类型名称
       * @param cartype
       * @return
       */
      public static String getCartypeName(int cartype){
          String carTypeName = "";
          switch (cartype){
              case 1:
                  carTypeName = "大型车";
                  break;
              case 2:
                  carTypeName = "小型车";
                  break;
              default:
                  carTypeName = "未知车型";
                  break;
          }
          return carTypeName;
      }
  }